Enabling mobile agents to dynamically assume roles
光电变色 英语

光电变色英语Photochromic technology is a fascinating and rapidly evolving field that has captured the attention of scientists, engineers, and consumers alike. This remarkable phenomenon, where materials change color in response to light exposure, has opened up a world of possibilities in various industries, from eyewear to construction. In this essay, we will delve into the science behind photochromic technology, its applications, and the exciting developments that are shaping the future of this innovative field.At the heart of photochromic technology is the ability of certain materials to undergo a reversible color change when exposed to specific wavelengths of light. This change is triggered by the rearrangement of molecules within the material, which alters the way they absorb and reflect light. The most common photochromic materials are organic compounds, such as spiropyrans and diarylethenes, which have the remarkable ability to switch between two different molecular structures in response to light.When these materials are exposed to ultraviolet (UV) or short-wavelength visible light, the molecules undergo a transformation that increases their conjugation and alters their electronic structure. This, in turn, changes the wavelengths of light they absorb, resulting in a visible color change. Conversely, when the material is exposed to longer-wavelength visible light or removed from the light source, the molecules revert to their original state, and the material returns to its original color.The versatility of photochromic technology has led to a wide range of applications across various industries. Perhaps the most well-known use of this technology is in the production of photochromic lenses for eyewear. These lenses are designed to darken when exposed to UV or bright light, providing wearers with adaptive sun protection and reducing eye strain. As the wearer moves from bright outdoor environments to dimly lit indoor spaces, the lenses automatically adjust their tint, offering a seamless and convenient solution for changing lighting conditions.Beyond eyewear, photochromic technology has found applications in the construction industry. Photochromic coatings and films can be applied to windows, walls, and even roofing materials, allowing them to respond to changes in light intensity. This can help regulate the amount of heat and glare entering a building, improving energy efficiency and creating more comfortable indoor environments. Additionally, photochromic materials can be incorporated into smartwindows, which can actively control the amount of light and heat transmission, enhancing the overall energy performance of a building.In the realm of consumer products, photochromic technology has made its mark on a variety of everyday items. From clothing and accessories to home decor and toys, the ability to change color in response to light has added a touch of dynamism and interactivity to these products. For example, photochromic t-shirts can reveal hidden designs or patterns when exposed to sunlight, while photochromic furniture can adapt to the mood and ambiance of a room.The potential of photochromic technology extends beyond these immediate applications. Researchers and scientists are continuously exploring new ways to harness the unique properties of these materials, leading to exciting developments in fields such as data storage, security, and even biomedical applications.In the realm of data storage, photochromic materials have shown promise as a means of high-density, rewritable optical data storage. The ability of these materials to switch between different molecular states can be leveraged to encode and store information, potentially revolutionizing the way we store and retrieve digital data.Furthermore, photochromic technology has found applications in the field of security and anti-counterfeiting. Photochromic inks and coatings can be used to create unique, tamper-evident seals or labels that change color when exposed to light, making it easier to detect forgeries or unauthorized modifications.In the biomedical field, photochromic materials have been explored for their potential in drug delivery and medical imaging. Photochromic compounds can be designed to release therapeutic agents or change their optical properties in response to specific wavelengths of light, enabling targeted and controlled drug delivery or improved imaging techniques.As the field of photochromic technology continues to evolve, researchers and engineers are pushing the boundaries of what is possible. New materials, advanced manufacturing techniques, and innovative applications are constantly emerging, promising even more exciting advancements in the years to come.One particularly promising area of research is the development of multifunctional photochromic materials. These materials can combine the color-changing properties with additional functionalities, such as sensing, energy harvesting, or self-healing capabilities. This convergence of technologies opens up a world of possibilities, from smart windows that can generate electricity to self-cleaning surfaces that adapt to their environment.Moreover, the integration of photochromic technology with other emerging fields, such as artificial intelligence and the Internet of Things, could lead to the creation of truly intelligent and adaptive systems. Imagine a future where buildings, clothing, or even personal devices can respond dynamically to changes in their surroundings, optimizing their performance and enhancing the user experience.In conclusion, photochromic technology is a remarkable and rapidly evolving field that has already made a significant impact on our lives. From eyewear to construction, and from consumer products to biomedical applications, the ability of materials to change color in response to light has unlocked a world of possibilities. As researchers continue to push the boundaries of this technology, we can expect to see even more innovative and transformative applications emerge, shaping the way we interact with the world around us. The future of photochromic technology is indeed a bright one, filled with the promise of new discoveries and the potential to revolutionize countless industries.。
recastdemo 编译

recastdemo 编译Recastdemo, also known as Recast Navigation, is a powerful open-source library that provides functionalities for generating and navigating dynamic navigation meshes in real-time 3D environments. It is widely used in game development, virtual reality (VR), augmented reality (AR), and other interactive applications. In this recastdemo compilation, we will explore some key aspects and features of Recast Navigation without including any links.First and foremost, Recastdemo is written in C++ and supports multiple platforms such as Windows, Linux, macOS, iOS, and Android. It integrates seamlessly into various game engines, including Unity and Unreal Engine, making it accessible for developers across different platforms and environments. The library uses a voxel-based approach to build navigation meshes, which allows for efficient runtime modification and dynamic content updates.One of the core functionalities of Recast Navigation is the ability to automatically generate navigation meshes from triangle-based input geometry. It employs the Recast & Detour toolchain to process the input data and generate accurate and efficient navigation meshes that capture walkable surfaces. The process involves several steps, including voxelization, polygonization, contour generation, and mesh rasterization. Recastdemo provides a comprehensive set of parameters that can be tuned to customize the quality and performance of the generated navigation meshes. Another important feature of Recastdemo is pathfinding. Once thenavigation mesh is constructed, the library offers various methods to find the shortest path between two points in the mesh. It implements the popular A* algorithm, which efficiently explores the navigation mesh graph to find the optimal path. Recast Navigation includes many advanced features to handle complex scenarios, such as dynamic obstacles, terrain navigation, and crowd simulation. These features enable developers to create realistic and interactive environments that offer smooth and intelligent movement for characters or agents.Recastdemo also supports dynamic updates of the navigation mesh to handle changes in the environment or gameplay. It provides functions to add, remove, or modify polygons within the navigation mesh at runtime. This feature is particularly useful for scenarios where the world needs to be modified or where obstacles need to be dynamically placed or removed. It ensures that the navigation mesh remains up-to-date and accurate, facilitating seamless navigation for characters or agents.Furthermore, Recastdemo offers additional features to enhance the navigation experience. It includes functions for local steering behaviors such as obstacle avoidance and crowd simulation. These features enable agents to navigate in complex and dynamic environments, avoiding obstacles and interacting with other characters or agents realistically.In conclusion, Recastdemo is a powerful and versatile library for generating and navigating dynamic navigation meshes in real-time 3D environments. Its voxel-based approach, automatic generation of navigation meshes, and A* based pathfinding algorithm provideefficient and accurate navigation solutions. With its support for dynamic updates and additional features for steering behaviors, Recast Navigation empowers developers to create engaging and immersive experiences in games, virtual reality, and other interactive applications.。
The International Journal of Advanced Manufacturing Technology

