Presentation is loading. Please wait.

Presentation is loading. Please wait.

Agent-Oriented Knowledge Representation

Similar presentations


Presentation on theme: "Agent-Oriented Knowledge Representation"— Presentation transcript:

1 Agent-Oriented Knowledge Representation
Jacques Robin

2 Outline MOF2 and Metamodeling UML2 Active classes and objects
UML2 Components UML2 Protocol state machines UML2 Profiles A UML2 Profile for Multi-Agent Systems (MAS) A simple MAS model using the profile

3 Meta-modeling and MOF2 Q: What is a meta-model?
A: A base of structural meta-knowledge that defines the constructs (vocabulary) and their possible relations (grammar) of the knowledge representation language used to specify an agent’s knowledge It does not contain knowledge about the agent’s environment, only about the language that the agent uses to represent such knowledge MOF2 key ideas: Reuse structural core of UML2 for meta-modeling purposes While a class diagram specifying knowledge about a given domain is part of a UML model, a class diagram specifying constructs of a knowledge representation (or modeling) language is a MOF meta-model The abstract constructs and concrete visual syntax of a UML domain model and MOF meta-model are the same, only the modeling purposes and levels are different Meta-circularity: MOF2 is its own meta-model (the meta-meta-model)

4 MOF2 Meta-Models vs. BNF Grammars
Same purpose Advantages of MOF: Abstract instead of concrete syntax (more synthetic) Visual notation instead of textual notation (clarity) Graph-based instead of tree-based (abstracts from any reader order) Entities (classes) have internal structure and behavior (strings do not) Relations include generalization and undirected associations instead of only order Specification reuse through inheritance and package relationships Additional advantages with OCL: OCL constraint apply equally well to meta-models than to models Allows expressing arbitrary complex logical constraints among language elements (more expressive) Allows defining formal semantics without mathematical syntax

5 Simplified MOF2 Meta-Model of itself
NamedElement BehavioralFeature StructuralFeature Operation Parameter * Property * Classifier Feature TypedElement Type ValueSpecification 1..* Relationship RedefinableElement * NamedElement Element * InstanceSpecification Constraint * Generalization * Association Class AssociationClass DataType PrimitiveType Enumeration Interface

6 UML2 Active x Passive Objects
Active objects Instances of active classes Possess their own, continuous execution thread Concurrent to other active objects Exchange data with other active objects asynchronously through message passing Does not wait for the other active object target of the message to respond to pursue its own processing Can be pro-active: execute behavior on its own initiative without waiting to receive a request from another object Passive (regular) objects Instances of passive (regular) classes Share a single thread with the other passive objects constituting a sequential application Exchange data with other passive objects synchronously through method invocation Interrupts its processing, waiting for an answer of the other passive object before pursuing its own processing Purely reactive: execute behavior only as response to a method invocation request from another object

7 UML2 Active Classes and Objects
UML2 classes can encapsulate other classes Thus, UML2 objects can encapsulate other objects

8 UML 2.0 Component Meta-Model
Property Structural Feature Type Classifier TypedElement Association PackagableElement * StrcuturedClassifier part * Connector * EncapsulatedClassifier ConnectableElement ConnectorEnd 2..* * Port * Class Component required * provided Classifier Interface

9 UML2 Components: Key Distinctions
UML2 Component Classes appearing in Class Diagrams together with UML2 Classes, Associations, Interfaces, Ports, Dependency and Realization Relationships UML2 Component Instances appearing in Object Diagrams together with UML2 Objects, Links, Ports and Connector Relationships UML2 Component Specification diagram that, represents the component as a black box, describes only what the component does, i.e., its provided services and externally visible states and what the component needs from its external environment, i.e., its required services. UML2 Component Realization diagram that, represents the component as a white box, describes how the component does what it does, by way of an internal assembly from lower granularity components, classes and assoiciations that it encapsulates.

