ADAPTABLE SOFTWARE ARCHITECTURAL SOLUTIONS THAT ENABLE ADAPTATION n
ADAPTABLE SOFTWARE ARCHITECTURAL SOLUTIONS THAT ENABLE ADAPTATION n TO CHANGES IN REQUIREMENTS (MICROKERNEL) n. BY DYNAMICAL CHANGE STRUCTURE AND BEHAVIOR OF SOFTWARE (REFLECTION) 1
MICROKERNEL PATTERN n SEPARATES a Minimal Functional Core (MICROKERNEL) from extended functionality provided by (INTERNAL SERVERS) and customer-specific parts (EXTERNAL SERVERS) n The MICROKERNEL also provides the sockets for plugging in these extensions and coordinating their collaboration. 2
EXAMPLE: FIPA Architecture Describes : Addresses issues: n Elements of FIPA agent n Transport mechanisms for messages(RMI, SUNIIOP) systems n Relationships between n Mapping specifications to new technologies (XML, elements CORBA, SMTP, web n Mechanisms for servers) communication and n Levels of operation which transport include relationships (communication between agents or languages, protocols, between agents and platforms network services ) 3
FIPA-OS as Microkernel Application Agents A. C. L. Agent Configuration Agent Shell Task Management; Conversation Management Directory Facilitator Agent Management Message Transport Services; Internal Message Transport Protocols Agent Communication Channel 4
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? ) 5
Architecture Planner Scheduler Reasoning engine Context collector User profile manager Context parser Context d. B Content handler Message generator ACL parser Communications K n o w l e d g e b a s e 6
• 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 1/6/2022 Multi-Agent Systems 7
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) 8
HOLONIC ENTERPRISE Field Cluster CC CC RESOURCE ECr CC CE CE CE CC CC EC RESOURCE EC ENTERPRISE CE CE CE CC CC RESOURCE ECr RESOURCE EC CC CE CE CE RESOURCE EC RESOURCE r CE EC CE CE Dynamic Virtual Cluster CE CE CE Field Cluster HOLONIC ENTERPRISE AS A HOLARCHY 9
FIPA Kernel Includes mandatory agents that manage the platform: n 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 n ACC (Agent Communication Channel)-provides the foundation for communication between the software agents n DF (Directory facilitator) represents a yellow pages directory for agents -has information about the agents and the services they offer. 10
Core Platform Functionality (FIPA - m. K) n a collection of services that are closely coupled n provides an infrastructure where agents are deployed n a FIPA-compliant AP consists of three agents: AMS, ACC, DF 11
Agent Management System n Manages the platform resources n Has control over access and use of the AP being the managing authority of it. n Supports a set of methods for binding agents to platform, providing information about the platform capabilities and settings n Offers “white pages” services to other agents by maintaining an index of agent names that reside on an AP and their corresponding addresses. 12
Agent Communication Channel n The ACC is a low level entity that takes care of message routing between agents within an AP to agents on other APs. n It publishes its transport address into a file store to a location for other ACCs to locate n Uses information provided by the Agent Management System to direct messages between agents n Messages addressed to an agent will first be sent to an ACC. 13
FIPA-OS as Microkernel Application Agents A. C. L. Agent Configuration Agent Shell Task Management; Conversation Management Directory Facilitator Agent Management Message Transport Services; Internal Message Transport Protocols Agent Communication Channel 14
Directory Facilitator n Provides a “yellow pages “ directory to agents n It must maintain an accurate list of agents with the most current information about them n Agents may register with DF or query it about types of services offered by other agents. n Management actions: register, search, modify 15
Message Transport Service n Provides the ability to send and receive messages to and from an Agent implementation n It has built-in mechanisms for Internal and External transport n It has a split structure composed of different service stacks (Buffer. Service, ACCRouter. Service) 16
INTERNAL SERVER n Extends the functionality provided by the Microkernel (m. K) n Encapsulate some system specifics n Design Rule: Keep the m. K as small as possible n Extended services are activated by the m. K as needed. n Example: Configuration server for agent profiles 17
FIPA-OS INTERNAL SERVERS n Agent configuration settings (in form of strings in a XML format) Contains information or defines : v What MTP (message transport protocol) is used by the platform v Agent name v Address (location) v Types of databases to be used for storage o Profiles are read through parsers 18
INTERNAL VS. EXTERNAL Ø Mandatory Functionality - INTERNAL SERVICES v Agent Shell v Task Manager v Conversation Manager v MTS Ø ‘Pluggable’ Functions - EXTERNAL SERVICES v MTP v JESS (Agent Shell) v Parser’s (ACL, XML, RDF) 19
Agent Construction n FIPA provides a template (Agent Shell - internal service!) for building agents. A new implemented agent consists of a class that: n extends the FIPAOSAgent class that provides methods for registration, message sending, setting up tasks and agent shutdown n contains a number of Task implementations that give the functionality of the agent n contains application specific code for the desired behavior within the architecture. 20
FIPA-OS as Microkernel Application Agents A. C. L. Agent Configuration Agent Shell Task Management; Conversation Management Directory Facilitator Agent Management Message Transport Services; Internal Message Transport Protocols Agent Communication Channel 21
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 get. Profile(), register. With. AMS(), shutdown()… 22
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) 23
Task Manager (IS) n Splits the functionality of an Agent into small units of work (task decomposition) n The subtasks are reusable as code and easy to debug n Multiple tasks can be executed at once n Handles task creation and registration 24
FIPA-OS as Microkernel Application Agents A. C. L. Agent Configuration Agent Shell Task Management; Conversation Management Directory Facilitator Agent Management Message Transport Services; Internal Message Transport Protocols Agent Communication Channel 25
Messages and Tasks n Multiple conversations can be conducted simultaneously given the ability of Task to send messages n A Task. Manager coordinates the Tasks inside the agents and is built around event-based processing. n Every Task within the Task. Manager has a set of events of type Task. Event n When a new task is created (new. Task()) an event will be added to the queue of the Task. Event 26
Messages and Tasks (cont. ) n If messages are constructed with the protocol field set to ‘fipa-request’, a certain message order is reinforced n Agents are configured to be able to handle all message types in that protocol n 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. n In order to handle messages like request, refuse, inform, several methods that take Conversation objects as arguments are provided. 27
Constructing a Task public class First. Task extends Task{ public First. Task(Order. Agent owner){ } public void start. Task(){ } public void send. Request( Conversation conv ){ ACLMessage acl= get. New. Conversation(String protocol) acl. set. Content(…) acl. set. Language(…) acl. set. Ontology(…) forward(acl) } } 28
Tasks and Conversations FIPAOSAgent Conversation. Manager Task. Manager MTS Task FIPAQuery protocol Conversation Task. Event FIPARequest protocol Conversation. Update. Event public void handle. Request(conv) Other Events 29
Conversation Manager (IS) n Provides the ability to track conversation state and mechanisms for grouping messages of the same conversation together (encapsulated as Conversation objects that represent individual conversations) - e. g. Cooperation Domains n Ensures that the conversation protocol is being followed by the involved parties (agents) n A Conversation class with various specializations is provided to enable the use of different protocols 30
Message Transport Protocol Internal (RMI) External (SUNIIIOP) Ø Proprietary Ø Standardized mechanism Ø Efficiency vs. interoperability Ø Messages do not need to be prepared before being sent mechanism Ø Provides interoperability Ø Messages are prepared before being sent 31
Interplatform communication 32
Message Encoding (ES) 33
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. 1/6/2022 Multi-Agent Systems 34
ACL Message structure n Represents a communicative act (Policy) that can be simple (inform , request, confirm) or composed request(propose(action)) n Has its corresponding semantics and protocol n Contains parameters=>attributes /values: n : language representation language for content the information about which a message is sent n : receiver agent that receives the message n : protocol interaction protocol used by sender n ontology to which the content refers to n : content 35
Agent Interactions n FIPA ACL deals with intention interpretation and supports the communication between agents through explicit linguistic actions n The information content transmitted and the protocols are those described and defined in FIPA specifications n www. fipa. org 36
ACL - Example n The information content will be communicated through the existing message types. n Ex: (request : sender Order. Agent : receiver Operation. Planning. Agent : content(action d (produce 50 parts A (product ABC))(due date: Dec 12, 2000)) : protocol fipa-request : reply-with order 132 ) 37
Microkernel Implementation n 1. Analyze the Application Domain (define policies of external servers; identify the core functionality needed to implement the external servers). n 2. Categorize the services to separate core services (microkernel) from internal servers. n CRITERIA: time-critical, hardware-dependent and frequently used operations - in microkernel. 38
… cont n RULE: Place all resource-management services in the m. K (e. g. agent management, task management, memory management). Also strategies for sharing, locking, allocation and deallocation of resources. 39
APPLICATION DOMAIN: Supply Chain Management n Composed of cooperating agents, each performing a set of supply chain operations (functions: order, shipping, receiving, etc. ) n The agents are constructed as computational systems that interact across networks n Agents are deployed on several FIPA platforms that already contain the infrastructure (m. K) to enable the communication between them n The interactions among agents are managed through existing Task and Conversation classes (IS) 40
Agents for Supply Chain Roles and Interactions n 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. n 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. n 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. 41
42
Agent Definitions q Order Agent - Gets orders from customers - Handles requests for changing/ canceling orders - Transmits the orders to OPAgent q Operation. Planning 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. 43
Agent Definitions (cont. ) q Shipping Agent Schedules and monitors the performing of transportation tasks pertinent to each order as requested or specified by the Operation. Planning Agent - Assigns transportation resources (routes) in order to construct the best possible shipping schedule. - q Supplier Agent Responsible for scheduling the tasks related to product delivery - Manages the availability of requested products - 44
Agent Implementation n As part of the SCM architecture we consider some functional agents (Supplier and Shipping agents), the Operation Planning agent and an Order agent. n The information content transmitted and the protocols are those defined in FIPA language specifications 45
Implementation. . . n 4. Find a complete set of operations and abstractions needed to define every external service (POLICIES). n 5. Implement each Policy using the services and mechanisms that the microkernel provides through its interfaces (includes services provided by internal servers). n Determine strategies for communication (request, transmission and retrieval of 46
Agent Construction n FIPA provides a template (Agent Shell) for building agents. A new implemented agent consists of a class that: n extends the FIPAOSAgent class that provides methods for registration, message sending, setting up tasks and agent shutdown n contains a number of Task implementations that give the functionality of the agent n contains application specific code for the desired behavior within the architecture. 47
Agent Interactions n FIPA ACL deals with intention interpretation and supports the communication between agents through explicit linguistic actions n The information content transmitted and the protocols are those described and defined in FIPA specifications 48
Agent Interactions (cont. . ) n The information content will be communicated through the existing message types. n Ex: (request : sender Order. Agent : receiver Operation. Planning. Agent : content(action d (produce 50 parts A (product ABC))(due date: Dec 12, 2000)) : protocol fipa-request : reply-with order 132 ) 49
EXTERNAL SERVERS (‘Personality’) n Implement specific ‘views’ of the application domain (as Policies - e. g. Order Policy) 50
Agent Interactions (cont. . ) n The receiver (the Operation. Planning. Agent) can only answer with agree, refuse in the first stage given the performatives for the fipa-request protocol employed here Request (agree : sender Operation. Planning. Agent : receiver Order. Agent : content (produce d (50 parts A (product ABC)) (delivery time Jan 15, 2001)) Agree Refuse : in-reply-to order 132 : protocol fipa-request Inform Failure 51
Messages and Tasks n Multiple conversations can be conducted simultaneously given the ability of Task to send messages n A Task. Manager coordinates the Tasks inside the agents and is built around event-based processing. n Every Task within the Task. Manager has a set of events of type Task. Event n When a new task is created (new. Task()) an event will be added to the queue of the Task. Event 52
Messages and Tasks (cont. ) n If messages are constructed with the protocol field set to fipa-request, a certain message order is reinforced n Agents are configured to be able to handle all message types in that protocol n 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. n In order to handle messages like request, refuse, inform, several methods that take Conversation objects as arguments are provided. 53
Constructing a Task public class First. Task extends Task{ public First. Task(Order. Agent owner){ } public void start. Task(){ } public void send. Request( Conversation conv ){ ACLMessage acl= get. New. Conversation(String protocol) acl. set. Content(…) acl. set. Language(…) acl. set. Ontology(…) forward(acl) } } 54
Tasks and Conversations FIPAOSAgent Conversation. Manager Task. Manager MTS Task FIPAQuery protocol Conversation Task. Event FIPARequest protocol Conversation. Update. Event public void handle. Request(conv) Other Events 55
Microkernel Implementation n 1. Analyze the Application Domain (define policies of external servers; identify the core functionality needed to implement the external servers). n 2. Categorize the services to separate core services (microkernel) from internal servers. n CRITERIA: time-critical, hardware-dependent and frequently used operations - in microkernel. 56
… cont n RULE: Place all resource-management services in the m. K (e. g. agent management, task management, memory management). Also strategies for sharing, locking, allocation and deallocation of resources. 57
Implementation. . . n 7. Structure the Microkernel (e. g. using the Layers Pattern) to separate system-specific from system-independent parts. Lower layers hide system dependencies from the services that the Microkernel exposes publicly. Intermediate layers bridge hardware specifics with the gateways towards outside processes (the uppermost layer. ) 58
Implementation. . . n 4. Find a complete set of operations and abstractions needed to define every external service (POLICIES). n 5. Implement each Policy using the services and mechanisms that the microkernel provides through its interfaces (includes services provided by internal servers). n Determine strategies for communication (request, transmission and retrieval of 59
Layers FIPA-OS Layers Application Agents ACL MTP Directory Facilitator MTS Agent Shell Task/Conv. Agent Manager Configurator Agent Management System Agent Communication Channel 60
FIPA-OS as Microkernel Application Agents A. C. L. Agent Configuration Agent Shell Task Management; Conversation Management Directory Facilitator Agent Management Message Transport Services; Internal Message Transport Protocols Agent Communication Channel 61
…cont n Design and Implement the Internal Servers - they are accessed exclusively by the m. K!! n Implement External Servers - write the Policies that describe the services such that they can be implemented using the programming interfaces of the m. K. n Implement the Adapters - e. g. can be implemented as Proxies representing the 62
REFLECTION PATTERN 63
64
PARTICIPANTS 65
66
67
68
69
70
71
72
- Slides: 72