Ping LouÆZu-de ZhouÆYou-Ping ChenÆWu AiStudy on multi-agent-based agile supply chain management Received:23December2002/Accepted:23December2002/Published online:5December2003ÓSpringer-Verlag London Limited2003Abstract In a worldwide network of suppliers,factories, warehouses,distribution centres and retailers,the supply chain plays a very important role in the acquisition, transformation,and delivery of raw materials and products.One of the most important characteristics of agile supply chain is the ability to reconfigure dynami-cally and quickly according to demand changes in the market.In this paper,concepts and characteristics of an agile supply chain are discussed and the agile supply chain is regarded as one of the pivotal technologies of agile manufacture based on dynamic alliance.Also,the importance of coordination in supply chain is emphas-ised and a general architecture of agile supply chain management is presented based on a multi-agent theory, in which the supply chain is managed by a set of intelli-gent agents for one or more activities.The supply chain management system functions are to coordinate its agents.Agent functionalities and responsibilities are de-fined respectively,and a contract net protocol joint with case-based reasoning for coordination and an algorithm for task allocation is presented.Keywords Agile supply chainÆMulti-agent systemÆCoordinationÆCBRÆContract net protocol1IntroductionAdvanced technology and management are constantly being adopted to improve an enterpriseÕs strength and competitive ability in order to achieve predominance among hot global competition.In a report on21st century manufacturing strategy development,the author suggests that various production resources,including people,funds,technology and facilities should be inte-grated and managed as a whole;thus optimising the utilisation of resources and taking full advantage of advanced manufacturing technology,information tech-nology,network technology and computer[1].Agile manufacture based on dynamic alliance is coming into being so that enterprises can remain competitive in a constantly changing business environment and is becoming a main competitive paradigm in the interna-tional market.Agility,which has basically two mean-ings:flexibility and reconfigurability,has become a very important characteristic of a modern manufacturing enterprise.Flexibility is an enterpriseÕs ability to make adjustments according to customersÕneeds.Reconfigu-rability is the ability to meet changing demands[2,3].The ability to quickly respond to marketÕs changes, called agility,has been recognised as a key element in the success and survival of enterprises in todayÕs market.In order to keep up with rapid change,enterprises need to change traditional management in this hot competition. Through dynamic alliance,enterprises exert predomi-nance themselves,cooperate faithfully with each other, and compete jointly so as to meet the needs of the fluctuating market,andfinally achieve the goal of win-win[2,3].So how to improve agility in the supply chain, namelyflexibility and reconfigurability,is one of the important factors to win against the competition.Supply chain management(SCM)is an approach to satisfy the demands of customers for products and ser-vices via integrated management in the whole business process from raw material procurement to the product or service delivery to customers.In[4],M.S.Fox et al. describe the goals and architecture of integrated supply chain management system(ISCM).In this system,each agent performs one or more supply chain management functions,and coordinates its decisions with other rele-vant agents.ISCM provides an approach to the real timeInt J Adv Manuf Technol(2004)23:197–203 DOI10.1007/s00170-003-1626-xP.Lou(&)ÆZ.ZhouRoom107,D8Engineering Research Center of Numerical Control System,School of Mechanical Science&Engineering, Huazhong University of Science&Technology, 430074Wuhan,Hubei,P.R.ChinaE-mail:louping_98@Y.-P.ChenÆW.AiSchool of Mechanical Science and Engineering, Huazhong University of Science and Technology, 430074Wuhan,Hubei,P.R.Chinaperformance of supply chain function.The integration of multi-agent technology and constraint network for solving the supply chain management problem is pro-posed[6].In[7],Yan et al.develop a multi-agent-based negotiation support system for distributed electric power transmission cost allocation based on the networkflow model and knowledge query&manipulation language (KQML).A KQML based multi-agent coordination language was proposed in[8,9]for distributed and dy-namic supply chain management.However,the coordi-nation mechanisms have not been formally addressed in a multi-agent-based supply chain.In most industries, marketing is becoming more globalised,and the whole business process is being implemented into a complex network of supply chains.Each enterprise or business unit in the SCM represents an independent entity with conflicting and competing product requirements and may possess localised information relevant to their interests.Being aware of this independence,enterprises are regarded as autonomous agents that can decide how to deploy resources under their control to serve their interests.This paperfirst introduces concepts and characteris-tics of agile supply chains and emphasises the impor-tance of coordination in supply chain.Then,it presents an architecture of agile supply chain based on a multi-agent theory and states the agentsÕfunctions and responsibilities.Finally,it presents a CBR contract net protocol for coordination and the correlative algorithm for task allocation in multi-agent-based agile supply chains.2Agile supply chainA supply chain is a network from the topologic structure which is composed of autonomous or semi-autonomous enterprises.The enterprises all work together for pro-curement,production,delivery,and so on[10].There is a main enterprise in the supply chain that is responsible for configuring the supply chain according to the de-mand information and for achieving supply chain value using fundflow,materialflow and informationflow as mediums.There are three discontinuous buffers to make the materialflowfluently and satisfy the change in the demand.On the one hand,as every enterprise manages inventory independently,plenty of funds are wasted.As the demand information moves up-stream,the forecast is inaccurate and the respond to the change in demand is slow[11].Accordingly,the key method for competi-tiveness is improving and optimising supply chain management to achieve integrated,automated,and agile supply chain management and to cut costs in the supply chain.To optimise supply chain management and coordi-nate the processes for materialflow,fundflow and informationflow,it is necessary to make materialflow fluent,quickly fund turnover and keep information integrated.Prompt reconfiguration and coordination is an important characteristic of agile supply chain according to dynamic alliance compositing and de-compositing(enterprise reconfiguration).Agile supply chain management can improve enterprise reconfiguring agility.The agile supply chain breaks through the tra-ditional line-style organizational structure.With net-work technology an enterprise group is formed by a cooperative relationship which includes an enterprise business centre,a production design centre,a supplier,a distribution centre,a bank,a decision-making centre, etc.It reduces the lead time to the market to satisfy customer demand.Agile supply chain without temporal and spatial limits promptly expands the enterprise scale,marketing share and resource by allied enterprise.So,a key factor of the agile supply chain is to integrate heterogeneous information systems adopted in various enterprises.The integration information system can provide marketing information and supplier details.Feasible inventory, quantity and cycle of replenished stock,delivery,etc.is designed using the shared information.It is evident that agile supply chain is a typical distributed system.A multi-agent system(MAS)which is characterised byflexibility and adaptability is suit-able for an open and dynamic environment.Thus MAS is a good method for agile supply chain man-agement.3The concept of agents and MASSome people define an agent as any piece of software or object which can perform a specific given task.Presently the prevailing opinion is that an agent must exhibit three important general characteristics:autonomy,adapta-tion,and cooperation[8,12,13].Autonomy means that agents have their own agenda of goals and exhibit goal-directed behaviour.Agents are not simply reactive,but can be pro-active and take initiatives as they deem appropriate.Adaptation implies that agents are capable of adapting to the environment,which includes other agents and human users,and can learn from the expe-rience in order to improve themselves in a changing environment.Cooperation and coordination between agents are probably the most important feature of MAS. Unlike those stand-alone agents,agents in a MAS col-laborate with each other to achieve common goals.In other words,these agents share information,knowledge, and tasks among themselves.The intelligence of MAS is not only reflected by the expertise of individual agents but also exhibited by the emerged collective behaviour beyond individual agents.Of course various agents have different functions,but some functions are needed for each agent.A generic structure of agents that includes two parts is presented:agent kernel and function mod-ule.Figure1exhibits the generic structure of agents which is a plug-in model.In Fig.1,the generic agent includes the following components:198The mailbox handles communication between one agent and the other agents.The message handler processes incoming message from the mailbox,orders them according to priority level,and dispatches them to the relevant components of the agent.The coordination engine makes decisions concerning the agent Õs goals,e.g.how they should be pursued,when to abandon them,etc.,and sends the accepted tasks to the planner/scheduler.It is also responsible for coordi-nating the agents Õinteractions with other agents using coordination protocols and strategies.The planner and scheduler plans the agent Õs tasks on the basis of decisions made by the coordination engine and on resources and task specifications available to the agent.If not,a message is sent to the coordination en-gine for finding extra resources.The blackboard provides a shared work area for exchanging information,data,and knowledge among function modules.Every function module is an inde-pendent entity.These function modules execute con-currently by the control of planner/scheduler and collaborate through the blackboard.The acquaintance database describes one agent Õs relationships with other agents in the society,and its beliefs about the capabilities of those agents.The coor-dination engine uses information contained in this database when making collaborative arrangements with other agents.The resource database reserves a list of resources (referred to in this paper as facts)that are owned by and available to the agent.The resource database also sup-ports a direct interface to external systems,which allows the interface to dynamically link and utilise a proprie-tary database.The ontology database stores the logical definition of each fact type—its legal attributes,the range of legal values for each attribute,any constraints betweenattribute values,and any relationship between the attributes of that fact and other facts.The task/plan database provides logical descriptions of planning operators (or tasks)known to the agent.4Multi-agent-based agile supply chain management Multi-agent-based agile supply chain management per-forms many functions in a tightly coordinated manner.Agents organise supply chain networks dynamically by coordination according to a changing environment,e.g.exchange rates go up and down unpredictably,customers change or cancel orders,materials do not arrive on time,production facilities fail,etc.[2,14].Each agent performs one or more supply chain functions independently,and each coordinates his action with other agents.Figure 2provides the architecture of multi-agent-based agile supply chains.There are two types of agents:functional agents and mediator agents.Functional agents plan and/or control activities in the supply chain.Mediator agents play a system coordinator role s by promoting coopera-tion among agents and providing message services.Mediator agents dispatch the tasks to the functional agents or other mediator agents,and then those func-tional or mediator agents complete the tasks by coordi-nation.All functional agents coordinate with each other to achieve the goals assigned by mediator agents.The mediator-mediator and mediator-agent communication is asynchronous,and the communication mode can be point-to-point (between two agents),broadcast (one to all agents),or multicast (to a selected group of agents).Messages are formatted in an extended KQML format.The architecture is characterised by organizational hier-archy and team spirit,simplifying the organisational architecture and reducing the time needed to fulfil the task.The rest of this section briefly describes each of the mediator agents underdevelopment.Fig.1Generic structures of agents199–Customer mediator agent:This agent is responsible for acquiring orders from customers,negotiating with customers about prices,due dates,technical advisory,etc.,and handling customer requests for modifying or cancelling respective orders,then sending the order information to a scheduling mediator agent.If a customer request needs to be re-designed,the infor-mation is sent to a design mediator agent,then to a scheduling mediator agent.–Scheduling mediator agent:This agent is responsible for scheduling and re-scheduling activities in the fac-tory,exploring hypothetical ‘‘what-if’’scenarios for potential new orders,and generating schedules that are sent to the production mediator agent and logis-tics mediator agent.The scheduling agent also acts as a coordinator when infeasible situations arise.It has the capability to explore tradeoffs among the various constraints and goals that exit in the plant.–Logistics mediator agent:This agent is responsible for coordinating multi-plans,multiple-supplier,and the multiple-distribution centre domain of the enterprise to achieve the best possible results in terms of supply chain goals,which include on-time delivery,cost minimisation,etc.It manages the movement of products or materials across the supply chain from the supplier of raw materials to the finished product customer.–Production mediator agent:This agent performs the order release and real-time floor control functions as directed by the scheduling mediator agent.It monitors production operation and facilities.If the production operation is abnormal or a machine breaks down,this agent re-arranges the task or re-schedules with the scheduling mediator agent.–Transportation mediator agent:This agent is responsible for the assignment and scheduling of transportation resources in order to satisfy inter-plant movement specified by the logistics mediator agent.It is able to take into account a variety oftransportation assets and transportation routes in the construction of its schedules.The goal is to send the right materials on time to the right location as assigned by the logistics mediator agent.–Inventory mediator agent:There are three invento-ries at the manufacturing site:raw product inven-tory,work-in-process inventory,and finished product inventory.This agent is responsible for managing these inventories to satisfy production requirements.–Supplier mediator agent:This agent is responsible for managing supplier information and choosing suppli-ers based on requests in the production process.–Design mediator agent:This agent is responsible for developing new goods and for sending the relevant information to the scheduling mediator agent for scheduling,as well as to the customer mediator agent for providing technological advice.5Coordination in a multi-agent-based agile supply chainCoordination has been defined as the process of man-aging dependencies between activities [15].One impor-tant characteristic of an agile supply chain is the ability to reconfigure quickly according to change in the envi-ronment.In order to operate efficiently,functional entities in the supply chain must work in a tightly coordinated manner.The supply chain works as a net-work of cooperating agents,in which each performs one or more supply chain functions,and each coordinates its action with that of other agents [5].Correspondingly,a SCMS transforms to a MAS.In this MAS,agents may join the system and leave it according to coordinating processes.With coordination among agents,this MAS achieves the goal of ‘‘the right products in the right quantities (at the right location)at the right moment at minimalcost’’.Fig.2An architecture of multi-agent based agile supply chain management2005.1Contract net protocol combined withcase-based reasoningThe contract net is a negotiation protocol(CNP)pro-posed by Smith[15].In the CNP,every agent is regarded as a node,such as a manager or a contractor.The manager agent(MA)is responsible for decomposing, announcing,and allocating the task and contractor agent(CA)is responsible for performing the task.This protocol has been widely used for multi-agent negotia-tion,but it is inefficient.For this reason,contract net protocol is combined with case-based reasoning(CBR).In case-based reasoning(CBR),the target case is defined as problem or instance which is currently being faced,and the base case is problem or instance in the database.CBR searches the base case in the database under the direction of the target case,and then the base case instructs the target case to solve the problem.This method is efficient.But at the very beginning,it is very difficult to set up a database which includes all problems solving cases.The cases may be depicted as follows:C¼\task;MA;taskÀconstraint;agentÀset> Here,MA is task manager.Task-constraint repre-sents various constraint conditions for performing the task,depicted as a vector{c1,c2,c3,...,c m}.Agent-set is a set of performing the task as defined below:Agent set¼\sub task i;agent id;cost;time;resource>f gtask¼[ni¼1sub task iIn the supply chain,the same process in which a certain product moves from the manufacturer to the customer is performed iteratively.So,case-based rea-soning is very efficient.Consequently,combining con-tract net protocol with CBR could avoid high communicating on load,thus promoting efficiency.The process can be depicted as follows(Fig.3).5.2The algorithm for task allocation baseon CBR contract net protocolThere are two types of agents in the supply chain, cooperative and self-interested agents.Cooperative agents attempt to maximise social welfare,which is the sum of the agents utilities.They are willing to take individual losses in service of the good of the society of agents.For example,function agents come from the same enterprise.In truth,the task allocation among cooperative agents is combinational optimisation prob-lem.Self-interested agents seek to maximise their own profit without caring about the others.In such a case,an agent is willing to do other agentsÕtasks only for com-pensation[16].Function agents,for example,come from different enterprises.In the following section the algorithm for task allo-cation among self-interested agents based on CBR contract net protocol will be addressed.Before describ-ing the algorithm,there are some definitions that must be clarified:Task—A task which is performed by one agent or several agents together:T=<task,reward,con-straints>,where task is the set of tasks(task={t1,t2,..., t m}),reward is the payoffto the agents that perform the task(reward={r1,r2,...,r m}),and constraints refer to the bounded condition for performing the task(con-straints={c1,c2,...,c n}).Agent coalition(AC)—A group of agents that per-form task T,described as a set AC={agent i,i=1,2,...,n}.Efficiency of agent—Efficiency of an agent i is de-scribed as follows:E i¼rewardÀcostðÞ=costð1Þwhere reward is the payoffto the agent performing task T,and cost refers to that spend on performing the task. If agent i is not awarded the task,then E i=0.Efficiency of agent coalition—E coalition¼rewardÀX micost iÀh!,X micost iþh!ð2Þwhere reward is the payoffof the agent coalition per-forming task T;cost i refers to that spend on performing task t i;and h is the expense on forming coalition,which is shared by the members of the coalition.If the coalition is not awarded task T,then E coalition<=0.6Algorithm:1.After MA accepts the task T=<task,reward,constraint>(task is decomposable),then it searches the database.2.If itfinds a corresponding case,it assigns the task orsubtask to the related agents according to the case, and the process is over3.If no case is found,then the task T is announced toall relevant agents(agent i,i=1,2,...n).4.The relevant agents make bids for the task accord-ing to their own states and capabilities.Thebid Fig.3CBR contract net process201from agent i can be described as follows:Bid i =<agentid i ,T i ,price i ,condition i >,where i ex-presses the bidding agent (i =1,2,...,h );agentid i is the exclusive agent identifier;T i is the task set of agent i Õs fulfilment;price i is the recompense of agent i fulfilling the task T i ;and condition i is the constraint conditions for agent i to fulfil the task T i .5.If [1 i h&T i then the task T can not be performed.Otherwise MA makes a complete combination of the agents,namely to form a number of agent coalitions (or agent sets,amounting to N =2h )1).6.First MA deletes those agent coalitions where no agents are able to satisfy the constraint condition.Next the rest of the coalitions are grouped by the number of agents in coalitions and put into set P (P ={P 1,P 2,...,P h })in order of the minimum re-compense increase of the coalitions,where P i is the set of agent coalitions,including i agents.7.MA puts the first coalition from each group P i(i =1,2,...,h )into set L ,and if L is null then it returns to (10),otherwise it calculates the minimum re-compense of each coalition as follows:Min Pm iprice i ÃT is :t :P h i ¼1T i TP m icondition i constraitThen it searches for the minimal agent coalition AC min from the set L .8.MA sends the AC min to the relevant agents,namely MA requests that these agent fulfil the task to-gether.The relevant agents calculate the E coalition and E i according to Eqs.1and 2.IfE coalition !max miE i ,then all agents in the AC minaccept the proposal to form a coalition to perform the task T together.MA assigns the task to the AC min ,and the process is over.Otherwise it deletes the AC min from P i and returns to (7).9.If the relevant agents accept the task or subtask,then MA assigns the task to them.The process is over.If some agents cannot accept the subtask and the stated time is not attained,then it returns to (3),otherwise it returns to (10).10.The process is terminated (namely the task cannotbe performed).After all processes have been completed,case-based maintenance is required to improve the CBR.Thus efficiency is continuously promoted.6.1An example–A simple instantiation of a supply chain simulation is presented here and the negotiating process among agents is shown.In this supply chain instantiation,thetransportation mediator agent (TMA)has a transporttask T ,in which it has to deliver the finished product to the customer within 15units of time and must pay 1500monetary units for it,that is T =<t ,1500,15>.Four transport companies can perform task T .Each company is an autonomous agent,that is four agents,agent A,agent B,agent C and agent D.So the TMA announces the task T to the four agents.Then the four agents make a bid for the task T as shown in Table 1.–So the four agents can form 24)1coalitions (see Fig.4),which are put into set P .Cooperation between agents in the coalition requires expense and the ex-pense for forming the coalition increases with the growth of in coalition size.This means that expanding the coalition may be non-beneficial.The expense of each agent in forming a coalition h is 100.First,the coalitions in which no agents can satisfy the constraint conditions are deleted from the set P .The rest of the coalitions are grouped by the number of agents in the coalition and ordered according to the recompense of each group that was increased due to the coalition,namely P 1={B},P 2={{A,B},{A,C},{B,C},{A,D},{B,D}},P 3={{A,B,C},{A,B,D},{B,C,D}},P 4={{A,B,C,D}}.Then the cost and efficiency of coalition {B},{A,C}and {A,B,C}are calculated as follows:Price f A ;B g ¼Min ð800x 1þ1200x 2Þs :t :20x 1þ12x 2 15x 1þx 2!1x 1!0:x 2!0Price f A ;B ;C g ¼Min ð800y 1þ1200y 2þ2000y 3Þs :t :20y 1þ12y 2þ5y 3 15y 1þy 2þy 3!1y 1!0:y 2!0;y 3!Fig.4Agent coalition graphTable 1The bids of four agents Agent Id Price Conditions Agent A 80020Agent B 120012Agent C 20005AgentD25003202the following result can be obtained:Price{B}=1200; x1=0.3750,x2=0.6250,Price{A,B}=1050;and y1= 0.3750,y2=0.6250,y3=0.The above result shows that agent B does not attend the coalition{A,B,C},that is both agent B and coalition{A,B}can fulfill the task and satisfy the constraint conditions.According to Eqs.1 and2,E A,E B,E{A,B}:E A=0(because TMA does not assign the task to A.),E B=(1500)1200)/1200=0.25, E{A,B}=(1500)1050)2*100)/(1050+2*100)=0.2can be obtained.Because of E{A,B}<max{E A,E B},agent B does not agree to form a coalition.Therefore,the TMA se-lects agent B to fulfil the task.7ConclusionsIn this paper,the concept and characteristics of agile supply chain management are introduced.Dynamic and quick reconfiguration is one of important characteristics of an agile supply chain and agile supply chain man-agement is one of the key technologies of agile manu-facturing based on dynamic alliances.As agile supply chain is a typical distributed system,and MAS is effi-cient for this task.In the architecture of agile supply chain management, the supply chain is managed by a set of intelligent agents that are responsible for one or more activities.In order to realise the agility of supply chains,coordination amongst agents is very important.Therefore,it can be suggested that contract net protocol should be combined with case-based reasoning to coordinate among agents. Acknowledgement The authors would like to acknowledge the funding support from the National Science Fund Committee (NSFC)of China(Grant No.5991076861).References1.Goldman S,Nagel R,Preiss K(1995)Agile competitors andvirtual organization.Van Nostrsand Reinhold,New York, pp23–32,pp158–1662.Yusuf YY,Sarhadi M,Gunasekaran A(1999)Agile manu-facturing:the drivers,concepts and attributes.Int J Prod Eng 62:33–433.Gunasekaran A(1999)Agile manufacturing:A framework forresearch and development.Int J Prod Eng62:87–1054.Fox MS,Chionglo JF,Barbuceanu M(1992)Integrated chainmanagement system.Technical report,Enterprise Integration Laboratory,University of Toronto5.Shen W,Ulieru M,Norrie DH,Kremer R(1999)Implementingthe internet enabled supply chain through a collaborative agent system.In:Proceedings of agentsÔ99workshop on agent-based decision support for managing the internet-enabled supply-chain,Seattle,pp55–626.Sandholm TW,Lesser VR(1995)On automated contracting inmulti-enterprise manufacturing.Advanced Systems and Tools, Edinburgh,Scotland,pp33–427.Beck JC,Fox MS(1994)Supply chain coordination via medi-ated constraint relaxation.In:Proceedings of thefirst Canadian workshop on distributed artificial intelligence,Banff,Alberta, 15May19948.Chen Y,Peng Y,Finin T,Labrou Y,Cost R,Chu B,Sun R,Willhelm R(1999)A negotiation-based multi-agent system for supply chain management.In:Working notes of the ACM autonomous agents workshop on agent-based decision-support for managing the internet-enabled supply-chain,4:1–79.Wooldridge M,Jennings NR(1995)Intelligent agents:theoryand practice.Knowl Eng Rev10(2):115–15210.Barbuceanu M,Fox MS(1997)The design of a coordinationlanguage for multi-agent systems.In:Muller JP,Wooldridge MJ,Jennings NR(eds)Intelligent agent III:agents theories, architecture and languanges(Lecture notes in artificial intelligence),Springer,Berlin Heidelberg New York,pp341–35711.Hal L,Padmanabhan V,Whang S(1997)The Bullwhip effect insupply chains.Sloan Manag Rev38(4):93–10212.Yung S,Yang C(1999)A new approach to solve supply chainmanagement problem by integrating multi-agent technology and constraint network.HICASS-3213.Yan Y,Yen J,Bui T(2000)A multi-agent based negotiationsupport system for distributed transmission cost allocation.HICASS-3314.Nwana H(1996)Software agents:an overview.Knowl Eng Rev11(3):1–4015.Smith RG(1980)Contract net protocol:high-level communi-cation and control in a distributed problem solver.IEEE Trans Comput29(12):1104–111316.Barbuceanu M,Fox MS(1996)Coordinating multiple agentsin the supply chain.In:Proceedings of thefifth workshop on enabling technology for collaborative enterprises(WET ICEÕ96).IEEE Computer Society Press,pp134–14117.Jennings NR,Faratin P,Norman TJ,OÕBrien P,Odgers B(2000)Autonomous agents for business process management.Int J Appl Artif Intell14(2):145–1818.Malone TW,Crowston K(1991)Toward an interdisciplinarytheory of coordination.Center for coordination science tech-nical report120,MIT Sloan School203。
肠杆菌科细菌分布及耐药

