720 likes | 736 Vues
ADAPTABLE SOFTWARE. ARCHITECTURAL SOLUTIONS THAT ENABLE ADAPTATION TO CHANGES IN REQUIREMENTS (MICROKERNEL) BY DYNAMICAL CHANGE STRUCTURE AND BEHAVIOR OF SOFTWARE (REFLECTION). MICROKERNEL PATTERN.
E N D
ADAPTABLE SOFTWARE ARCHITECTURAL SOLUTIONS THAT ENABLE ADAPTATION TO CHANGES IN REQUIREMENTS (MICROKERNEL) BY DYNAMICAL CHANGE STRUCTURE AND BEHAVIOR OF SOFTWARE (REFLECTION)
MICROKERNEL PATTERN • SEPARATES a Minimal Functional Core (MICROKERNEL) from extended functionality provided by (INTERNAL SERVERS) and customer-specific parts (EXTERNAL SERVERS) • The MICROKERNEL also provides the sockets for plugging in these extensions and coordinating their collaboration.
Describes : Elements of FIPA agent systems Relationships between elements Mechanisms for communication and transport (communication languages, protocols, network services ) Addresses issues: Transportmechanisms for messages(RMI, SUNIIOP) Mapping specifications to new technologies (XML, CORBA, SMTP, web servers) Levels of operation which include relationships between agents or between agents and platforms EXAMPLE: FIPA Architecture
Application Agents A.C.L. Task Management; Conversation Management Agent Configuration Directory Facilitator Agent Shell Agent Management Message Transport Services; Internal Message Transport Protocols Agent Communication Channel FIPA-OS as Microkernel
INTELLIGENT AGENTS • “An intelligent agent is a software entity which exhibits, in some significant measure, autonomy, intelligence, and environmental awareness, and which interacts with its environment to achieve internal goals.” [Jennings, 1996] • Co-operation with other agents • Software + Hardware? • (Agents or Holons or Autonomous XXX?)
Architecture Planner K n o w l e d g e b a s e Scheduler Reasoning engine Context collector User profile manager Context manager Context parser Content handler Context dB Message generator ACL parser Communications
a protocol is a stereotypical dialogue for a cooperation framework (e.g. contract net) • reasoning, deciding and reacting component: • - maintains an agenda containing active scripts • - a script can be (goal-driven) invoked to satisfy an intention or (data-driven) involved in response to current situation • - a filter component which selects scripts to execute Multi-Agent Systems
WHY AGENTS ? • More usable and understandable structure (e.g. spaghetti code vs structure modules). • (Almost) essential in large distributed systems where all “subsystems” need to be continually interchanging information to collectively achieve or to maintain some desired state • (e.g. highly coupled subsystems) • (cf. human case of multi-disciplinary research team)
HOLONIC ENTERPRISE ENTERPRISE Field Cluster CC CC RESOURCEr EC RESOURCE EC CC CE CE CE RESOURCE EC CE CE CE CC CC RESOURCE ENTERPRISE CE CE CE EC RESOURCE EC CE CE CE CE CE CE CC CC RESOURCEr EC RESOURCE EC CC Dynamic Virtual Cluster CE CE CE RESOURCEr EC CE CE CE CE CE CE Field Cluster HOLONIC ENTERPRISE AS A HOLARCHY
FIPA Kernel Includes mandatory agents that manage the platform: • AMS (Agent Management System) -- manages the creation,deletion,authentication of agents and provides a white pages directory service for the agents that reside on the platform • ACC (Agent Communication Channel)-provides the foundation for communication between the software agents • DF(Directory facilitator) represents a yellow pages directory for agents -has information about the agents and the services they offer.
Core Platform Functionality(FIPA - mK) • a collection of services that are closely coupled • provides an infrastructure where agents are deployed • a FIPA-compliant AP consists of three agents:AMS, ACC,DF
Agent Management System • Manages the platform resources • Has control over access and use of the AP being the managing authority of it. • Supports a set of methods for binding agents to platform, providing information about the platform capabilities and settings • Offers “white pages” services to other agents by maintaining an index of agent names that reside on an AP and their corresponding addresses.
Agent Communication Channel • The ACC is a low level entity that takes care of message routing between agents within an AP to agents on other APs. • It publishes its transport address into a file store to a location for other ACCs to locate • Uses information provided by the Agent Management System to direct messages between agents • Messages addressed to an agent will first be sent to an ACC.
Application Agents A.C.L. Task Management; Conversation Management Agent Configuration Directory Facilitator Agent Shell Agent Management Message Transport Services; Internal Message Transport Protocols Agent Communication Channel FIPA-OS as Microkernel
Directory Facilitator • Provides a “yellow pages “ directory to agents • It must maintain an accurate list of agents with the most current information about them • Agents may register with DF or query it about types of services offered by other agents. • Management actions: register, search, modify
Message Transport Service • Provides the ability to send and receive messages to and from an Agent implementation • It has built-in mechanisms for Internal and External transport • It has a split structure composed of different service stacks (BufferService, ACCRouterService)
INTERNAL SERVER • Extends the functionality provided by the Microkernel (mK) • Encapsulate some system specifics • Design Rule: Keep the mK as small as possible • Extended services are activated by the mK as needed. • Example: Configuration server for agent profiles
FIPA-OS INTERNAL SERVERS • Agent configuration settings (in form of strings in a XML format) Contains information or defines : • What MTP (message transport protocol) is used by the platform • Agent name • Address (location) • Types of databases to be used for storage • Profiles are read through parsers
INTERNAL VS. EXTERNAL • Mandatory Functionality - INTERNAL SERVICES • Agent Shell • Task Manager • Conversation Manager • MTS • ‘Pluggable’ Functions - EXTERNAL SERVICES • MTP • JESS (Agent Shell) • Parser’s (ACL, XML, RDF)
Agent Construction • FIPA provides a template (Agent Shell - internal service!) for building agents. A new implemented agent consists of a class that: • extends the FIPAOSAgent class that provides methods for registration, message sending, setting up tasks and agent shutdown • contains a number of Task implementations that give the functionality of the agent • contains application specific code for the desired behavior within the architecture.
Application Agents A.C.L. Task Management; Conversation Management Agent Configuration Directory Facilitator Agent Shell Agent Management Message Transport Services; Internal Message Transport Protocols Agent Communication Channel FIPA-OS as Microkernel
Agent Shell (IS) A template provided for agent implementation Responsible for loading an agent profile and initializing its components It creates a MTS (message transport service), a Task Manager and a Conversation Manager A new agent consists of a class that extends the FIPAOSAgent and inherits all its methods among which we can find getProfile(), registerWithAMS(), shutdown()…
Agent Shell • Provides functionalities (Policies) for: • Sending messages • Retrieving the Agent’s properties • Registration with platform • Setting up the Task • Shutdown (clean shutdown for all components of an agent)
Task Manager (IS) • Splits the functionality of an Agent into small units of work (task decomposition) • The subtasks are reusable as code and easy to debug • Multiple tasks can be executed at once • Handles task creation and registration
Application Agents A.C.L. Task Management; Conversation Management Agent Configuration Directory Facilitator Agent Shell Agent Management Message Transport Services; Internal Message Transport Protocols Agent Communication Channel FIPA-OS as Microkernel
Messages and Tasks • Multiple conversations can be conducted simultaneously given the ability of Task to send messages • A TaskManager coordinates the Tasks inside the agents and is built around event-based processing. • Every Task within the TaskManager has a set of events of type TaskEvent • When a new task is created (newTask()) an event will be added to the queue of the TaskEvent
Messages and Tasks (cont.) • If messages are constructed with the protocol field set to ‘fipa-request’, a certain message order is reinforced • Agents are configured to be able to handle all message types in that protocol • Messages sent are part of a Conversation and when a Task sends a message, the conversation that message is part of is bound to that Task. • In order to handle messages like request, refuse, inform, several methods that take Conversation objects as arguments are provided.
Constructing a Task public class FirstTask extends Task{ public FirstTask(OrderAgent owner){ } public void startTask(){ } public void sendRequest( Conversation conv ){ ACLMessage acl= getNewConversation(String protocol) acl.setContent(…) acl.setLanguage(…) acl.setOntology(…) forward(acl) } }
Tasks and Conversations FIPAOSAgent ConversationManager TaskManager MTS Task Conversation FIPAQuery protocol TaskEvent FIPARequest protocol ConversationUpdateEvent public void handleRequest(conv) Other Events
Conversation Manager (IS) • Provides the ability to track conversation state and mechanisms for grouping messages of the same conversation together (encapsulated as Conversation objects that representindividual conversations) - e.g. Cooperation Domains • Ensures that the conversation protocol is being followed by the involved parties (agents) • A Conversation class with various specializations is provided to enable the use of different protocols
Internal (RMI) Proprietary mechanism Efficiency vs. interoperability Messages do not need to be prepared before being sent External (SUNIIIOP) Standardized mechanism Provides interoperability Messages are prepared before being sent Message Transport Protocol
Agent Languages Agent Languages An agent language is a language for programming software or hardware agents or agent systems. It should provide for at least some structural agent features and may also allow agency attributes to be directly programmed. It may be incorporated in a development environment with user-friendly editors, browsers, etc. which facilitate the programming. Most existing agent languages are deliberative (e.g. AGENTO, PLACA, CONCURRENT METAM, APRIL, MAIL) often related closely (or less so) to agent theory and logic. Some agent languages, e.g. ABLE, are reactive languages. Multi-Agent Systems
ACL Message structure • Represents a communicative act (Policy) that can be simple (inform ,request,confirm) or composed request(propose(action)) • Has its corresponding semantics and protocol • Contains parameters=>attributes /values: • :languagerepresentation language for content • :contentthe information about which a message is sent • :receiveragent that receives the message • :protocolinteraction protocol used by sender • ontology ontology to which the content refers to
Agent Interactions • FIPA ACL deals with intention interpretation and supports the communication between agents through explicit linguistic actions • The information content transmitted and the protocols are those described and defined in FIPA specifications • www.fipa.org
ACL - Example • The information content will be communicated through the existing message types. • Ex: (request :sender OrderAgent :receiver OperationPlanningAgent :content(action d (produce 50 parts A (product ABC))(due date: Dec 12, 2000)) :protocol fipa-request :reply-with order 132 )
Microkernel Implementation • 1. Analyze the Application Domain (define policies of external servers; identify the core functionality needed to implement the external servers). • 2. Categorize the services to separate core services (microkernel) from internal servers. • CRITERIA: time-critical, hardware-dependent and frequently used operations - in microkernel.
… cont • RULE: Place all resource-management services in the mK (e.g. agent management, task management, memory management). Also strategies for sharing, locking, allocation and de-allocation of resources.
APPLICATION DOMAIN: Supply Chain Management • Composed of cooperating agents, each performing a set of supply chain operations (functions: order, shipping, receiving, etc.) • The agents are constructed as computational systems that interact across networks • Agents are deployed on several FIPA platforms that already contain the infrastructure (mK) to enable the communication between them • The interactions among agents are managed through existing Task and Conversation classes (IS)
Agents for Supply Chain Roles and Interactions • Extending a generic agent framework to an integrated supply chain management architecture (by implementing new application specific agents) implies the identification of the entities involved in a supply chain as well as the elements that affect the performance of it. • Elements or roles like inventory control, material flows,information storage are embedded as abilities into new specialized agents or application specific agents which will perform the respective activities. • Other agents with built-in capabilities will model the roles played by different parts in a supply chain network such as capacity allocation, resource management and information exchange.
Agent Definitions • Order Agent - Gets orders from customers - Handles requests for changing/ canceling orders - Transmits the orders to OPAgent • OperationPlanning Agent - Receives orders from Customer through the Order Agent - Coordinates manufacturers, suppliers, transportation, distribution within the enterprise to achieve the best possible results in terms of customer requirements - It monitors the execution of tasks through conversations with functional agents within the supply chain.
Agent Definitions (cont.) • Shipping Agent - Schedules and monitors the performing of transportation tasks pertinent to each order as requested or specified by the OperationPlanning Agent - Assigns transportation resources (routes) in order to construct the best possible shipping schedule. • Supplier Agent - Responsible for scheduling the tasks related to product delivery - Manages the availability of requested products
Agent Implementation • As part of the SCM architecture we consider some functional agents (Supplier and Shipping agents), the Operation Planning agent and an Order agent. • The information content transmitted and the protocols are those defined in FIPA language specifications
Implementation ... • 4. Find a complete set of operations and abstractions needed to define every external service (POLICIES). • 5. Implement each Policy using the services and mechanisms that the microkernel provides through its interfaces (includes services provided by internal servers). • Determine strategies for communication (request, transmission and retrieval of services)
Agent Construction • FIPA provides a template (Agent Shell) for building agents. A new implemented agent consists of a class that: • extends the FIPAOSAgent class that provides methods for registration, message sending, setting up tasks and agent shutdown • contains a number of Task implementations that give the functionality of the agent • contains application specific code for the desired behavior within the architecture.
Agent Interactions • FIPA ACL deals with intention interpretation and supports the communication between agents through explicit linguistic actions • The information content transmitted and the protocols are those described and defined in FIPA specifications
Agent Interactions (cont..) • The information content will be communicated through the existing message types. • Ex: (request :sender OrderAgent :receiver OperationPlanningAgent :content(action d (produce 50 parts A (product ABC))(due date: Dec 12, 2000)) :protocol fipa-request :reply-with order 132 )
EXTERNAL SERVERS (‘Personality’) • Implement specific ‘views’ of the application domain (as Policies - e.g. Order Policy)