470 likes | 646 Views
An Agent-Oriented Programming Language Targeting the Microsoft CLR [AgentService and APX]. l . i . d . o . DIST - University of Genova. Introduction. speaker: Mauro Coccoli. Outline. The Team Agent Platform Agent Oriented Language Portability Issues
E N D
An Agent-Oriented Programming Language Targeting the Microsoft CLR[AgentService and APX] l. i. d. o. DIST - University of Genova
Introduction speaker: Mauro Coccoli
Outline • The Team • Agent Platform • Agent Oriented Language • Portability Issues http://www.lido.dist.unige.it/ags.asp AgentService
The Team • Mauro Coccoli • Alberto Grosso • Christian Vecchiola • Daniele Marino • Andrea Gozzi • Academic Support by • Prof. A. Boccalatte • Prof. M. Paolucci AgentService
Agent Platform • Runtime Agents • Execution Environments • Class Library AgentService
Agent Language • Object Oriented Paradigm • Agent Oriented Paradigm • Improved Programmability AgentService
Portability Issues • .NET • Mono • Rotor - SSCLI AgentService
AgentServicePlatform speaker: Alberto Grosso
Summary • Agents and MASs • AgentService • Platform Architecture • Agent Model • Runtime Environment AgentService
[1] Agents and MASs • Agent Autonomous entity • Intelligence • Reactivity • Pro-activeness • Multi-behaviour AgentService
[2] Agents and MASs • Multi–agent system Community where agents interact in order to meet their goals • Cooperation • Competition • Negotiation AgentService
[3] Agents and MASs • Agent system applications Problems dealing with distributed and concurrent systems • Electronic commerce and electronic markets • Real time monitoring and management of telecommunication networks • Information handling in information environments like the Internet • Improving the flow of transport traffic • Optimization of industrial manufacturing and production processes AgentService
[4] Agents and MASs • FIPA • The Foundation for Intelligent Physical Agents • FIPA was formed in 1996 to produce software standards for heterogeneous and interacting agents and agent-based systems • The aim is to provide standard strategies for agent communication, referring to industrial and commercial world AgentService
[5] Agents and MASs • What does FIPA standardize? • The platform architecture • Agent communication • Message structure • Message exchange interaction protocols • Content language (ACL) AgentService
[6] Agents and MASs • Agent Programming Frameworks • agent model definition • platform architecture definition • FIPA compliant • agent implementation and scheduling • communication system • services (persistence, white and yellow pages, …) • integration with “non-agent” software and services AgentService
AgentService • Features • Technology • Common Language Infrastructure • Platform • FIPA abstract architecture compliance • Extremely modular and customizable structure AgentService
Core Modules Runtime Environment for Agents Agents FIPA Service Components (Agents) Additional Modules • Agent Management System • - agents management • - scheduling of agent activities • platform services supervision • white pages services • Directory Facilitator • - agents localization • - yellow pages services • Message Transport System • - agent communication • - message dispatching AMS DF MTS AgentService platform Platform Context AgentService - Architecture AgentService
[1] Agent Knowledge objects Behaviour objects Runtime stubs AgentService – Agent Model • Knowledge • Shared data structure • Concurrent access • Deadlock avoidance • Persistence • Behaviour • Agent activity • Concurrent execution • Access to FIPA services • Runtime environment • Exposes platform services • Messaging System, Persistence, Yellow and White Pages, Logging AgentService
[2] AgentService - Agent Model • Agent Implementation • Two different models • Design Time: AgentTemplate • Run Time: Agent • An Agent is created upon an AgentTemplate • The AgentTemplate defines the “type” of the agent • Knowledge Units • Behaviours • The Agent is the run-time container of the AgentTemplate and binds the template to the platform execution environment AgentService
[3] Behaviour + knowledgeList + conversationList + Body() Knowledge - items + this[string] • AgentTemplate • behaviourList • knowledgeList • + Initialize() • + Ending() • + Resume() • + OnIncomingConversation() MyKnowledge - items properties MyBehaviour + knowledgeList + conversationList + Body() + methods 1..* 1..* • MyAgent • behaviourList • knowledgeList • + Initialize() • + Ending() • + Resume() • + OnIncomingConversation() AgentService – Agent Model AgentService
[1] AgentService - Runtime • Agent Scheduling • Each Agent is deployed in a dedicated Application Domain • Application Domain features • intra-process structure • execution boundaries for data and type isolation • lightweight process • security profile • multi-threading AgentService
[2] Agent Instance AgentTemplate Creation of the Application Domain template Knowledge types and default instances Behaviour types and default instances Runtime stub All the assemblies necessary to create agent defined by the template X are retrieved Registration AMS DF MTS User request: create an agent of type X • Upload of assemblies containing: • AgentTemplate type • Knowledge and Behaviour types AgentService - Runtime logging persistence messaging storage AgentService
Agent Service - Conclusions • AgentService • Agent Model • Modular Architecture • Advanced Scheduling System • Work in progress • FIPA ACL • A library of Agent, Knowledge, and Behaviour types ready to use • AOSE methodology • Interaction protocol designer (AUML) AgentService
Agent Programming eXtensions speaker: Christian Vecchiola
Agent Programming eXtensions • AO application development • object-oriented frameworks • framework programming patterns • design to development gap: • agent oriented perspective for design • object oriented perspective for code AgentService
Agent Programming eXtensions • Is OO programming too bad? • ...obviously not: • powerful • general purpose • intuitive • but.... • enhancements to support agent oriented development AgentService
Agent Programming eXtensions • APX • facilities to define and handle new elements related to agent programming • agent, behaviour and knowledge types • a compiler • applies the programming patterns required by AgentService • checks the code AgentService
Agent Programming eXtensions • Is it feasible? • the idea • the new structural elements of APX simplify and speed up the code development • the APX compiler is able to automate many of the task required by AgentService • this is a practice already used in today compilers • using statement implementation • lock statement implementation AgentService
Agent Programming eXtensions • Is it feasible? • the language • only few syntactical and semantical elements have been added • such elements are integrated into an object oriented programming language (C#) • the learning curve is very smooth AgentService
Agent Programming eXtensions • Is it feasible? • the compiler • changes to the compiler are only related to the front-end (scanner, parser, semantic analyzer) • changes and add-on can be applied seamlessly to an already exixsting C# compiler • there are a lot of ready to use and modify C# compilers • SSCLI (aka rotor) csc • Mono mcs • Portable .NET AgentService
Agent Programming eXtensions • Features • AgentService object model • AgentTemplate class • Knowledge class • Behaviour class • APX types • agent template • knowledge template • behaviour template AgentService
AgentTemplate class • Knowledge objects • K1 myKnow1 • K2 myKnow2 Behavior objects - B1 myBehavior1 - B2 myBheavior2 + Initialize method + Ending method + Resume method + OnIncomingConversation method Agent Programming eXtensions • agent template agent AgentName { init{ // definition and creation of knowledge // and behaviour that characterize the agent // agent setup and initialization // mostly C# code … } .... done{ // agent cleanup and resource release // mostly C# code … } } AgentService APX provides a more agent oriented interface and hides the underlying object oriented model of the platform. AgentService provides particular classes to implement the previous agent model. It needs an opportune programming pattern to develop a “safe” agent.
Agent Programming eXtensions • knowledge template knowledge JobKnowledge { int JobID; System.DateTime ArrivalTime; System.DateTime StartingTime; System.DateTime StoppingTime; MachineType MachineRequestedType; // every CLR object // no pointers!!! // no APX templates!! } AgentService
compiler error: variable out of scope compiler error: variable out of scope Agent Programming eXtensions • acquire statement myKnow1.JobID = 7; acquire (myKnow1, ….) { // access here all the myKnow1 fields.. intjobID = myKnow1.JobID; ….. ….. myKnow1.ArrivalTime = arrivalTime; ….. } int j = myKnow1.JobID; myKnow1.JobID = 7; // what happens is there is an invocation to a knowledge // property without acquiring a lock? // .... runtime exception try { this.LockKnowledge(myKnow1, ….); // access here all the myKnow1 fields.. intjobID = myKnow1.JobID; ….. ….. myKnow1.ArrivalTime = arrivalTime; ….. } finally { this.ReleaseKnowedge(true); } int j = myKnow1.JobID; AgentService
Agent Programming eXtensions • Implementation • APX was developed by using the SSCLI as codebase • clone of the sscli/clr/src/csharp/csharp tree • modified elements • scanner (introduction of the new tokens) • parser (construction of new nodes in the syntactic tree) • semantic analyzer (new checks added) AgentService
Components developed with VC++ .NET, VB.NET, Oberon, Eiffel.NET Agent source program APX compiler Managed assembly Agent Programming eXtensions CompilerHost Compiler front end lexer: minor changes, recognize new tokens parser: major changes, synthesys of new constructs, additional information added to the nodes APX node builder: parser support: creates node for the AgentService specific types, tags the nodes with additional info semantic analyzer: no changes integration with the new info added to the nodes APX semantic analyzer: performs additional checks to ensure that the code is AgentService compliat intermediate code generator: no changes emitter: no changes AgentService back end
Agent Programming eXtensions DEMO AgentService
Agent Programming eXtensions • Conclusions • APX are a set of programming extensions to the C# language to support agent programming • APX were designed to.. • ..speed up the coding phase • ..deliver useful tool to end user AgentService
Portability Issues speaker: Daniele Marino
Porting of Agent Service Portability Many OSes Why porting AgentService? • CLI: • Virtual Execution • Enviroment • Nowadays: • Strong internetworking AgentService
[1] Pal System.Xml System Interface SDK CLI System Execution Enviroment SDK CLI Compiler, debugger ... System Library PAL .NET 1.0 Rotor & Mono: Overview AgentService
[2] Rotor & Mono: Overview • C# Compilers and environment • Rotor: csc, clix • Mono: mcs, mono • Framework Class Library • Tools for debug and analisys AgentService
Porting Issues • Non standard libraries • System.Xml • Non standard behaviour • System specific path • Path separator symbol (”/” vs “\”) • Path termination character AgentService
[1] Conclusions • Rotor: • .NET 1.0 Framework Supported • Standard library implementations • Lack of GUI development tool AgentService
[2] Conclusions • Mono: • .NET 1.1 Framework Supported • Active developing • Work either on Linux or on OS X AgentService
Thank you for your attention www.lido.dist.unige.it