formal modelling of reactive agents as an aggregation of simple behaviours
DESCRIPTION
Formal Modelling of Reactive Agents as an aggregation of Simple Behaviours. P.Kefalas. Dept. of Computer Science 13 Tsimiski Str. 546 24 Thessaloniki Greece [email protected]. TOPICS OF PRESENTATION. Introduction to Formal Modelling. Motivation. Modelling Component X-Machines. - PowerPoint PPT PresentationTRANSCRIPT
Formal Modelling of Reactive Formal Modelling of Reactive Agents as an aggregation of Agents as an aggregation of
Simple BehavioursSimple Behaviours
P.Kefalas
Dept. of Computer Science13 Tsimiski Str.
546 24 ThessalonikiGreece
TOPICS OF PRESENTATIONTOPICS OF PRESENTATION
Introduction to Formal Modelling
Motivation Modelling Component X-Machines
Building a Communicating X-Machine System
Evaluation
Conclusion
P.Kefalas, CITY Liberal Studies
FORMAL MODELLINGFORMAL MODELLING
Agents, as highly dynamic systems, are concerned with:
(i) a set of appropriate environmental stimuli or inputs,
(ii) a set of internal states of the agent, and
(iii) a set of rules that relate the two above and determines what the agent state will change to if a particular stimulus arrives while the agent is in a particular state.
P.Kefalas, CITY Liberal Studies
Although Agent-Oriented Software Engineering aims to manage the inherent complexity of software systems, there is still no evidence to suggest that any methodology proposed so far leads towards correct systems.
It is argued that Formal Methods can (to some extend) solve the problem, under the following conditions: they can deal successfully with complexity of single or
multi agent systems, and they are practical.
Agent Oriented Software EngineeringAgent Oriented Software Engineering
P.Kefalas, CITY Liberal Studies
Formal MethodsFormal Methods
Z
VDM
Finite State Machines
Petri Nets
Modelling of data typesModelling of data types
Modelling of controlModelling of control
P.Kefalas, CITY Liberal Studies
The Challenge is to develop The Challenge is to develop agent models and implementationsagent models and implementations
that are correctthat are correct
Criteria for correctness: the initial agent model should match with the requirements
the agent model should satisfy any necessary properties in order to meet its design objectives
the implementation should pass all tests constructed using a complete functional test generation method.
MODELLING
VERIFICATION
TESTING
P.Kefalas, CITY Liberal Studies
FORMAL MODELLING OF AGENTSFORMAL MODELLING OF AGENTS
In order to be useful to modelling of intelligent agents a formal method should be able:
to model both the data and the changes of an agent, to model separately the behaviours of an agent and the
ways the behaviours interact with each other,
to be intuitive, practical and effective towards implementation of an agent, and
to facilitate development of correct agents.
P.Kefalas, CITY Liberal Studies
A FSM-like model A FSM-like model seems to capture most of seems to capture most of
the requirementsthe requirements
space
obstacle
AT BASE
MOVING AT OBJECT
AT OBSTACLE
base
space
base
object
object
space
space
object
obstacle
obstacle
… … but no data, no separate behavioursbut no data, no separate behavioursP.Kefalas, CITY Liberal Studies
X-MACHINESX-MACHINES
X-Machines is:
A General Computational Machine Based on Finite State Machines, but also:
it has a MEMORY structure its transitions are labeled with FUNCTIONS
Therefore:
X-Machines is a formal method which employs a diagrammatic approach to modelling and is capable ofmodelling both DATA and CONTROL of a system.
P.Kefalas, CITY Liberal Studies
σ γ
S1
S2
S3
S4
M=(m1, m2, …, mn)
φ1
φ3φ2
φ5 φ4
φ4 φ2
X-MachineX-Machine
Diagrammatical NotationDiagrammatical Notation
P.Kefalas, CITY Liberal Studies
COMMUNICATING X-MACHINESCOMMUNICATING X-MACHINESX-Machines can also communicate with each other:
Functions can read an input from a communication input stream, i.e. a “message” sent by the annotated model name
Functions can writes a “message” to the communication input stream of machine with the annotated model name. The “message” is sent after all the output parameters are instantiated.
Therefore:
X-Machines is a formal method can be used to separatelymodel behaviours of an agent system that communicate.
P.Kefalas, CITY Liberal Studies
Communicating X-MachineCommunicating X-Machine
Diagrammatical NotationDiagrammatical Notation
P.Kefalas, CITY Liberal Studies
xm-1 xm-2
Channel for receiving message
from xm-1
Channel for sending
message to xm-2
σ γ
S1 S2
M=(m1, m2, …, mn)
φ1
S3 S4φ2
Formal DefinitionFormal Definition
X-Machines is a 8-tuple
M = (Σ, Γ, Q, M, Φ, F, q0, m0) Σ, Γ is the input and output finite alphabet respectively Q is the finite set of states M is the (possibly) infinite set called memory Φ is the type of the machine M, a finite set of partial functions φ that map an input and a memory state to an output and a new memory state, φ: Σ M Γ M
F is the next state partial function that given a state and a function from the type Φ, denotes the next state. F is often described as a transition state diagram, F:QΦQ
q0, m0 are the initial state and memory respectively.P.Kefalas, CITY Liberal Studies
Example:Example:
A reactive agent that collects objects, A reactive agent that collects objects, records any objects found on its way and records any objects found on its way and sets up its goal according to the list of sets up its goal according to the list of objects found.objects found.
drop find_base
move
AT BASE
GOING BACK
SEARCHING DIRECTED TO OBJECT
AT OBSTACLE
move
move_back
find_base
lift_object lift_object
find_object
direct_move direct_move
find_obstacle
find_obstacle avoid_obstacle
avoid_obstacle
find_obstacle
avoid_obstacle
do_nothing
find_obstacle
M = (OBJECT{none}, (COORDCOORD), seq (COORDCOORD))
REACTIVE AGENT
P.Kefalas, CITY Liberal Studies
Formal DefinitionFormal Definition
Σ = ({space, base}OBSTACLEOBJECT)COORDCOORD
Γ={"moving freely", "moving to base", "dropping food", ...}.
Q={At Base, Searching, At Obstacle, Going Back, Directed to Object}
M = (OBJECT{none}) (COORD COORD) seq (COORD COORD)
m0 = (none, (0,0), nil)
q0 = "At Base"
…lift_object( (obj,x,y),(none,(x,y),objectlist) )
("lifting object",(obj,(x,y),<(x,y) :: objectlist>)), if objOBJECT
find_object( (obj,x,y),(item,(x,y),objectlist) ) ("record object position",(item,(x,y),<(x,y) :: objectlist>)), if itemnone objOBJECT (x,y) objectlist
…P.Kefalas, CITY Liberal Studies
Agents as an aggregation of behavioursAgents as an aggregation of behaviours
identification of the individual behaviours,
modeling of individual behaviours,
aggregation of behaviours in order to construct the whole agent model
Methodology:
P.Kefalas, CITY Liberal Studies
Behaviour 1
Behaviour 2
Behaviour 3
Behaviour 4
Com
mu
nication
Agent type 1
Behaviour 1
Behaviour 4
Com
mu
nication
Agent type 2
Com
mu
nication
Multi-Agent System
The methodology is useful for building multi-agent The methodology is useful for building multi-agent systems in which agents have common behaviourssystems in which agents have common behaviours
P.Kefalas, CITY Liberal Studies
Example:Example:The same reactive agent as before but The same reactive agent as before but with a set of distinct behaviourswith a set of distinct behaviours
(a) searching for an object,
(b) moving directly to an object,
(c) lifting and dropping objects,
(d) avoiding obstacles
(e) traveling back to the base,
(f) building a map of the environment
Step 1:Step 1:
Identifying individual behaviours:
P.Kefalas, CITY Liberal Studies
Step 2:Step 2:
Modelling individual behaviours:
WAITING FOR GOAL
receive_goal
STARTING SEARCH
MOVING
DIRECTLY
move_to_object
get_back
move_to_object receive_goal
BUILDING MAP
find_object
set_goal
M = (seq COORDCOORD) M = (agent_position, object_position)
MD BEM
moving directly to an object building map of the environment
P.Kefalas, CITY Liberal Studies
Step 3 (a):Step 3 (a):
Communication of individual behaviours:
WAITING FOR GOAL
receive_goal
STARTING SEARCH
MOVING
DIRECTLY
move_to_object
get_back
move_to_object receive_goal
BUILDING MAP
find_object
set_goal
M = (seq COORDCOORD) M = (agent_position, object_position)
MD
MD BEM
BEM
BEM
moving directly to an object building map of the environment
P.Kefalas, CITY Liberal Studies
Step 3 (b):Step 3 (b):
Aggregation of behaviours:
AGENT SEARCHING FOR OBJECT
MOVING TO OBJECT
LIFTING AND DROPPING
AVOIDING OBSTACLES
TRAVELLING TO BASE
BUILDING MAP OF THE
ENVIRONMENT
PERCEPTING
detect_space
detect_obstacle
detect_base
detect_object
PERCEPTOR
PRO-ACTIVE BEHAVIOURS
P.Kefalas, CITY Liberal Studies
X-Machines is a FORMAL METHOD but also it
INTUITIVE and EXPRESSIVE as well as PRACTICAL
P.Kefalas, CITY Liberal Studies
DISCUSSION AND EVALUATIONDISCUSSION AND EVALUATION
XMDL (X-Machine Description Language) is a declarative mark-up language, which permits the designer to write ASCII code in order to describe a X-machine model.
XMDLmodel
XMDLcommunication
+ =CommunicatingXMDL model
The approach has several advantages for the developer who:
does not need to model a communicating system from scratch, can re-use existing models (behaviours),
can consider modelling and communication as two separate distinct activities in the development of a communicating system based on behaviours,
can use existing tools for both stand-alone and communicating X-machines.
… … Discussion and Evaluation …Discussion and Evaluation …
P.Kefalas, CITY Liberal Studies
a COMPLETE TESTING strategy that guarantees to find all faults in the implementation
a MODEL CHECKING strategy that guarantees to verify that specific properties hold (XmCTL)
X-Machines is supported by:
… … Discussion and Evaluation …Discussion and Evaluation …
P.Kefalas, CITY Liberal Studies
CONCLUSIONSCONCLUSIONS
X-Machine is a suitable formal method for specifying and building correct reactive agents.
Tools are continuously built in order to facilitate agent development based around X-Machines.
Communicating X-Machines encourage the modular development of agents based on an aggregation of behaviours.
Communicating X-Machines lead towards the specification of large scale multi-agent systems.
P.Kefalas, CITY Liberal Studies
Formal Modelling of Reactive Formal Modelling of Reactive Agents as an aggregation of Agents as an aggregation of
Simple BehavioursSimple Behaviours
P.Kefalas
Dept. of Computer Science13 Tsimiski Str.
546 24 ThessalonikiGreece