肠杆菌科细菌是引起临床感染常见的革兰阴性杆菌,也是造成医院内感染的主要致病菌。
近年来,随着第3代头孢菌素的广泛应用,各种肠杆菌科病原菌的种类与耐药情况已发生变化,造成的感染临床治疗困难。
现对本院2006—2011年临床分离的肠杆菌科细菌的分布及耐药情况进行动态观察和分析,为临床抗菌药物的及时、合理使用提供依据,制定经验治疗方案。
1材料与方法1.1材料1.1.1菌株来源2006年12月至2011年12月本院临床科室送检的各种标本中分离到的肠杆菌科细菌,去除同一患者中同一部位所获重复菌株。
质控菌株为大肠埃希菌(ATCC25922)和肺炎克雷伯菌(ATCC700603)符合《临床检验操作规程》3版[1]。
1.1.2抗菌药物及试剂药敏纸片及琼脂均为杭州天和微生物试剂公司产品。
1.2方法1.2.1标本采集与培养按临床微生物培养操作规范进行标本的采集与培养[2]。
1.2.2细菌鉴定及药敏试验细菌鉴定采用肠杆菌科编码系统,药敏试验采用K-B法,按美国临床和实验室标准化协会(CLSI)规定判断药物敏感性。
1.2.3产超广谱-内酰胺酶(ESBLS)测定:参照NCCLS推荐的纸片扩散表型确定法[3]。
1.3数据处理将结果输入WHONET5.3软件进行分析,同一患者的相同菌株只作1次分析。
2结果2.1肠杆菌科细菌检出情况本院5年间从临床标本中分离661株肠杆菌科细菌,其中产超广谱β-内酰胺酶(ESBLs)阳性株280株,占42.4%。
2007—2011年产ESBLs菌株分布情况见表1。
2.2菌种分布与变迁肠杆菌科细菌的检出率,从2007年的98株到2011年161株,而且主要是大肠埃希菌和肺炎克雷伯菌,见表2。
肠杆菌科细菌分布及耐药分析赵海1,沙迎菁2(1.青铜峡市人民医院检验科,宁夏青铜峡751600;2.青铜峡市妇幼保健所检验科,宁夏青铜峡751600)【摘要】目的动态观察并分析该院临床标本分离的肠杆菌科细菌的分布及耐药情况。
Received Revised