10 Component Class vs. Standard OO Programming Class
Medium granularity intermediate between system and class, corresponding to that of a module, a library, an API or a package Necessarily encapsulates behavior, possibly also data Possesses meta-data describing its services and requirements to compose/assemble it with other components Necessarily designed by contract by realizing and requiring interfaces Relationships with other component classes: essentially horizontal clientship, possibly also encapsulating containment and conceptual generalization Compiled independently of other components, allowing binary, source code language independent compatibility Not necessarily object-oriented OOP class: Fine grained unit Necessarily encapsulates data, possibly also behavior Does not possess descriptive meta-data Not necessarily designed by contract Relationship with other classes: essentially conceptual generalization, possibly also horizontal clientship and encapsulating containment Compiled together with the other classes of a program, thus preventing binary, source code language independent compatibility

11 Component Class vs. Module, Library, Package and API
Ambiguous term, can mean only an interface specification or an interface specification and its implementation A component class always means the latter Modules, libraries, packages and APIs: Not independently deployable Single unit of compilation Source code language dependent Only encapsulates behavior not data No user interface nor testing interface No meta-data Libraries and APIs: No conceptual generalization relationships No encapsulating containment relationships Modules and Packages: Merely a source code structuring namespaces No instantiation as run-time entity

12 Component Instance vs. Object
Independently deployable At run time subject to service invocation At deployment time subject to composition/assembly Possesses meta-data accessible at run time through access methods that describe its services and requirements Possesses a user-interface for stand-alone deployment Not necessarily object-oriented A server component instance can be substituted by another one that conforms to its contract with no need to recompile or even to interrupt the client component instances Client component code independent of server component deployment location Object: Must be wrapped inside a program to be executed Only subject to method invocation Two object that cooperate to provide a service must be recompiled together to modify one of them Client object method code dependent of server object method code deployment location

13 UML2 Components Instantiating a component class to create a component object is a complex process that involves: Instantiating of its encapsulated owned components, classes and associations, and Assembling these instances together through connectors Principles of component-based object-oriented representations: Recursive decomposition: components are internally assembled from smaller and smaller ones down to those made of a single class Uniformity: everything is a component, including the entire system Locality: a given diagram shows only the part of the entire model that is visible from the local perspective of a single <<subject component>> Q: Why are UML2 components interesting for AI system engineering? A: In essence, agents are UML2 active components

14 Agents as Active UML2 Components: MAS Simulation Specification Class Diagram
<<interface>> Simulation +run +stop Realization relationship: component realizes services provided by interface Sim Port: encapsulated classifier connection point with environment <<subject component>> Simulation +state:SimStateKind SimAg SimEnv <<enumeration>> SimStateKind running stopped

15 <<enumeration>>
Agents as Active UML2 Components: MAS Simulation Realization Class Diagram <<enumeration>> SimStateKind running stopped Port for connection w/ sub-component SimAg Sim SimEnv <<subject component>> Simulation +state:SimStateKind Dependency relationship: component requires services provided by interface to provide the services it itself realizes <<interface>> SimAg +create +terminate +getAgState():AgPubStateKind <<interface>> SimEnv +create +terminate +getEnvState():EnvPubStateKind <<enumeration>> AgPubStateKind empty initialized perceptReceived actionSent <<enumeration>> EnvPubStateKind empty initialized perceptsSent actionsReceived SimAg <<component>> Environment SimEnv Sensors Effectors Sensors Effectors <<component>> Agent

16 <<subject component>> <<component>>
Agents as Active UML2 Components: MAS Simulation Realization Object Diagram SimAg Sim SimEnv <<subject component>> :Simulation Sensors <<component>> Ag1:Agent SimAg <<component>> : Environment Effectors Sensors Effectors . . . SimAg Sensors <<component>> AgN:Agent SimAg Effectors

