520 likes | 631 Views
CAMLE: Caste-Centric Agent-Oriented Methodology, Languages and Environment. Hong Zhu Dept of Computing Oxford Brookes University. Outline. Overview of CAMLE’s research work Meta-model Static aspect Dynamic aspect Languages and environments Requirements analysis and design
E N D
Overview of CAMLE CAMLE: Caste-Centric Agent-Oriented Methodology, Languages and Environment Hong Zhu Dept of Computing Oxford Brookes University
Outline • Overview of CAMLE’s research work • Meta-model • Static aspect • Dynamic aspect • Languages and environments • Requirements analysis and design • Formal specification • Programming and implementation • Testing and maintenance • Emergent behaviours • Framework • Case study • Work in progress and related works Overview of CAMLE
Heuristics Knowledge about how to use the languages and the processes in the form of heuristic rules, success stories and examples of failures. Languages The languages to describe problems to be solved and the solutions (the specific systems) at various levels of abstraction. Processes The processes that lead engineers from problems to solutions in a repeatable manner. Methodologist’s Perspective of SE Tools and Development Environments Meta-model The model defines the world of computer systems, i.e. the problem space and the solution space. Overview of CAMLE
Development of Web Services Development process model (Growth Model) Overview of CAMLE’s Research Activities Tool-Level Modelling Tools & Env. (CAMLE) Maintenance & Testing Env&Tools (AquIS, Ontology of ST) Formal Reasoning (Scenario Calculus) Programming Env. (SLABSp) Method-Level Case Studies Modelling, Anal.,Design (CAMLE) Formal Specification (SLABS) Implementation &Programming (SLABSp) Caste-Centric Meta-Model of MAS Meta-Level Overview of CAMLE
Outline • Overview of CAMLE’s research work • Meta-model • Static aspect • Dynamic aspect • Languages and environments • Emergent behaviours • Work in progress and related works Overview of CAMLE
Problems nicely represented in a methodology Solutions directly supported by technology & infrastructure Meta-Models of Information Systems • Static aspect: What constitute a system? • Dynamic aspect: How does a system work? New technology and infrastructure Problems mapping into a solution awkwardly Overview of CAMLE
CAMLE’s Meta-Model Static Aspect: Constituent Elements Agents are active computational entities that situate in their designated environments and contains the following three functional parts • Data: the state of the agent (visible, or internal) • Operations: the actions that an agent can take (visible or internal) • Behaviour: the rules the control the agent’s actions and state changes Castes are modular units in the construction of agent-oriented systems. • Each caste encapsulate a set of interrelated functional parts of data, operations, behaviour rules and the environments. Overview of CAMLE
Relationship Between Agents and Castes If an agent has a casteship of a caste, it has all the data, operation behaviour and environment features defined by the caste. • Dynamic casteship: • An agent can change its casteship relation with a caste at run-time by join a caste or quit from a caste. • Multiple casteship: • An agents can have casteship with a number of castes. • Adaptive casteship: • An agent’s casetship to a caste has two states: active and inactive • The state of a casteship can be changes at runtime by taking actions of deactivate and activate. The relationship between agents and castes is similar to the relationship between objects and classes, but there are fundamental differences. Overview of CAMLE
Part-Whole Relationship Between Agents • Aggregate: • The part is independent of the whole, but in collaborative to the whole • If the whole is destroyed, the part is not effected • Composite: • The part is controlled by the whole • When the whole is destroyed, the parts are also destroyed • Congregation: • The parts are autonomous, cooperative and rely on the whole to benefits from the membership. • When the whole is destroyed, the part is still alive but will not benefit as the part, i.e. it will lost certain casteship. Overview of CAMLE
Dynamics Aspects Communication Mechanism • Agents communicate with each other by • Taking visible actions • Visible actions can be observed by other agents in the system • Visible variables: whose values can be read by other agents in the systems, but not changed • Observing other agents’ actions: • An agent only selectively observes a subset of other agents in the system. This subset forms the agent’s environment • Takes corresponding actions defined by its behaviour rules Overview of CAMLE
Agent’s Environment • Intuitively, the elements in the environment of an agent can be • Objects • Software agents • Other agents • Users • Object is a degenerate form of agent. • Environment can be explicitly declared by specifying the subset of agents in the system All of them can be regarded as agents! Overview of CAMLE
Designated Environment • Explicit specification of environment by declaring which agent is in its environment • All: Caste -- All the agents in the caste • Agent: Caste -- A specific agent of the caste • Var: Caste -- A variable agent in the caste • An agent can change its environment • By joining a caste • By quitting a caste • By changing the value of environment variables • The environment of an agent can also change beyond the agent’s control • Other agents join or quit a caste that is a part of the agent’s environment • Consequently, the environment is not completely open, not closed, not fixed. Overview of CAMLE
Structure of Agents Agent name: • It is the identity of the agent. Environment description: • It indicates a set of agents that interact with the agent. State space: • It consists of a collection of variables that defines the state space. • Divided into the visible part and the internal state Actions: • They are the atomic actions that the agent can take. • Each action has a name and may have parameters. • An action can be visible or internal Behaviour rules. • It is the body of the agent that determines its behaviour. Overview of CAMLE
The Body of Agents Begin Initialisation of internal state; Loop Perception of the visible actions and the visible states of the agents in its environment; Decision on which action to take according to the situation in the environment and its internal state End of loop; End This is only a rough illustration of atomic agents’ behaviour. Overview of CAMLE
Outline • Caste-centric meta-model of MAS • Languages • Modeling language CAMLE • Specification language SLABS • Programming language SLABSp • Emergent behaviours • Related work and work in progress Overview of CAMLE
Modelling Language CAMLE • CAMLE stands for Caste-centric Agent-oriented Modelling Language and Environment. • Based on the caste-centric meta-model of multi-agent systems • For analysis and design of multi-agent systems • Supported by an automated modelling environment • Model construction • Model consistency and completeness check • Generation of formal specifications in SLABS See (Shan, L and Zhu, H., 2004a, 2004b; Zhu, H. and Shan, L. 2005a, 2005b, etc.) for details. Overview of CAMLE
Overall Structure ofCAMLE Models • A CAMLE model consists of • a caste model • collaboration models • behaviour models Collaboration Models and Behavior models Caste Model with Whole-Part Relations Overview of CAMLE
Caste Model Example • Caste model • models the organizational structure • Caste diagram • Defines the castes in the system • Specifies their relations Notation Overview of CAMLE
Collaboration Models • Collaboration Diagram • Describes the dynamics of a system from communication perspective • The structure of collaboration models • A hierarchic of collaboration models as refinement of castes • A collaboration model for each compound caste: • a general collaboration diagram + a set of scenarios specific collaboration diagrams Notation Example Overview of CAMLE
Behaviour Models • Scenario diagram • Describes a typical situation in the operation of a system from an agent’s view. • used in behaviour diagrams • behaviour diagram • define behaviour rules of an agent Overview of CAMLE
CAMLE Modelling Tools and Environment • Model construction tools • Consistency checkers • Transformation of model to formal specifications • … Overview of CAMLE
Graphic User Interface Users’Requirements Model Manager Check Result Graphic Models FormalSpecifications SpecificationGenerator Well- formedness Checker Diagram Editor Consistency Checker Controller Behaviour Model Checker Partial Diagram Generator Caste/ Behaviour Checker Collaboration Model Checker Caste/ Collaboration Checker Behaviour/ Collaboration Checker General/ Specific Checker Cross level Checker Architecture of CAMLE Modelling Tools and Environment Overview of CAMLE
Formal Specification Language SLABS • SLABS stands for Specification Language for Agent-Based Systems • First proposed in 2000 at MAMA 2000; • Published in the Journal of Software Engineering and Knowledge Engineering in 2001; • Revised in 2002 and 2003 by introducing dynamic casteship at AAMAS’03; • Currently, further study of adaptive mechanism, to appear at AOSDM’06 at SEKE’06. • It specifies MAS by defining a collection of castes and agents. Overview of CAMLE
a) agent name: a specific agent b) All: caste-name : all the agents of the caste c) variable: caste-name: a variable that ranges over the caste Caste Description in SLABS Caste C <= C1, …, Ck; (* inheritance relationship*) ENVIRONMENT E1, …, Ew; (*description of the environment*) VAR *v1:T1, …, *vm:Tm; (* visible state variables *) u1:S1, …, ul:Sl; (* invisible state variables *) ACTION *A1(p1,1,…,p1,n1), …, *As(ps,1,…, ps,ns); (* visible actions *) B1(q1,1,…, q1,m1), …, Bt(qt,1,…, qt,mt); (* invisible actions*) RULES R1, R2, …, Rh (* Behaviour rules *) End C. Overview of CAMLE
Specification of Behaviours in SLABS Format of behaviour rules: Behaviour-rule::=[<rule-name>]pattern |[prob]->event, [ifScenario] [wherepre-cond]; Overview of CAMLE
Scenario Descriptions in SLABS A scenario is a combination of a set of agents’ behaviours and states that describe a global situation in the operation of the system. Overview of CAMLE
3/25/2000 Examples of Scenarios (1) Maze: !"n, mÎ{1,..,10}. Bean(n, m)=False. It describes the situation in the mice-maze system when there is no bean left in the maze. (2) $pÎParties.t2000:[nominate(Bush)] || t2000=(4/2000). It describes the situation that at least one agent in the class Parties took the action nominate(Bush) at the time of April 2000. (3) (mxÎ Citizen.[vote(Bush)] / mxÎ Citizen.[$]) > 1/ 2 It describes the situation that more than half of the agents in the class Citizen took the action of vote(Bush). Overview of CAMLE
Examples of Rules [!SpareMoney>£2000] -> Buy(ShareX); If (X:Broker.[Buy(ShareX)]) (X:Broker.[$])/2 [!SpareMoney£2000 & SpareMoney £500] -> Save(SpareMoney, BankX, AccoundTypeY); if BankX: !AccountTypeY_Rate=Z & W:Banks.[W:!AccountTypeU_RateZ] [!SpareMoney<£500] -> Spend(SpareMoney, BarX); if G:CMS.[Suggest(BarX)]. Overview of CAMLE
Programming Language SLABSp • Directly implementing MAS in an agent-oriented programming language is a key step toward a new paradigm • Experiments with the design and implementation of agent-oriented programming languages based on the caste centric meta-model • To test the feasibility of the concepts and language facilities of agent-oriented programming language • To test the caste-centric agent-oriented programming style • Extension of Java by introducing Caste, which allows state variables have class as their types. See (Wang, Shen & Zhu, 2004, 2005a, 2005b) for details. Overview of CAMLE
Discussion • Feasibility: • Concepts in the caste-centric meta-model can be implemented as programming language facilities • Conceptual integrity: • The whole software development, including requirements elicitation, analysis and specification, system design and implementation, can be carried out in the same meta-model (in the same conceptual model) • Various agent-oriented concepts can be naturally implemented by caste, scenario, etc. • Evolution of programming style: • The programming style is consistent with traditional paradigms, including structured and OO programming • Suitable for web-application development due to the inherent features of concurrency, autonomous behavior, etc. Overview of CAMLE
Outline • Caste-centric meta-model of MAS • Languages • Emergent behaviours • The framework • Formal specifications of EB • Prove properties of EB • Case Study • Related work and work in progress Overview of CAMLE
Emergent Behaviours of MAS • The central topic of complex systems • Particularly interested in agent-based models • a large number of components • interacting with each other following a small number of local rules or laws • Oblivious to any higher-level instructions • (Holland, J.H. 1998) Phenomena of system’s macro-behaviours to be regarded as emergent properties must satisfy two conditions: • recognisable • recurring. Overview of CAMLE
Formal Framework of Specifying/Reasoning EB • Formal specification of MAS in SLABS • Caste: large number of agents of certain types • Behaviour rule: local interaction rules as responses to environment scenarios • Specification of recognisable phenomena • As scenarios from a system’s view • Logical description of the situation in the execution of a system in terms of the dynamic behaviours of agents (the sequences of actions) and their states and state changes • Proofs of Recurrence properties of phenomena • Recurrence properties • Reachability, stability, convergence, etc. • Proved as properties of scenarios • Scenario calculus Overview of CAMLE
Example: Ant Colony Formal specification of any colony in SLABS AGENT Field; ENVIRONMENT All: Ant; VAR Hormone: NNN; Food: NNN; RULES [$] | Hormone'(n,m) = Hormone(n,m)-1 , if xAnt:[!position=(n,m)] [$] | Hormone'(n,m) = Hormone(n,m)+100, if xAnt:[!position=(n,m)] [$] | Food'(n,m)=Food(n,m)-k, if [k]xAnt:[Take_Food ! position=(n,m)] END Field. Overview of CAMLE
CASTE Ant; ENVIRONMENT Field, All: Ant; VAR *Position: NN; VAR State: {search, way_back, way_out}; ACTION Move(Direction); Take_Food; Save_Food; RULES [Move(u) !State=search] |(0.5) Move(u)!(position' = New(position, u)), if field: [!Food(position)<e]; [Move(u) ! State=search] |(0.5) Move(v)!(position' = New(position, v)), if field:[!Food(position)<e]; where uv [$] | Take_Food !State = Way_back, if field: [!Food(position)e]; [!State = Way_back & position home ] | Move(u), where u=Min'uDirection field: Hormone(New(position, u)); [!State = Way_back & position = home ] | Save_Food ! State = Way_out; [$] |(0.8) !State = Way_out, if xAnt:[Save_Food] [!State = Way_out] | Move(u), where u=MaxuDirection field:Hormone(New(position, u)) END Ant. Overview of CAMLE
Recognisable Phenomena of Ant Colony • There are a large proportion of ants on a path p. mXAnt.[X on p] / ||Ant|| > C, where C>0 is a real number. • The food at position X1 in the field is consumed before the consumption of food at position X2. [Field.Food(X1)>0 & Field.Food(X2)>0, Field.Food(X1)=0&Field.Food(X2)>0, Field.Food(X2)=0] Overview of CAMLE
Example: Peer-To-Peer Networks CASTE Peers; ENVIRONMENT contact: Peer; … (* Details of irrelevant issues are omitted *) RULES <> | prob contact := Ax; where prob = (mXPeer.[X.contact=Ax]) / || Peer|| … (* Details of irrelevant issues are omitted *) END peers. Specification in SLABS (fragment) Overview of CAMLE
Emergent Behaviours of P2P Networks • Power-law of node degree distribution K=0, 1,2,…, KC-C’mAPeers. (mXPeers.(X.contact=A)=K) KC+C’, where C and C’ are constants that depends on the network. • Small-world property X,YPeers.XiPeers,(i=1,…,6). (X.contact=X1 & i=1,…,6.(Xi.contact=Xi+1) & X6.contact=Y). Overview of CAMLE
Scenario Calculus: Overview • A formal theory of the relationships and operations on scenarios • Theorems about the relationships between recurrence properties • Theorems about how to prove these properties Overview of CAMLE
Example: Autonomous Sorting • The systems consists of two types of agents • Linker • carries a value • connects to two other agents through channels High and Low. • the High channel only connects to an agent that carries a greater value • the Low channel only connects to an agent that carries a less value • Mediator • only introduce agents to each other at random, which triggers the Linker agents to change their connections. • The emergent behaviour • When all linkers are connected, the values carried by them are sorted. It is a simplified version of the sorting program implemented by the DIET project Overview of CAMLE
Specification of Autonomous Sorting CASTE Linker; ENVIRONMENT High, Low: Linker; All: Mediator; VAR Value: INTEGER; BEGIN <> | Low:= NOBODY; High:= NOBODY; [$] | High:=Ag; IF X Mediator.X:[Introduce(Self, Ag)], WHERE Ag.Value > Self.Value & ((High = NOBODY) (High NOBODY & High.Value > Ag.Value)) [$] | Low:=Ag; IF X Mediator.X:[Introduce(Self, Ag)] WHERE Ag.Value < Self.Value & (Low = NOBODY) ((Low NOBODY)& (Low.Value < Ag.Value))) END Linker; CASTE Mediator; Action: Introduce (A,B: Linker) BEGIN [$] | Introduce(A, B); WHERE A Linker & B Linker END Mediator. Overview of CAMLE
Emergent Property of Autonomous sorting Fully-Linked = !ALinker.(A.High=NOBODY) & !ALinker.(A.Low=NOBODY) & ALinker.(A.HighNOBODY BLinker.(A.High=B & B.Low=A)) & ALinker.(A.LowNOBODY) BLinker.(A.Low=B & B.High=A) • Assumptions: • K>0 Mediator agents; • N>0 Linker agents. Overview of CAMLE
A Theorem about Emergent Behaviours Theorem. A multi-agent system M always converges to a scenario sc , if and only if there is a complete and orthogonal set S of scenarios such that (1) scS; (2) M |= initsc, where initS and Mt0|=init; (3) M has diamond property and finiteness property on S; and (4) sc is a terminal state in S. This lemma provides a powerful means to prove the convergence of emergent state. It also helps to understand the behaviour of multi-agent systems. Overview of CAMLE
i+1 n n-1 … Proof of the Convergence Property Definition E1. A set of scenarios HL is defined as follows. • Ai-H-LinkedTo-Aj= (Ai.High=Aj), i, j=1,2,..., n. • Ai-H-NotLinked = Ai.High=NOBODY, i=1,2,..., n. Lemma E1. The set of scenario is complete and orthogonal. Lemma E2. For all i, j and k, i< j < k, and i, j, k=1,2,…, n, we have that Ai-H-LinksTo-Ak Ai-H-LinksTo-Aj, and Ai-H-NotLinked Ai-H-LinksTo-Aj. Theorem E1. Linker agent Ai will always eventually reach the state in scenario Ai-H-LinkedTo-Ai+1. Assumption: For all linker agents Ai.Value<Ai+1.Value, i=1, …, N-1. Overview of CAMLE
Definition E2. Define a set LL of scenarios as follows. • Ai-L-LinkedTo-Aj = (Ai.Lower=Aj), i, j=1, 2, …, N-1. • Ai-L-NotLinked = Ai.Lower=NOBODY, i=1, 2, …, N-1. Lemma E3. The set of scenarios is complete and orthogonal. Lemma E4. For all i>j>k =1,2,…, n, we have that Ai-L-LinksTo-Ak Ai-L-LinksTo-Aj and Ai-L-NotLinked Ai-H-LinksTo-Aj. Theorem E2. The Linker agent Aiwill always reach the scenario Ai-L-LinkedTo-Ai-1. Corollary (a) The autonomous sorting system will always reach the scenario that i(1,…,n-1). Ai-H-LinkedTo-Ai+1 & An-H-NotLinked & i(2,…,n). Ai-L-LinkedTo-Ai-1& A1-L-NotLinked Fully-Linked (b)The state is also stable. Overview of CAMLE
Case Study: Agent Community Formation Agent Community formation problem: • Agent communities re-configures themselves to achieve optimised efficiency • through members’ autonomous behaviour in moving from one community to another • without global information • Agents follow various kinds of behaviour rules • CAKM: moving to a community that collectively has more knowledge of the interested category. • CASM: moving to a community that has more agents of the interested category • PARM: moving to a community that it knows a member that has more knowledge of the interested category than itself • PAEM: moving to a community that it knows a member that has more attractive strength than itself • Hybrid: The system contains a variety of above types of agents Overview of CAMLE
Outcomes of the Case Study • Models of various types of agent communities in CAMLE • Formal specification of agent community MAS in SLABS • Identification of emergent behaviour and formal specification using scenarios • Interesting recurrence properties of the scenarios proved using scenario calculus • Results conforms to simulation results done at BT Ipswich. Overview of CAMLE
Desirable Emergent Behaviours Maturity: The state of a world of organised communities is mature, if for every non-trivial category C of knowledge, there is a complete community with respect to C. Formally, Mature CCategory.(D*(C)GOrganiser.(CompleteC(G))) Optimal: The state of a world of organised communities is optimal, if every member is in a complete community of its category. OptimaluMember.(uPG(C)CompleteG(C)), where G = u.Organiser and C = u.Category. Overview of CAMLE
1 * 1 1 1 * Basic Model of Agent Communities Overview of CAMLE
Properties of the Emergent Behaviours Overview of CAMLE