SHUJI NARAZAKI, HIROOMI YAMAMURA, and NORIHIKO YOSHIDA
Department of Computer Science, Kyushu University Fukuoka, 812-81, Japan
2. Communication strategies using partial models of execution
2.1. a model of communication
On distributed systems in which communication cost can not be ignored, agents should select a communication structure. But there is uncertainty about the state of other agents. This is caused by both a limited view of agents and the inherent properties of problems. This makes selecting a proper structure dicult. Thus to avoid useless communication, it is required that agents estimate the current global state of other agents or their environments. Agents in distributed systems can not get the current status of the environment; they can only make an incomplete, partial model of execution. However, making the complete execution model by exchanging local models is not required necessarily, since the exchanging cost becomes very high.1 Thus the utility of communication that determines how agents exchange
轮机词典

轮机词典A 单词及词组音标注释备注Abrasive 有磨蚀的Absolute 绝对的Obsolete作废的,陈旧的Additive 添加剂Adjacent 邻近的Accommodation 住舱Actuate 开动,促使Actuator 驱动器,执行器Aeration 充气,曝气Aerobic 需(好)氧的 Anaerobic厌(不需)氧的Aftermost 最后面的,最靠近船尾的Agitation 搅动Aid 帮助,助手Aid in (doing):有助于Airborne 空运的,飞行的Anchorage 锚地,抛锚;安装,固定Ancillary 辅助的Angular 有角的Annal 一年一次的Anneal 退火T emper回火;harden淬火Alkalinity 碱度,碱性Acidic酸的Alleyway 走廊,胡同Alloy 合金Alongside 停靠alternator 交流发电机Amend 修正,修改Amplifier 放大器Annex 附件,附则Annular 环形的Aperture 孔,洞Apparent 外观上的,显然的Applicable 应用的,使用的Apron 围裙Armature 电枢Articulate 连接Asphaltene 沥青Aspirate 吸入,吸出Assembly* 组件,组装Assembly* 大会,集会Assess 评价,评定Associated 相关的,关联的Concerning:有关的,关于…的,relevant:有关的Assumption 假定,设想,前提Astern 在船尾Atomize 将。
喷成雾状Atomized 雾化的Attachment 连接,固定Attemperator 保温装置,保温器Audit 审计,查账Auxiliary 辅助的Luxurious奢侈的Axial 轴向R adial径向Axis 轴,轴线---------------------- --------------------- ---------------------- -------------------A sealing agent 密封剂Abandon ship drills 弃船演习六长一短Absorbent material 吸附材料Air lock 气塞Ambient temperature 周围温度Animal oil 动物油Vegetable oil植物油Artificial respiration 人工呼吸Associated equipment 相关设备At present 目前Automatic sprinkler 自动喷淋Average voltage 平均值电压Peak voltage峰值电压Axial clearance 天地间隙B ============ ============= ============== ==========Babbitt 巴氏合金Ballard 系缆桩Bareboat 空船的Barrel 桶,套桶Barrier 界限,障碍Battery 蓄电池Bedplate 机座Bellows 波纹管,振动膜盒Beneath 在。
高速铁路移动闭塞和多智能体协调控制文献综述