17 Agents as Active UML2 Components: Agent Specification Class Diagram
Sim <<interface>> SimAg +create +terminate +getAgState():AgPubStateKind <<component>> Simulation +state:SimStateKind <<enumeration>> SimStateKind running stopped SimAg SimEnv Percept Percept1 Percept2 SimAg SimEnv <<interface>> Sensors +receive1():Percept1 +receive2():Percept2 <<interface>> Effectors +send1(p:Percept1,,ag:Agent) +send2(p:Percept2.ag:Agent) <<subject component>> Agent Sensors Effectors <<component>> Environment Sensors Effectors <<enumeration>> AgPubStateKind empty initialized perceptReceived actionSent Action <<interface>> Effectors +send1(ac:Action1) +send2(ac:Action2) <<interface>> Sensors +receive1(ag:Agent):Action1 +receive2(ag:Agent):Action2 Action1 Action2

18 Agents as Active UML2 Components: Agent Specification Object Diagram
Sim <<component>> : Simulation SimAg SimEnv SimAg Sensors Effectors SimEnv <<subject component>> :Agent <<component>> : Environment Effectors Sensors

19 Agents as Active UML2 Components: Agent Realization Class Diagram
<<subject component>> :Agent AgSimModel SimModel <<component>> BeliefReviser <<interface>> updateFromPercept +update(o:AgSimModel,p:Percept):AgSimModel <<delegates>> Sensors <<component>> ActionChooser <<interface>> chooseAction +choose(m:AgSimModel):Action <<delegates>> <<interface>> updateFromPredictedActionEffect +update(o:AgSimModel,a:Action):AgSimModel <<component>> ActionEffectPredictor Effectors SimAg

20 Agents as Active UML2 Components: Agent Realization Object Diagram
<<subject component>> :Agent Sensors :Percept <<component>> :BeliefReviser <<delegates>> m0:AgSimModel m1:AgSimModel <<component>> :ActionEffectPredictor <<delegates>> <<component>> :ActionChooser :Action Effectors m2:AgSimModel SimAg

21 <<component>>
Agents as Active UML2 Components: Environment Specification Class Diagram Sim <<component>> Simulation +state:SimStateKind <<enumeration>> SimStateKind running stopped <<interface>> SimEnv +create +terminate +getEnvState():EnvPubStateKind SimAg SimEnv Percept Percept1 Percept2 SimAg SimEnv Sensors Effectors <<component>> Agent <<subject component>> Environment <<interface>> Sensors +receive1():Percept1 +receive2():Percept2 <<interface>> Effectors +send1(p:Percept1,,ag:Agent) +send2(p:Percept2.ag:Agent) Effectors <<enumeration>> EnvPubStateKind empty initialized perceptsSent actionsReceived Action <<interface>> Effectors +send1(ac:Action1) +send2(ac:Action2) <<interface>> Sensors +receive1(ag:Agent):Action1 +receive2(ag:Agent):Action2 Action1 Action2

22 Agents as Active UML2 Components: Environment Specification Object Diagram
Sim <<component>> : Simulation SimAg SimEnv SimAg Sensors <<component>> Ag1:Agent SimEnv Effectors <<subject component>> : Environment Effectors . . . Sensors SimAg Sensors <<component>> AgN:Agent Effectors

23 <<subject component>> +EnvPubState:EnvPubStateKind
Agents as Active UML2 Components: Environment Realization Class Diagram <<subject component>> Environment +EnvPubState:EnvPubStateKind EnvSimModel SimModel <<component>> DirectEffectUpdater <<interface>> updateFromDirectEffects +update(o:EnvSimModel,ac:Action):EnvSimModel <<delegates>> Sensors SimAg <<component>> Ramifier <<interface>> updateFromRamifications +update(o:EnvSimModel):EnvSimModel <<interface>> computeNewPercepts +percept(o:EnvSimModel,a:Agent):Percept <<component>> PerceptUpdater <<delegates>> Effectors

24 <<subject component>>
Agents as Active UML2 Components: Environment Realization Object Diagram <<subject component>> :Environment Sensors <<component>> :DirectEffectUpdater <<delegates>> :Action m0:EnvSimModel m1:EnvSimModel <<component>> :Ramifier SimAg m2:EnvSimModel :Percept <<component>> :PerceptUpdater <<delegates>> Effectors

