AOSE Reflections. What have we seen? Introduced the concept of an agent Explored the notions of...

85
AOSE Reflections

Transcript of AOSE Reflections. What have we seen? Introduced the concept of an agent Explored the notions of...

  • AOSEReflections

  • What have we seen?Introduced the concept of an agent

    Explored the notions of Interaction and Coordination

    GAIA & Agent Oriented Software Engineering

    Practical experience with Agent-Oriented Programming using Agent Factory

    ACRE = AOP + conversation management support

  • The Larger ContextOrigins of the Area

    Example Toolkits

    Beyond AOP

  • ORIGINS

  • Distributed Artificial IntelligenceDistributed AI: the development of distributed solutions for complex problems regarded as requiring intelligence.

    Proposed in the 1970s.

    Evolved to cover 3 main areas:Parallel Problem Solving: Parallelisation of existing AI algorithms

    Distributed Problem Solving: Development of algorithms / techniques to support decomposition and allocation of tasks + synthesis if results (coordination).

    Multi-Agent Systems: DPS + reasoning about the process of coordination (run-time selection and adaptation of DPS techniques).

  • Multi-Agent SystemsMAS: understanding how groups of computational entities, known as agents, can collaborate and cooperate in order to solve problems that are beyond their individual capabilities.

    Emerged in the 1980s

    MAS aims to understand how human interaction and human social structures can be used to build intelligent distributed systems.

    MAS research draws on a variety of fields:Philosophy, Social Sciences, Economics / Game Theory, Linguistics, Computer Science/Engineering,

  • Multi-Agent SystemsAt the heart of any Multi-Agent System is a core computational entity, known as an agent.Each agent in the system is endowed with a possibly unique set of capabilities.

    All agents are able to interact with one another via some form of communication infrastructure.

    When an agent is assigned a task that it is incapable of completing alone, it tries to get help by attempting to locate other agent(s) that have the capabilities necessary for the task.

    Getting help may require the use of negotiation strategies in order to get the best deal (payoff) for the agent.

    Performing the task may require coordination of activities e.g. two robots lifting a box

  • Multi-Agent SystemsGenerally speaking, Multi-Agent Systems are viewed as having the following characteristics:each agent has incomplete capabilities to solve a problem

    there is no global system control

    data is decentralized

    computation is asynchronous

  • So, what is an Agent?The term agent means different things to different people.

    An agent is a computer system that is situated in some environment, and that is capable of flexible, autonomous action in this environment in order to meet its design objectives(Wooldridge and Jennings, 1995)

  • So, what is an Agent?According to (Russell and Norvig, 1995), an agent is:anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators

    Thus, they view an agent as:any entity that is located in some environment, and whichinteracts with that environment through a set of sensors and actuators.

    They then extend this definition to identify an intelligent agent as any agent that embodies some AI technique.

  • So, what is an Agent?In contrast, (Maes, 1995) views agents to be:computational systems that inhabit some complex dynamic environment, sense and act autonomously in this environment, and by doing so realise a set of goals or tasks for which they are designed.

    This posits a view of an agent as:any autonomous software entity that is located in a complex dynamic environment, and whichexhibits goal-oriented behaviour, requiring that it act in pursuit of its own goals.

  • So, what is an Agent?Alternatively, (Shoham, 1993) adopts the perspective that:An agent is an entity whose state is viewed as consisting of mental components such as beliefs, capabilities, choices, and commitments. These components are defined in a precise fashion, and stand in rough correspondence to their common sense counterparts

    This third definition adopts the view of agents as mental entities:That is, entities that employ mental concepts such as beliefs, commitments, and goals in order to reason about both the environment and their activities

  • Weak and Strong AgencyIn 1995, Michael Wooldridge and Nick Jennings proposed a two-tier definition of agency that has become a de facto standard for agent research.

    The lower tier, or weak notion of agency, was intended to be sufficiently general to meet the needs of most agent researchers, and specified the following agent attributes:Autonomy, social ability, reactivity, and pro-activity.

    The upper tier, or stronger notions of agency, were intended to build on this weak core to provide more specific definitions, and specified attributes such as:Benevolence, rationality, mobility, learning, intentionality,

  • Weak AgencyAutonomy: Agents operate without the direct intervention of humans or others, and have some kind of control over their actions and internal state.

    Social Ability: Agents interact with other agents and (possibly) humans via some kind of agent communication language.

    Reactivity: Agents perceive their environment (which may be the physical world, a user via a graphical user interface, a collection of other agents, the Internet, or perhaps all of these combined), and respond in a timely fashion to changes that occur in it.

    Pro-activity: Agents do not simply act in response to their environment, they are able to exhibit goal-directed behaviour by taking the initiative

  • Stronger AgencyMobility: the ability of an agent to move around an electronic network.

    Benevolence: Is the assumption that agents do not have conflicting goals, and that every agent will therefore always try to do what is asked of it.

    Rationality: is (crudely) the assumption that an agent will act in order to achieve its goals and will not act in such a way as to prevent its goals being achieved - at least insofar as its beliefs permit.

    Intentionality: an agent reasons about its activities through the application of mental notions such as beliefs, goals, obligations, commitments, intentions

  • Agents versus ObjectsObjects are passive (cannot take the initiative).Agents are (pro-)active objects

    Objects do not encapsulate behaviour activation (not able to say no)Objects only encapsulate state and behaviour

    Objects are insufficient for modeling complex systemsFrom (Booch, 1994) as an argument for Design Patterns and Application Frameworks

  • Multi-Agent Research ThemesAgent-Oriented Software EngineeringAgent Programming Languages & ArchitecturesMethodologies / Model Driven DevelopmentTool Support: Debugging / ProfilingMetrics / Evaluation of MASInteroperability / Scalability / Adaptability /

    Cooperation, Coordination & NegotiationAgent Communication Languages (KQML, FIPA)Coordination Languages & Models (LINDA, CLAIM)Market-based coordination (Game Theory)Distributed Constraint Satisfaction ProblemsOrganisations & Environments

  • Types of AgentDeliberative AgentsWhat we have seen in this course (knowledge-based systems)Focus on individual agent and its decision-making process

    Reactive AgentsUse the world as its own model (remove the knowledge)Maximise responsiveness to the environment (real-time)

    Social AgentsFocus on conversation management / interactionExplore self interest, trust, aquaintance modelling,

  • Types of AgentDeliberative AgentsWhat we have seen in this course (knowledge-based systems)Focus on individual agent and its decision-making process

    Reactive AgentsUse the world as its own model (remove the knowledge)Maximise responsiveness to the environment (real-time)

    Social AgentsFocus on conversation management / interactionExplore self interest, trust, aquaintance modelling,

    GOAL-BASED REASONINGREACTIVITYSOCIAL ABILITY

  • Types of AgentDeliberative AgentsWhat we have seen in this course (knowledge-based systems)Focus on individual agent and its decision-making process

    Reactive AgentsUse the world as its own model (remove the knowledge)Maximise responsiveness to the environment (real-time)

    Social AgentsFocus on conversation management / interactionExplore self interest, trust, aquaintance modelling,

    Mobile Agents: Code migration over a networkGOAL-BASED REASONINGREACTIVITYSOCIAL ABILITY

  • JADE TOOLKIT

  • JADEFIPA-compliant distributed agent platform which can be split onto several hosts.

    Java Application Programmers Interface.

    Library of FIPA interaction protocols, such as Contract Net, ready to be used.

    Graphical User Interface to manage several agents from the same Remote Management Agent.

    Available at http://jade.cselt.it/

  • JADE Agent Platform

  • Defining a JADE Agentimport jade.core.Agent;import jade.core.AID;

    public class BookBuyerAgent extends Agent {// Put agent initializations hereprotected void setup() {// Printout a welcome messageSystem.out.println(Hello! Buyer-agent +getAID().getName()+ is ready.);}// Put agent clean-up operations hereprotected void takeDown() {// Printout a dismissal messageSystem.out.println(Buyer-agent +getAID().getName()+ terminating.);}}

  • The JADE Behaviour ModelAgents perform tasks.Tasks are modelled as Behaviours.Typically, an agent will perform several concurrent tasks in response to different external events.

    Every JADE agent is composed of a single execution thread.Concurrent tasks are modelled and can be implemented as instances of jade.core.behaviours.Behaviour

  • The Behaviour class

    Tasks are associated with an agent via the addBehaviour() method of the Agent class.

    Each Behaviour subclass must implementpublic void action(): what the behaviour actually doespublic boolean done(): Whether the behaviour is finished

    Parallel behaviours are cooperative (not preemptive) and occur within a single Java Thread

    Behaviour switch occurs only when the action() method of the currently scheduled behaviour returns.

  • Behaviour typesBasic Behaviours:One shot behavioursCyclic behaviours

    Support for More Complex (composite) behaviours.WakerBehaviourImplement the onWake() method which is executed after a given timeout. After that execution the behaviour completes.

    TickerBehaviourImplement the onTick() method which is executed periodically with a given periodThe behaviour runs forever unless its stop() method is executed

  • JADE Agent Control Algorithm

  • JADE Tool SupportManagement, control, monitoring, and debugging of a multi-agent platformRMA (Remote Monitoring Agent)Dummy AgentSniffer AgentIntrospector AgentLog Manager AgentDF (Directory Facilitator) GUI

  • MobilityHard mobilityStatus: an agent canstop its execution on the local containermove to a remote container (likely on a different host)restart its execution there from the exact point where it was interrupted.Code: If the code of the moving agent is not available on the destination container it is automatically retrieved on demand.

    An agent must be Serializable in order to move

    Mobility can beself-initiated through doMove() of the Agent classforced by the AMS (following a request from another agent)

  • Advanced featuresUsing JADE (i.e. creating a container and starting agents) from an external Java program (servlets, applets, JSP..)

    Executing a normal JADE behavior in a dedicated thread

    Saving and reloading agent state on relational DB (persistence based on www.hibernate.org); add-on

    Integration with JESS (Java Expert System Shell)it allows reasoning about messages in JESSit allows a JESS program to control sending/receiving messages and/or creating/destroying JADE behaviours

  • Advanced featuresDistributed security, fault tolerance, support for replicated agents and services

    Protg, XML, RDF and OWL

    Application-specific persistent delivery filters & JADE kernel-level services

    The LEAP add-on (j2ME-compliant version of JADE)

  • BEYOND AOP

  • Abstractions in MAS

  • Abstractions in MASIndividual Agent Level: autonomy, situatednessCognitive Concepts: beliefs, desires, goals, intentions, plansReasoning Cycle: sense/reason/act, reactive/pro-active behaviourEnvironment Level: resources and services that agents can access and control; sensing and acting in an environmentSocial and Organisation Level: cooperation, coordination, regulation patternsRoles: rights, responsibilities, ...Organisational Rules: constraints on roles and their interactions, norms, deadlines, ...Organisational Structures: topology of interaction patterns and relations over activity control

  • Programming AgentsProgramming Languages for Multi-Agent SystemsE.g., Jason, Jadex, JACK, 2APL, GOAL, Brahms, JIAC, Agent Factory, MetateM, Golog variants, ...

    Architecture to represent an agent mental state:Beliefs: information available to agent (e.g., about the environment or other agents)Goals: states of aairs that the agent wants to achieveEvents: changes in agents beliefs or goalsCapabilities: reusable modules of activities that the agent can performPlans: reasoning about courses of action to achieve goalsRules: reasoning about beliefs

  • Programming AgentsSome steps of a Reasoning Cycle:Determining Relevant Plans for Handling EventsSelect a Plan for ExecutionExecute Part of an Intended PlansHandle Plan Failures

    Agent Interpreter is an infinite loop of such reasoning cycles.The architecture and reasoning cycle together with the agent program (specially plans) determine the behaviour of the agent.

  • Programming OrganisationsConcepts used to specify the state of an organisation:Agents, Roles, GroupsNorms, Obligations, Prohibitions, Permissions, ViolationsDependency, Power, Delegation, Information ow relationsDeadlines, Sanctions, Rewards

    Management Infrastructure to control and coordinate agent behaviour at run-time:Endogenous: The control is a part of the agent programExogenous: The control is performed by an external systemMonitoring Agent BehaviourEnforcing Organisational RulesRegimenting Organisational Rules

  • Programming EnvironmentsArtifacts to represent the state of the environmentAccess to Databases/Services/etc., Coordination, InteractionEnvironment "objects", i.e., non-proactive entities

    Processing Operations on ArtifactsRealising the effects of environments actionsProviding events related to sensing the environmentSynchronising agent actions

    At the right level of abstraction for a multi-agent system

  • WHY ENVIRONMENTS?

  • Agents and EnvironmentsThe notion of environment is intrinsically related to the notion of agent and multi-agent systemAn agent is a computer system that is situated in some environment and that is capable of autonomous action in this environment in order to meet its design objective" [Wooldridge, 2002]

    An agent is anything that can be viewed as perceiving its environment through sensors and acting upon the environment through effectors." [Russell and Norvig, 2003]

    Including both physical and software environments

  • Environment Programming: IssuesDefining the interfaceactions, perceptionsdata-model

    Defining the environment computational model & architecturehow the environment worksstructure, behaviour, topologycore aspects to face: concurrency, distribution

    Defining the environment programming modelhow to program the environment

  • Basic Level Overview

  • Single Agent Perspective

    Perceptionprocess inside agent inside of attaining awareness or understanding sensory information, creating percepts perceived form of external stimuli or their absenceActionsthe means to affect, change or inspect the environment

  • Multi-Agent Perspective

    In evidenceoverlapping spheres of visibility and inuence..which means: interaction

  • Why Environment Programming?Basic levelto create testbeds for real/external environments to ease the interface/interaction with existing software environments

    Advanced levelto uniformly encapsulate and modularise functionalities of the MAS out of the agents typically related to interaction, coordination, organisation, securityExternalisation

    this implies changing the perspective on the environmentenvironment as a first-class abstraction of the MASendogenous environments (vs. exogenous ones)programmable environments

  • Basic Level: FeaturesEnvironment conceptually conceived as a single monolithic blockproviding actions, generating perceptsEnvironment APIto define the set of actions and program actions computational behaviourwhich includes the generation of perceptstypically implemented using as single object/class in OO such as Javamethod to execute actionsfields to store the environment stateavailable in many agent programming languages/frameworkse.g., Jason, 2APL, GOAL, JADEX, Agent Factory

  • Example: JasonFlexible Java-based Environment APIEnvironment base class to be specialisedexecuteAction method to specify action semanticsaddPercept to generate percepts

  • Jason: Mars Environment

  • Jason: Mars Environment

  • Example: 2APL2APLBDI-based agent-oriented programming language integrating declarative programming constructs (beliefs, goals) and imperative style programming constructs (events, plans)

    Java-based Environment APIEnvironment base classimplementing actions as methodsinside action methods external events can be generated to be perceived by agents as percepts

  • 2APL: Block World Environment

  • 2APL: Block World Environment

  • Environment Interface StandardGoal of the initiativedesign and develop a generic environment interface standard a standard to connect agents to environments... environments such as agent testbeds, commercial applications, video games..

    Principleswrapping already existing environmentscreating new environments by connecting already existing appscreating new environments from scratch

    Requirementsgenericreuse

  • EIS Meta-Model

    By means of the Env. Interface agents perform actions and collect perceptsactually actions/percepts are issued to controllable entities in environment modelrepresent the agent bodies, with effectors and sensors

  • EIS FunctionsInterface functionsattaching, detaching, and notifying observers (software design pattern);registering and unregistering agents;adding and removing entities;managing the agents-entities-relation;performing actions and retrieving percepts;managing the environment

    Interface Intermediate languageto facilitate data-exchangeencoding percepts, actions, events

  • Advanced Level OverviewVision: environment as a rst-class abstraction in MAS [Weyns et al., 2007, Ricci et al., 2010b]application or endogenous environments, i.e. that environment which is an explicit part of the MASproviding an exploitable design & programming abstraction to build MAS applications

    Outcomedistinguishing clearly between the responsibilities of agent and environmentseparation of concernsimproving the engineering practice

  • Three Support LevelsBasic interface support

    Abstraction support level

    Interaction-mediation support level

  • Basic Interface SupportThe environment enables agents to access the deployment contexti.e. the hardware and software and external resources with which the MAS interacts

  • Abstraction SupportBridges the conceptual gap between the agent abstraction and low-level details of the deployment contextshields low-level details of the deployment context

  • Interaction-Mediation SupportRegulate the access to shared resourcesMediate interaction between agents

  • Environment Definition Revised

    The environment is a first-class abstraction that provides the surrounding conditions for agents to exist and that mediates both the interaction among agents and the access to resources

  • Environment ProgrammingEnvironment as first-class programming abstractionsoftware designers and engineers perspectiveendogenous environments (vs. exogenous one)programming MAS =programming Agents + programming Environment

    Environment as first-class runtime abstraction for agentsagent perspectiveto be observed, used, adapted, constructed, ...

    Defining computational and programming frameworks/ models also for the environment part

  • Environment Programming: IssuesDefining the environment interfaceactions, percepts, data modelcontract concept, as dened in software engineering contexts(Design by Contract)

    Defining the environment computational modelenvironment structure, behaviour

    Defining the environment distribution modeltopology

  • Environment Programming: DesiderataAbstractionkeeping the agent abstraction level e.g. no agents sharing and calling OO objectseffective programming models for controllable and observable computational entities

    Modularityaway from the monolithic and centralised view

    Orthogonalitywrt agent models, architectures, platformssupport for heterogeneous system

  • Environment Programming: DesiderataDynamic extensibilitydynamic construction, replacement, extension of environment partssupport for open systems

    Reusabilityreuse of environment parts for different kinds of applications

  • A&A AND CARTAGO

  • Agents & Artifacts Conceptual Model

  • A&A Basic ConceptsAgentsautonomous, goal-oriented pro-active entitiescreate and co-use artifacts for supporting their activitiesbesides direct communication

    Artifactsnon-autonomous, function-oriented, stateful entitiescontrollable and observablemodelling the tools and resources used by agentsdesigned by MAS programmers

    Workspacesgrouping agents & artifactsdening the topology of the computational environment

  • A&A Model FeaturesAbstractionartifacts as first-class resources and tools for agents

    Modularisationartifacts as modules encapsulating functionalities, organized in workspaces

    Extensibility and opennessartifacts can be created and destroyed at runtime by agents

    Reusabilityartifacts (types) as reusable entities, for setting up different kinds of environments

  • A&A Meta-Model

  • Artifact Abstract Representation

  • Examples of Artifacts

  • A Simple TaxonomyIndividual or personal artifactsdesigned to provide functionalities for a single agent usee.g. an agenda for managing deadlines, a library...

    Social artifactsdesigned to provide functionalities for structuring and managing the interaction in a MAScoordination artifacts, organisation artifacts, ...e.g. a blackboard, a game-board,...

    Boundary artifactsto represent external resources/servicese.g. a printer, a Web Serviceto represent devices enabling I/O with userse.g GUI, console, etc.

  • Actions and Percepts in A&A EnvironmentsExplicit semantics defined by the (endogenous) environment success/failure semantics, execution semanticsdefining the contract provided by the environment

    Actions Artifacts Operationthe action repertoire is given by the dynamic set of operations provided by the overall set of artifacts available in the workspace can be changed by creating/disposing artifactsaction success/failure semantics is defined by operation semantics

    Percepts Artifacts Observable Properties + Signalsproperties represent percepts about the state of the environment signals represent percepts concerning events signalled by the environment

  • Interaction Model: Use

    Performing an action corresponds to triggering the execution of an operationacting on artifact's usage interface

  • Interaction Model: Operation Execution

    a process structured in one or multiple transactional stepsasynchronous with respect to agent...which can proceed possibly reacting to percepts and executing actions of other plans/activitiesoperation completion causes action completionaction completion events with success or failure, possibly with action feedbacks

  • Interaction Model: Observation

    Agents can dynamically select which artifacts to observepredefined focus/stopFocus actions

  • Interaction Model: Observation

    By focussing an artifactobservable properties are mapped into agent dynamic knowledge about the state of the world, as perceptse.g. belief basesignals are mapped as percepts related to observable events

  • Artifact Linkability

    Basic mechanism to enable inter-artifact interactionlinking artifacts through interfaces (link interfaces)operations triggered by an artifact over an other artifact

    Useful to design & program distributed environmentsrealised by set of artifacts linked togetherpossibly hosted in dierent workspaces

  • CArtAgOCommon ARtifact infrastructure for AGent Open environment (CArtAgO) [Ricci et al., 2009b]Computational framework / infrastructure to implement and run artifact-based environment [Ricci et al., 2007c]Java-based programming model for dening artifactsset of basic API for agent platforms to work within artifact-based environment

    Distributed and open MASworkspaces distributed on Internet nodesagents can join and work in multiple workspace at a timeRole-Based Access Control (RBAC) security model

    Open-source technologyavailable at http://cartago.sourceforge.net

    ************