(1)荀径, 宁滨, 郜春海. 列车追踪运行仿真系统的研究与实现[J]. 北京交通大学学报, 2007, 31(2):34-37.针对CBTC系统的列车运行间隔问题。
分别讨论了固定闭塞、准移动闭塞和移动闭塞三种情况并进行了仿真,得出准移动闭塞下列车追踪间隔时间最短。
(2)康珉. 移动闭塞条件下高速列车追踪运行控制算法研究[D]. 中南大学, 2013.移动闭塞追踪控制算法及存在的问题。
稳定的追踪算法不仅需要保证列车与前方列车不发生碰撞,同时又需要尽量缩短列车之间的距离以求提高线路的利用率。
同时列车在运行的不同区段会受到RBC的控制,如线路的限速条件,岔道口信息,进出站信息等,这使得列车追踪成为了一个带严格约束的控制问题,因此优良的算法需要在满足约束条件的前提下使得列车之间的距离尽可能小。
提出移动闭塞下列车协同控制的思想。
考虑前车和后车目标距离,若前车制动而传给后车出现延迟,则后车可能紧急制动会发生危险。
目前解决这个问题,准移动,不管任何时候,都预留出一个最大的制动区间,就算前车突然制动,也可以停在安全点。
效率低。
如果可以了解整条线路上的列车运行情况,前车和后车。
通过实时通讯来不断地更新运行曲线。
协同控制思想:协同控制是一种能够通过各智能体之间的通讯、合作、互解、协调、调度、管理及控制来表达系统的结构、功能及行为特性的控制策略。
列车之间也需要协同各自的信息和特征,保证各自的速度同时使个体之间保持一定的运行问隔,而协同控制能利用全局的速度信息和位置信息来协调个体与个体之间状态关系,构建了一个多列车网络拓扑图。
(3)07年会议——Peng L , Yingmin J , Junping D , et al. Distributed Consensus Control for Second-Order Agents with Fixed Topology and Time-Delay[C]// 中国控制会议. 2007.(4)崔艳, 贾英民. 具有时滞的二阶多智能体系统的一致性分析[J]. 计算机仿真, 2011, 28(7).非零时滞的二阶多智能体系统,通过频域分析法得到系统达到一致的充分必要条件。
getresources