25 BehavioredClassifier
UML2 Common Behaviors * Classifier Feature method Behavior specification Activity Interaction StateMachine 0..1 BehavioredClassifier BehavioralFeature StructuralFeature Trigger * Signal Reception Class isActive = true Interface * 0..1 * Operation Class SendOperationEvent ReceiveOperationEvent SendSignalEvent Event ReceiveSignalEvent Classifier TimeEvent ValueSpecification ChangeEvent

26 UML2 Protocol State Machines
Specialization of state machines to specify interaction protocols between concurrent components, i.e., How the state S of component C restricts the operations Os1, ... Osk that another component can request C to execute What are the states S1, ... Sk, that result from the execution in S of Os1, ... Osk (respectively) Useful for represent cooperation, competition and negotiation protocols among agents Meta-model: Concrete transition syntax: [<pre-Condition>] <Operation> / <post-Condition> source target outgoing incoming postCondition preCondition StateMachine ProtocolStateMachine State Vertex ProtocalTransition Constraint Operation * Pseudostate kind:Pseudostatekind <<enumeration>> PseudostateKind initial join fork junction choice entryPoint exitPoint terminate 1..*

27 UML2 Protocol State Machines: Examples
empty initialized init()/ create()/ perceptsReceived actionsSent receive() send(action)/ AgentPSM {protocol} EnvironmentPSM {protocol} create()/ init()/ empty initialized send(agent1,percept1)/ receive(agent1)/ ... ... perceptsSent actionsReceived send(agentN,perceptN)/ receive(agentN/) State PseudoState Operation PseudoState ProtocolTransition

28 UML2 Profiles Self-extension mechanism to customize UML2 towards:
Specific application families (i.e., multi-agent simulations) Specific implementation platforms (i.e., EJB, .net, web services) A profile is a set of stereotypes Concrete syntax: <<string>> and/or icon Stereotypes are specializations of meta-classes from the UML2 meta-model UML2 Superstructure Meta-Model UML2 Extension/Customization Language Meta-Model Profile ProfileApplication * * meta-class Package Class Property Association Stereotype * ExtensionEnd * Extension Image icon

29 MOF Meta-Model of a Simple Multi-Agent Simulations Modeling Language (MASML)
2..* Environment Agent Sensor Actuator 1..* Percept AgentAction ReasoningComponent Agent ReflexAgent ReflexComponent ReasoningComponent Sensor Actuator 1..* Agent AutomataAgent EnvironmentStateModel ModelInitializationComponent PercpetInterpretationComponent RamificationComponent ModelBasedBehaviorStrategyComponent ReasoningComponent Actuator Sensor 4..* 1..* AutomataAgent GoalBasedAgent Goal GoalInitializationComponent GoalUpdateComponent GoalBasedBehaviorStrategyComponent ReasoningComponent 3..* EnvironmentStateModel ModelBasedBehaviorStrategyComponent

30 MOF Meta-Model of a Simple Multi-Agent Simulations Modeling Language (MASML)
KBAgent ReflexAgent ReflexKBAgent ReflexKBComponent ReflexComponent KBAgent KBComponent PersistentKB ReflexKB context ReflexKBComponent inv Volat ileKB.isEmpty() 1..* Agent ReasoningComponent KnowledgeBase KBSentence 1..* KBAgent KBComponent PersistentKB VolatileKB 1..* 0..* GoalBasedKBAgent GoalBasedAgent AutomataKBAgent AutomataAgent 6..* GoalBasedKBAgent KBComponent 3 ..* 4 ..* 4..* AutomataKBAgent KBComponent 4 ..* KBAgent GoalKB EnvironmentStateModelKB KBAgent EnvironmentStateModelKB VolatileKB Goal EnvironmentStateModel VolatileKB EnvironmentStateModel

31 EnvironmentStateModel
UML2 Profile for MAS MASML Meta-Model UML2 Meta-Model MAS Component isActive = true Environment Agent ReasoningComponent Component Sensor Port Actuator Percept Signal AgentAction EnvironmentStateModel Model Package PackagableElement TypedElement * KnowledgeBase KBSentence


Download ppt "Agent-Oriented Knowledge Representation"

Similar presentations


Ads by Google