Agent Programming Extensions Relying on a Component-based Platform
-
Upload
jonah-hill -
Category
Documents
-
view
39 -
download
1
description
Transcript of Agent Programming Extensions Relying on a Component-based Platform
Agent Programming Extensions Relying on a Component-based
Platform
Christian Vecchiola, Mauro Coccoli, and Antonio Boccalatte
(speaker C. Vecchiola)
l.i.d.o. – DIST University Of Genova
International Conference on Information Reuse And Integration
(IRI 2003)27-29 October Las Vegas (NV)
04/19/23Agent Programming eXtensions Relying on Component-based platform 2
Outline
Agent Programming
Agent Programming eXtensions
Comparison
Conclusions
Future Work
04/19/23Agent Programming eXtensions Relying on Component-based platform 3
Agent Programming [1]
Applied agent programming is often based on the existence of an underlying agent programming framework.Frameworks are commonly implemented as software packages containing hierarchy of classes.The object oriented model has proven to be a powerful paradigm to address agent programming.
04/19/23Agent Programming eXtensions Relying on Component-based platform 4
Agent Programming [2]
Agents and Objects are similar but different:
agents are commonly implemented as self contained, concurrent, autonomous objects;
objects have control over their state, agents needs to control their behavior also.
Agents seems to be a little bit more than objects…
04/19/23Agent Programming eXtensions Relying on Component-based platform 5
Agent Programming [3]
A sort of infrastructure has to be shaped on top of the object oriented layer, to provide all the features the agents need.
Such infrastructure is normally provided with frameworks and explicit programming patterns.
Different support is given to this aspect in actual agent programming frameworks.
04/19/23Agent Programming eXtensions Relying on Component-based platform 6
Agent Programming [4]
This support can be given at different levels:
wizards and automation tools: they silently create all the programming patterns needed by the framework, offering to the developer customized templates;
programming language and a tailored compiler: an agent oriented interface is offered to the developer at code level;
04/19/23Agent Programming eXtensions Relying on Component-based platform 7
Agent Programming eXtensions [1]
Our approach to agent programming is the following:
AgentService: agent programming framework with a full featured class library to develop, implement and manage agents;
Agent Programming eXtensions (APX): bridges the gap between the agent oriented approach and the object oriented back-end.
04/19/23Agent Programming eXtensions Relying on Component-based platform 8
AgentService:built on the top of the Common Language Infrastructure;definition of real autonomous, indipendent and persistent agents;concurrent execution of agents and their multi-behavior activity;transactional agent communication by message passing;wants to be FIPA compliant.
Agent Programming eXtensions [2]
04/19/23Agent Programming eXtensions Relying on Component-based platform 9
Agent Programming eXtensions [3]
APX:agent oriented interface at code level;templates to implement agents and all the components they are made up of;syntactical structures that leverage the coding phase of the developer;C# (and Java)–like syntax;C# grammar for expression and statements;client of the object oriented model exposed by the Common Language Infrastructure.
04/19/23Agent Programming eXtensions Relying on Component-based platform 10
Agent Programming eXtensions [4]
The Agent Model:An agent is designed as a software entity whose state is defined by a particular managed set of data (Knowledge) and whose activities is performed by objects known as Behaviors;Behaviors interoperate by using the shared data (Knowledge) inside the agent;An agent turns to be a container that olds data and activities.
04/19/23Agent Programming eXtensions Relying on Component-based platform 11
Agent Programming eXtensions [5]
The Agent Model (2):
AgentService provides particular classes to implement the previous agent model. It needs an opportune programming pattern to develop a “safe” agent.
AgentTemplate class
Knowledge objects- K1 myKnow1- K2 myKnow2
Behavior objects- B1 myBehavior1- B2 myBheavior2
+ Initialize method+ Ending method
// other methods..
agent AgentName { knowledges { K1 myKnow1; K2 myKnow2; } behaviors { B1 myBehavior1; B2 myBehavior2; } init { // agent setup and initialization // mostly C# code … } done { // agent cleanup and resource release // mostly C# code … }}
agent AgentName { knowledges { K1 myKnow1; K2 myKnow2; } behaviors { B1 myBehavior1; B2 myBehavior2; } init { // agent setup and initialization // mostly C# code … } done { // agent cleanup and resource release // mostly C# code … }} APX provides a more agent oriented interface and
hides the underlying object oriented model of the platform.
04/19/23Agent Programming eXtensions Relying on Component-based platform 12
Agent Programming eXtensions [6]
APX key elements: agent template;
knowledge template;
behavior template;
freeze statement.
04/19/23Agent Programming eXtensions Relying on Component-based platform 13
Agent Programming eXtensions [7]
agent template:used by programmer to define an agent and compose him with the needed behaviors and knowledges;designed as a container;provides blocks where the programmers can configure behaviors with the needed data, and eventually clean-up the agent;localizes code inside behaviors and fosters code reuse;hidden inheritance from the AgentService AgentTemplate class type.
04/19/23Agent Programming eXtensions Relying on Component-based platform 14
Agent Programming eXtensions [8]
knowledge template:designed as Pascal-like record;
can contain every object accepted by the Common Language Runtime, except pointers;
is the minimum bunch of data that can be handled for thread safe access.
hidden inheritance from the AgentService Knowledge class type.
knowledge JobKnowledge {
int JobID; System.DateTime ArrivalTime; System.DateTime StartingTime; System.DateTime StoppingTime;
MachineType MachineRequestedType; // every CLR object // no pointers!!! // no APX templates!!}
knowledge JobKnowledge {
int JobID; System.DateTime ArrivalTime; System.DateTime StartingTime; System.DateTime StoppingTime;
MachineType MachineRequestedType; // every CLR object // no pointers!!! // no APX templates!!}
04/19/23Agent Programming eXtensions Relying on Component-based platform 15
Agent Programming eXtensions [9]
behavior template:shapes the concept of an agent activity;
really similar to a class (fields, and methods but no inhertance is provided);
has a special block called body that is the entry point for the behavior execution;
silently inherits from the
AgentService Behavior class.
behavior BehaviorName { knowledges { K1 myKnow1; K2 myKnow2; } fields { // every CLR object // no pointers!!! // no APX templates!! } methods { // methods definition … } body { // entry point for the behavior execution // start here coding behavior activity … }}
behavior BehaviorName { knowledges { K1 myKnow1; K2 myKnow2; } fields { // every CLR object // no pointers!!! // no APX templates!! } methods { // methods definition … } body { // entry point for the behavior execution // start here coding behavior activity … }}
04/19/23Agent Programming eXtensions Relying on Component-based platform 16
myKnow1.JobID = 7;
freeze (myKnow1, ….) { // access here all the myKnow1 fields..
int jobID = myKnow1.JobID; ….. ….. myKnow1.ArrivalTime = arrivalTime; …..}
int j = myKnow1.JobID;
myKnow1.JobID = 7;
freeze (myKnow1, ….) { // access here all the myKnow1 fields..
int jobID = myKnow1.JobID; ….. ….. myKnow1.ArrivalTime = arrivalTime; …..}
int j = myKnow1.JobID;
Agent Programming eXtensions [10]
freeze statement:provides a context for a thread-safe access;explicitly designed for Knowledge type fields;it is the unique scope where knowledge fields can be addressed.
compiler error: variable out scope
compiler error: variable out scope
04/19/23Agent Programming eXtensions Relying on Component-based platform 17
Agent Programming eXtensions [11]
The APX compiler and the CLR
Agent source program
APX compiler Agent Assembly
AgentService Framework class
libraries (C#)
CLR
Agent Platform
C# grammarAPX grammar
expression & statements
types definition
templates definition
04/19/23Agent Programming eXtensions Relying on Component-based platform 18
Agent Programming eXtensions [12]
Interoperability [1]
the APX compiler targets the CLR;
the extensions provided with APX are a full “client” of the object oriented model exposed by the Common Language Infrastructure;
in an agent source program is possible to instantiate and use every object component developed with any other language that targets the CLR.
APX compiler
Agent source program
Components developed with VC+
+ .NET, VB.NET, Oberon, Eiffel.NET
Managed assembly
04/19/23Agent Programming eXtensions Relying on Component-based platform 19
Agent Programming eXtensions [13]
Interoperability [2]
benefits:code reuse;
separation of concern;
modularity;
better team organization;
… APX compiler
Agent source program
Components developed with VC+
+ .NET, VB.NET, Oberon, Eiffel.NET
Managed assembly
04/19/23Agent Programming eXtensions Relying on Component-based platform 20
Comparison [1]
Other research projects have offered an agent oriented interface by means of a programming language:
Agent-0, Agent-K, PLACA extensions;
AgentSpeak(L);
APRIL;
JACK;
APL;
04/19/23Agent Programming eXtensions Relying on Component-based platform 21
Comparison [2]
JACK and APL are the most similar projects to the Agent Programming eXtensions
JACK: is an agent framework programming that comes with some extensions to the java language and a tailored compiler. Supports the BDI architecture for agents as well as others.
APL: is an agent programming language on top of the Java type system tighly bounded to BDI agent architecture. Does not come with a framework.
04/19/23Agent Programming eXtensions Relying on Component-based platform 22
Conclusions [1]
The Agent Programming eXtensions offers an agent oriented interface at code level.
There is no need to cast an agent designed solution to an object oriented model during the implementation phase.
04/19/23Agent Programming eXtensions Relying on Component-based platform 23
Conclusions [2]
Agent Programming eXtensions automates some of the patterns required by the underlying agent framework without worring the developer about this process;
Interoperability among languages hosted in the Common Language Infrastructure offers:
a complete programming environment;
a good separation of concerns among agent oriented features and the other aspects of a software project;
04/19/23Agent Programming eXtensions Relying on Component-based platform 24
Future Work
Agent Programming eXtensions are still a work in progress..
Next tasks:complete integration with the AgentService framework;
complete access to the Common Language Infrastructure type system and services;
new features to come…
04/19/23Agent Programming eXtensions Relying on Component-based platform 25
Thanks for your attention..
..questions?