getResourcesIntroductionThe getResources function is an important method in programming that is usedto retrieve or access resources in a software application. This document aims to provide a detailed explanation of the getResources function, its purpose, and itsusage.What is getResources?getResources is a function commonly found in modern programming languages and frameworks. It allows developers to access resources such as images, strings, layout files, color definitions, and more. These resources are an integral part of an application and are used for various purposes, including user interface design, localization, and theming.How does getResources work?The getResources function works by providing a way to reference specificresources within an application. It typically takes a resource identifier or a key as an input parameter and returns the corresponding resource object.The resource identifier can take different forms depending on the programming language or framework being used. For example, in Android development using Java or Kotlin, resource identifiers are integers generated by the Android resource compiler. In web development using HTML and CSS, resource identifiers can be referenced by the id or class attributes.The getResources function uses these identifiers to locate and retrieve theappropriate resource object from a predefined resource directory or file. The function abstracts the details of accessing and retrieving resources, providing a convenient and standardized way for developers to obtain the resources they need.Common use casesThe getResources function plays a vital role in various scenarios withinsoftware development. Some of the most common use cases include:1. User interface designIn user interface design, resources such as images, strings, and layout files are often required to create visually appealing and interactive interfaces. The getResources function allows developers to access these resources easily.For example, when building a mobile app, the getResources function can be used to retrieve the app’s logo image and display it on the screen. Similarly, it can retrieve localized strings for different languages to display appropriate text based on the user’s locale.2. LocalizationLocalization is the process of adapting an application to different languages and regions. The getResources function is used extensively in this process to retrieve language-specific resources.For instance, in a multilingual app, the getResources function can be used to fetch translated strings, labels, or error messages based on the user’s language preference. This provides a seamless experience for users, regardless of their language.3. ThemingTheming involves customizing the appearance and style of an application. The getResources function is instrumental in retrieving resources related to color definitions, icons, and other theme-specific elements.For example, in a web application, the getResources function can be utilized to retrieve the color palette defined in a CSS file, enabling the application to dynamically update its visual style based on the selected theme.Best practicesTo make the most out of the getResources function, it is essential to follow some best practices:1. Resource managementEnsure that resources are managed efficiently, avoiding unnecessary duplication or excessive use of resources. Leverage caching mechanisms or resource pooling, if available, to optimize resource retrieval.2. Error handlingHandle potential errors or exceptions that may occur during resource retrieval. Gracefully handle cases where a requested resource is not found or unavailable, and provide fallback options or appropriate error messages.3. Resource naming conventionsAdopt consistent naming conventions for resources to maintain clarity and organization. Use meaningful names and avoid generic terms to facilitate easier identification and retrieval.4. Resource versioningIf resources are subject to frequent updates or changes, consider implementing versioning mechanisms to ensure compatibility and consistency across multiple versions of an application.ConclusionThe getResources function is a powerful tool that simplifies the process of retrieving resources within a software application. It facilitates user interface design, localization, and theming, making it an essential function in modern software development. By understanding how to effectively use getResources and following best practices, developers can efficiently access and utilize resources for an enhanced user experience.。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Enabling Mobile Agents to Dynamically Assume Roles Giacomo Cabri, Luca Ferrari, Letizia LeonardiDipartimento di Ingegneria dell’Informazione – Università di Modena e Reggio EmiliaVia Vignolese, 905 – 41100 Modena – ITALYE-mail: {giacomo.cabri, luca.ferrari, letizia.leonardi}@unimo.itABSTRACTAgent-based application development must face the issues related to the interactions among agents. In fact, their sociality allows decomposing large applications into collaborating agents, while open environments, such as the Internet, require agents belonging to different applications to compete to gain resources. In the BRAIN framework, interactions among agents are fruitfully modeled and implemented on the basis of roles. This approach achieves several advantages, from separation of concerns between the algorithmic issues and the interaction issues, to the reuse of solutions and experiences in different applications. In this paper we propose a mechanism to enable Java agents to dynamically assume roles at runtime. Our approach is based on the modification of the bytecode of Java agents, in order to implement an appropriate interface and to add the related methods. An application example and the comparison with other approaches show the effectiveness of our approach.1. INTRODUCTIONInteractions among agents are an important issue to be taken into consideration in the development of agent-based applications. The BRAIN (Behavioural Roles for Agent INteractions) framework [3] proposes an approach to agent interactions based on the concept of role. There are different advantages in modeling interactions by roles and, consequently, in exploiting derived infrastructures. First, it enables a separation of concerns between the algorithmic issues and the interaction issues in developing agent-based applications. Second, it permits the reuse of solutions and experiences; in fact, roles are related to an application scenario, and designers can exploit roles previously defined for similar applications; for instance, roles can be exploited to easily build agent-oriented interfaces of Internet sites [4]. Third, roles can also be seen as a sort of design patterns [1]: a set of related roles along with the definition of the way they interact can be considered as a solution to a well-defined problem, and reused in different similar situations. Finally, it promotes locality in interactions, since each local interaction context can define the allowed roles and rule the interactions among them. Exploiting the role advantages, the BRAIN framework aims at covering the agent-based application development in different phases, and provides for (i) a model of interactions based on roles, (ii) an XML-based notation to describe the roles, and (iii) interaction infrastructures based on the previous model and notation, which enable agents to assume roles.In this paper, we propose an implementation of an interaction infrastructure for the BRAIN framework, thanks which mobile agents can dynamically assume roles. In particular, we focus on the mechanisms that enable such dynamic assumption of roles by mobile agents. In open and dynamic environments, for instance the Internet or the pervasive computing based ones [15], the agent capability of dynamically assuming a role at runtime can grant a high degree of adaptability to runtime situations and also permit to suit unexpected situations. We can find an example of dynamic assumption of a role in the film The Matrix, where the female character dynamically downloads the role of “helicopter driver” to escape; in that case, the dynamic assumption of features is vital in order to run away from a dangerous situation. This is clearly fiction, but it gives an idea of what we want to do in the agent world, where the dynamic assumption of roles can also be useful; for instance, think at an agent that has to obtain a resource, and at runtime it discovers that such resource is on sale by an auction: it can dynamically assume the role of bidder and interact with agents playing the role of seller or auctioneer. Of course, such dynamic assumption is not trivial, because agent developers hardly deal with runtime situations, especially if they require a dynamic modification of the agents. Moreover, the dynamic assumption of roles involves several issues related to the exploited programming language, the intelligence of the agents, and the knowledge needed to assume a new role. To our purposes, we propose an implementation of an infrastructure where the code of the mobile agents is modified at runtime, adding the features related to the role they are going to assume. In addition, a mechanism to search for roles is exploited to further uncouple agents and roles. We take into consideration agents implemented in Java, for two main reasons: (i) Java is the most exploited language to implement (mobile) agent platforms, thank to its portability, security, and network-orientedness; and (ii) the fact that Java relies on an intermediate bytecode allows us to modify it (respecting the security constrains) to add new functionalities. 2. THE BRAIN FRAMEWORKThe BRAIN framework [3] is based on the concept of role and aims at covering the agent-based application development at different phases. To this purpose, it provides for a model of interactions that is based on roles, an XML-based notation to describe the roles, and infrastructures based on the previous model and relying on the previous notation, which support agents in the management of roles (see Figure 1).In BRAIN, a role is defined as a set of capabilities and an expected behavior [6]. The former is a set of actions that an agent playing such role can perform to achieve its task. The latter is a set of events that an agent is expected to manage in order toPermission to make digital or hard copies of all or part this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage, and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee.SAC 2003, Melbourne, Florida, USA© 2003 ACM 1-58113-624-2/03/03...$5.00“behave” as requested by the role it plays. Interactions among agents are then represented by couples (action, event), which are dealt with by the underlying interaction system, which has to be part of the BRAIN infrastructures; the interaction system can control interactions and enforce local policies, such as allowing or denying interactions between agents playing given roles. Figure 2 shows how an interaction between two agents occurs: when an agent performs an action among the capabilities of the assumed role, such action is translated into an event by the interaction system, and the event is delivered to the addressee agent. This model of interactions is very simple and very general, and well suits the main features of the agents: the actions can be seen as the concrete representation of proactiveness (i.e., the capability of carrying out their goals), while the events reify the reactivity (i.e., the capability of reacting to environment changes).Figure 1. The BRAIN frameworkThe notation proposed by BRAIN, called XRole [5], enables the definition of roles by means of XML documents; this grants interoperability and allows different representations tailored on the needs of the different phases of the application development. It is worth noting that each different representation derives from the same information, so the different phases of the development of applications relies on the same information, granting continuity during the entire development. For instance, during the analysis phase, analysts create XRole documents following a specific XML Schema [5], which guides them in the definition of the role features. These XRole documents can be translated into HTML documents to provide high-level descriptions also for further uses. In the design phase, the same XRole documents can be translated into more detailed HTML documents to suggest functionalities of the involved entities. Finally, at the implementation phase, again the same XRole documents can be exploited to obtain Java classes that implement the role properties.Figure 2. The interaction model in BRAINWe have already implemented an infrastructure in BRAIN, called Rolesystem [7], which relies on abstract classes that represent roles. In that approach, an agent can register itself in the local interaction context with a particular role, and then can perform actions and manage events provided by the abstract class corresponding to the assumed role. Such infrastructure provides a degree of uncoupling between agents and roles. However, it does not enable agents to dynamically assume roles at runtime, and allows agents to directly access the role classes, introducing some possible inconsistencies. This paper describes a new infrastructure that aims at overcoming the mentioned limitations.3. DYNAMIC ROLE ASSUMPTIONTo help us explaining the new-implemented role infrastructure, we propose a conference as an example. Let us suppose that two kinds of persons attend the conference: the listeners and the speakers, which are the roles played by the attendees in a conference context. For simplicity’s sake, let us suppose that only one speaker can talk at a time, so that all the other attendees are listeners. During the conference, as soon as the speaker has finished her speech, she lets another person talk. This person, who was a listener before, now becomes a speaker: this means that she assumes the speaker role. Of course, with this role she can perform speaker actions such as talking to microphone, showing slides, etc. By examining better the situation, we can point that (i) she has added to herself speaker capabilities and behavior, (ii) this addition has occurred dynamically, and (iii) she is recognized by other people as playing the speaker role.Let us suppose that software agents, which assume roles corresponding to that of their owners, support people attending the conference. The agent that assumes a speaker role (but it is the same for the listener role) must be provided with the appropriate capabilities and this should be made at runtime, when the capabilities are needed. In the following we explain how our approach enables the addition at runtime of members (fields and methods) to Java classes that implement agents, thus allowing the dynamic assumption of roles.3.1 Role, Action and Event DescriptorsMobile agents can roam networks to carry out their tasks in the most appropriate site. When an agent decides to play a role needed for its purpose, it asks the local infrastructure which roles are available, chooses the one(s) that better suits its needs, and then assumes it (by the mechanism explained in the following). When the role is not needed, it can be discarded. To grant a high level of abstraction in the decision process, we propose descriptors for roles, actions and events. A descriptor is an object that describes a role, an action or an event, for example with some keywords, an aim, a version, a creation date and any further needed piece of information. A role descriptor describes what such role does but not how (with which operations) it is done. The action descriptors are exploited to associate specific methods to operations. Event descriptors tell the kind and the context of the occurred event, but not how to manage it (which is left to the agent). A role descriptor includes also the descriptors of the corresponding actions and events.Using descriptors, the agent programmer does not need to know which is the physical class that implements a role, but only the descriptor of the role to be searched for. For example, if the agent must assume the speaker role, the programmer can write code that searches not directly for a speaker role but for a role with a speaker description. The agent can further verify the retrieved descriptor(s) to be sure that the role is the right for it.Roles are described in XML exploiting the XRole notation of BRAIN. From these XML documents, we can derive the code of Java classes that concretely implement descriptors.The descriptors are useful also for hiding to the agent the physical location of the role implementation, allowing agent programmers to disregard about the work of role programmers, and viceversa, because the role behavior is described in a separate way.3.2 Adding Roles to AgentsWhile the descriptors provide a high-level description of the roles, we need also the corresponding code, which is concretely added to the agents. In our approach the Java code of a role is composed of two parts: a Java interface (called role interface ) and a Java class (called role implementation ).The fact that an agent assumes a role means that the system dynamically adds each role implementation member (both methods and fields) to agent members, in order to add the set of capabilities of the role, thus modifying the agent class bytecode. Moreover, the system forces the agent class to implement the role interface, in order to modify its expected behavior and to allow other agents to recognize it as playing that role (for instance, by means of the instanceof operator). Note that in Java there is no other way to add capabilities and to modify the expected behavior of an agent implemented by an already-defined class. Reconsider the conference example: an agent, to assume the role of listener , should inherit from two different classes, the listener role class and the base agent class such as Aglet of the IBM Aglets platform [13]. Since Java does not allow multiple inheritance, we can only force the expected behavior by means of the interfacedatabaseOriginal agentManipulatedagentFigure 3. The steps performed by an agent to assume a role To implement the dynamic role assumption, our system is based on a special class loader, called “role loader”, that could change agent behavior and external appearance. The idea is simple: an agent that wants to assume a new role, after querying the role descriptor database if necessary, asks the role loader to reload itself with the new role (see Figure 3). If everything is right, the role loader sends the agent an event to indicate that the agent has been reloaded. After the reload event the agent can resume its execution. If the role loader is unable to load the role, it throws an exception that the original agent can catch. Analyzing this exception the agent can decide what to do (for example to retry or to choose another role). To release a role, the process is the same, but this time the agent is reloaded without that role.The role loader performs bytecode manipulation to add the role to the agent. This manipulation is completely made in memory without recompilation. The manipulation is needed to work with and to modify class definitions. Note that this manipulation is not dangerous for code portability and is compliant with the Java security manager.Our implementation of role loader is based on Javassist bytecode manipulation engine [14]. The addition of the role’s members to the agent class is performed in the following steps (suppose that the agent has yet contacted the role loader):1. the role loader calculates the inheritance stack for the role (i.e., the superclasses of the role class);2. for each level of the inheritance stack, the role loader copies all the members (both methods and fields) from the role implementation to the agent; then the loader adds the role interface to the implemented interface list of the agent;3. each field value is copied into the agent so that it does not loose its current state.Figure 4. Member copy from role classes to agent classes The first step is needed to grant role-inherited properties. In fact, a role could be not a single class but the bottom (or the middle) of an inheritance chain. For example the role listener could inherit properties from the role participant . To grant that the role will work in the right way, every role superclass (that is every class at any level on the role inheritance chain) must be added to the agent classes at the corresponding level. In fact, a subclass role implementation expects to find some capabilities on its superclasses, so we must grant that this condition will remain true. To better explain this concept, we refer to Figure 4. The figure shows the inheritance chains of an agent and its role, where the role chain is lesser than the agent one. Both the role and the agent are represented by the bottom of their respective chain. This means that the bottom classes must be fused. At the superclass level the same must occur, that is the superclasses must be fused also. This must be done for each chain level. In this way our system grants that both the role and the agent, after the fusion, will continue using inherited properties; in other words, the Java’s super operator will work well. The case in which the role inheritance chain have more levels than the agent’s one is a bit more complex, but is taken into account in our implementation; the adopted solutions are not reported due to space limitations. This step does not do anything except calculate the inheritance stack, that is how a role class and an agent class must be fused and at what level.Referring to Figure 4, the computed stack is reported in Table 1; note that the root class ng.Object is kept in only one chain. Every row in the stack indicates which classes will be fused into one. Something similar is made to force the class to implement (in the Java sense) the role interface. The inheritance stack will be used in the second step to know from which class members will be copied (fuse) on the agent chain.In fact, the second step does this copy consulting the inheritance stack and then copying every member from the role chain into the agent chain on the classes of the same level. Only this step uses the bytecode manipulation that allows the system to modify the class definitions. Note that no members are removed from original agent. In our implementation only adding mechanism is provided and this grant a correct execution to the agent.At the end, in the last step, every value is copied from the original agent (and its superclasses) to the new created agent. This step grants that the agent state will not be lost during the reloading process.Table 1. The class stack calculated by the role loaderAgent inheritance chain Role inheritance chain ng.Object none … … agent superclass level 3 none agent superclass level 2 role superclass level2agent superclass level 1 role superclass level 1agent role implementation 3.3 Role Use by AgentsIn this subsection we explain how an agent can use a dynamicallyassumed role, i.e., how it can invoke a method that before roleassumption it did not have and after it has. Note that this issue is essential because we must grant to the programmers the capability of correctly compiling the agent code. In fact, the programmer does not know anything about the role implementation but know, indirectly, about which actions can be used, by the actiondescriptors, and about which events can occur, by the eventdescriptors. In the following, we focus on the action use, becausethe management of the events is similar and simpler.The use of descriptors means that the programmer cannot write code that invokes methods corresponding to role actions in the usual way, because, since the agent has not those methods yet, a compile-time error will occur. Therefore, there must be an invocation translator that can do introspection on the agent to dynamically find which method must be call to response to an invocation on an action description. When the agent invokes a role action, it specifies to the invocation translator a descriptor of the action that wants to perform, the translator searches for a method that corresponds to the description and then invokes it. Note that the invocation translator is a component of the agent. This is not a trouble for mobile agents because the invocation translator is a very small module that does not affect agent weight for movements.4. COMPARISON WITH OTHER APPROACHESThis section reports the comparison of our approach with other ones. The former subsection shows a possible implementation with the Aspect Oriented Programming approach. The latter subsection reports some approaches based on the concept of role.4.1 Aspect-Oriented ApproachEven if it has not been designed in connection with roles, Aspect Oriented Programming (AOP) seems to provide interesting mechanisms to support the management of roles for agents [8, 11]. AOP starts from the consideration that there are behaviors and functionalities that are orthogonal to the algorithmic parts of the objects [12]. So, it proposes the separate definition ofcomponents and aspects , to be joined together by an appropriate compiler (the Aspect Weaver ), which produces the final program. The separation of concerns introduced by AOP permits to distinguish the algorithmic issues from the behavioral issues. Since an aspect is a property that cannot be encapsulated in a stand-alone entity, but rather affects the behavior of components, it is evident the similarity with a role.public class MyAgent{ // intrinsic members of the class private String question; ... }____________________________________________________________ aspect Listener extends Role{ ... // introduce extrinsic member to Agentintroduce public void MyAgent.askSlides() {}// advise weaves impact extrinsic membersadvise public void MyAgent. askSlides() {// code of the asking action} ... }____________________________________________________________ ... // Java code to instantiate MyAgent and Listener// and to attach ag to the aspectMyAgent ag = new MyAgent("Bob"); Listener listenerAspect = new Listener(); listenerAspect.addObject(ag); // ag asks for slidesag.askSlides(); ... Figure 5. The listener agent in the AOP approach Figure 5 reports an example of use of AOP in our application. TheListener aspect implements the listener role, and provides theappropriate methods that are embodied in the agent code by the Aspect Weaver; for instance, in the Figure they are added to the ag instance of the class MyAgent .Even if the AOP approach is similar to ours, in our opinion it has some limitations:o First, the role/aspect must known the class which is going to modify, for instance, in the Figure the aspect Listener must known the MyAgent class to add the appropriate methods.o As a consequence of the first point, this approach lacks flexibility in the definition and usage of aspects, and this is due to the fact that AOP focuses on software development rather than addressing the issues of dynamic and wide-open environments, such as the ones considered in the BRAIN project. o Finally, interoperability among agents of different applications is hard to be achieved, since this approach does not provide an adequate uncoupling of roles from agents.As a last note, not bound to the implementation, we can say that AOP does not provide a support for the designer as effective as the one provided by XRole, our XML-based notation that allows a richer and more understandable description of the roles and the possibility of formatting appropriate presentations of roles in an easy way.4.2 Other Role-based Proposals for AgentsE. Kendall well describes the importance of modeling roles for agent systems [11], and she exploits the AOP to concretely implement the concept of role in agent applications. Anotherinteresting approach is AALAADIN [10], a meta-model to define models of organizations. It is based on three core concepts: agent, group and role. The ROPE project [2] addressing the collaboration issues and recognizes the importance of defining roles as first-class entities, which can be assumed dynamically by agents. Yu and Schmid [16] exploit roles assigned to agents to manage workflow processes. They traditionally model a role as a collection of rights (activities an agent is permitted on a set of resources) and duties (activities an agent must perform). An interesting issue of this approach is that it aims to cover different phases of the application development, proposing a role-based analysis phase, an agent-oriented design phase, and an agent-oriented implementation phase. Finally, the idea of separating the agent issues from the actual execution of jobs can be found in the PaCMAn proposal [9], where Java agents delegate the execution of their jobs to external and site-dependent objects.Differently from ours, these approaches do not support the application development during all its phases, and disregard the dynamic assumption of roles at runtime.5. CONCLUSIONSThis paper has presented the implementation of mechanisms to enable the dynamic assumption of roles by Java agents at runtime. This is achieved by modifying the bytecode of the agents, adding the features of the role(s) they want to play.In addition to the advantages deriving from a role-based approach, the specific ones of our system can be summarized as follows:o It enables agents to dynamically assume roles at runtime, granting flexibility and adaptability. Roles are not simply given to the agents, but agents are modified at code level to embody all the features of the dynamically assumed roles.The use of descriptors decouples the role assumption, improves security, and enables role composition.o It grants a high degree of role reusability, because it deals not only with the classes of agents and roles, but also with their whole inheritance chains.o It allows separation of concerns between agent issues and role issues, also allowing roles and agents to be implemented separately and joint at runtime, avoiding that agent programmers need to know role details and viceversa.As a final note, we stress that the choice of a programming language that allows multiple inheritance, such as C++, would have simplified the effort to fuse two classes, but would not have gained the advantages of the Java language (which imposes single inheritance), in terms of portability and compliance with the existing mobile agent platforms.ACKNOWLEDGMENTS: Work supported by the NOKIA Research Center of Boston, by the Italian MURST within the project “MUSIQUE - Multimedia Ubiquitous Service Infrastructure in a QoS Universal Environment” and by the Italian Research Council (CNR) within the project “Mobile software agents to enable access to multimedia services by mobile users and devices”.6. REFERENCES[1] Y. Aridor, D. Lange, “Agent Design Pattern: Elements ofAgent Application design”, International Conference onAutonomous Agents, ACM Press, 1998. [2] M. Becht, T. Gurzki, J. Klarmann, M. Muscholl, “ROPE:Role Oriented Programming Environment for MultiagentSystems”, Fourth IFCIS Conference on CooperativeInformation Systems, Edinburgh (UK), September 1999.[3] The BRAIN project, http://agentgroup.unimo.it/MOON/BRAIN/index.html[4] G. Cabri, “Role-based Infrastructures for Agents”, 8th IEEEWorkshop on Future Trends of Distributed ComputingSystems, Bologna (I), October 2001[5] G. Cabri, L. Leonardi, F. Zambonelli, “XRole: XML Rolesfor Agent Interaction”, 3rd International Symposium “FromAgent Theory to Agent Implementation”, at the 16thEMCSR, Vienna (A), April 2002.[6] G. Cabri, L. Leonardi, F. Zambonelli, “Modeling Role-based Interactions for Agents”, Workshop on Agent-oriented methodologies at OOPSLA 2002, Seattle (USA),November 2002.[7] G. Cabri, L. Leonardi, F. Zambonelli, “Implementing Role-based Interactions for Internet Agents”, 2003 InternationalSymposium on Applications and the Internet, Orlando(USA), January 2003.[8] Communication of the ACM, Special Issue on AspectOriented Programming, Vol. 33, No. 10, October 2001.[9] P. Evripidou, C. Panayiotou, G. Samaras, E. Pitoura, “ThePaCMAn Metacomputer: Parallel Computing with JavaMobile Agents”, Future Generation Computer SystemsJournal, Special Issue on Java in High PerformanceComputing, Vol. 18, No. 2, pp. 265-280, October 2001. [10] J. Ferber and O. Gutknecht, “AALAADIN: A meta-modelfor the analysis and design of organizations in multi-agentsystems”, Third International Conference on Multi-AgentSystems (ICMAS'98), 1998.[11] E. A. Kendall, “Role Modeling for Agent Systems Analysis,Design and Implementation”, IEEE Concurrency, Vol. 8,No. 2, pp. 34-41, April-June 2000.[12] G. Kiczales, J. Lamping, A. Mendhekar, C. Maeda, C.Lopes, J. M. Loingtier, J. Irwin, “Aspect-OrientedProgramming”, European Conference on Object-OrientedProgramming (ECOOP), LNCS 1241, Finland, June 1997. [13] D. B. Lange, M. Oshima, “Programming and DeployingJava™ Mobile Agents with Aglets™”, Addison-Wesley,Reading (MA), August 1998.[14] M. Tatsubori, T. Sasaki, S. Chiba, K. Itano, “A BytecodeTranslator for Distributed Execution of "Legacy" JavaSoftware”, ECOOP 2001, LNCS 2072, 2001.[15] M. Weiser, “Hot Topics: Ubiquitous Computing”, IEEEComputer, Vol. 26, No. 10, October 1993.[16] L. Yu, B.F. Schmid, “A conceptual framework for agent-oriented and role-based workflow modeling”, 1stInternational Workshop on Agent-Oriented InformationSystems, G. Wagner and E. Yu eds., Heidelberg (D), June1999.。