36
RoleEP: Role Based Evolutionary Programming for Cooperative Mobile Agent Applicatio ns Naoyasu UBAYASHI Toshiba Corporat ion) Tetsuo TAMAI University of Tokyo PSE2000 (November 1-2, 2000)

RoleEP: Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Embed Size (px)

DESCRIPTION

ISPSE2000 (November 1-2, 2000). RoleEP: Role Based Evolutionary Programming for Cooperative Mobile Agent Applications. Naoyasu UBAYASHI ( Toshiba Corporation) Tetsuo TAMAI ( University of Tokyo ). Agenda. 1. Introduction 2. Problems of constructing cooperative mobile agent applications - PowerPoint PPT Presentation

Citation preview

Page 1: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

RoleEP: Role Based Evolutionary Programmingfor Cooperative Mobile Agent Applications

Naoyasu UBAYASHI ( Toshiba Corporation)

Tetsuo TAMAI ( University of Tokyo )

ISPSE2000 (November 1-2, 2000)

Page 2: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Agenda

1. Introduction

2. Problems of constructing cooperative mobile agent applications

3. RoleEP model

and Java RoleEP Framework

4. Related works

5. Conclusion

Page 3: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Introduction

Page 4: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Background

Recently, cooperative distributed applications based on mobile agent systems are increasing. Using mobile agents, we can developcooperative distributed applications that run over the Internet moreeasily and more flexibly than before.

But, there are problems ...

Page 5: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Problems

• It is difficult to understand collaborations among agents and travels of individual agents as a whole because traveling/collaboration functions come to be intertwined in the code.• It is difficult to define behaviors of agents explicitly because they are influenced by the external context. Agents may change their functions dynamically.

host

agent

traveling function

collaboration function

intertwined!

Page 6: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Goal of this research

This research proposes the concept of RoleEP (Role Based Evolutionary Programming) in order to alleviate the problems mentioned here.

1) RoleEP separates concerns on mobility/collaboration from agent systems.2) RoleEP provides a systematic evolutionary programming style.

TargetsTargets

Page 7: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Problems of constructingcooperative mobile agent applications

~  Traditional approaches  ~

Page 8: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Traditional approaches

1. Orthodox approach2. Design-pattern approach3. AOP approach

Page 9: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

ExampleA distributed information retrieval system (a typical example of cooperative distributed applications based on mobile agent systems)

Page 10: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Viewpoints for estimation

Viewpoints

Separation of concerns 1) roaming around hosts (mobility)2) contract-net protocol (collaboration)

Evolution User proxy agent --- (evolve) ---> Manager agent

Page 11: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Case1: Orthodox approach

A program description maps domain structures to program structures.

ApproachApproach

Page 12: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Description of case1 -- Described in Java

public class UserProxy {

public void roam(){ : dispatch(getNextHostAddress(), "contractNet_start"); }

public void contractNet_start(){ : // broadcasts a task-announcement message // to all agents existing in the host. } public void contractNet_bid(){ : // if all biddings are finished, // selects the best contractor. : best-contractor.award(); } public void contractNet_end(){ : dispatch(getNextHostAddress(), "contractNet_start")}}

Code for roaming around hosts

is mixed with

code for executing the contract-net protocol.

Travelingfunction

Travelingfunction

Contract-netfunction

Page 13: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Estimation of case1

Viewpoints Estimation

Separation of concerns    ×Evolution    ×

It is difficult to understand a program behavior as a whole since traveling/collaboration functions that compose a program are not described separately.

MeritMerit

ProblemProblem

none

EstimationEstimation

Page 14: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Case2: Design-pattern approach

Design patterns for Aglets (Aridor, Y. and Lange, D.B.)

1) Traveling Patterns:Itinerary,Forwarding,Ticket, etc.

2) Task Patterns:Master-Slave, Plan, etc.

3) Collaboration Patterns:Meeting, Locker, Messenger, Facilitator,Organized Group, etc.

Collaborations among agents are structured using design patternsfocused on mobile agents.

ApproachApproach

Page 15: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Description of case2 -- Described in Aglets

public class UserProxy extends Aglets{

public void roam(){ // sets sequential planning itinerary itinerary = new SeqPlanItinerary(this); itinerary.addPlan(HostAddress1, "contractNet_start"); : itinerary.addPlan(HostAddressN, "contractNet_start"); // starts the trip itinerary.startTrip(); }

public void contractNet_start(){ // broadcasts a task-announcement message // to all agents existing in the host. : // waits until contract-net process is finished } public void contractNet_bid(){ // if all biddings are finished, // selects the best contractor. : best-contractor.award(); } public void contractNet_end(){ // saves results of the task execution. : // notifies this agent. }}

Itinerary Pattern

Separated!(within an agent)

Contract-netfunction

Travelingfunction

Page 16: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Estimation of case2

ProblemProblem

MeritMerit

Code for roaming around hosts is separated from code for executing the contract-net protocol.

Separations of traveling/collaboration descriptions are limited only within an agent.

As shown in the program, if a roaming agent wants to behave as a manager at the host machine the agent moves into, functions requested for a manager should be described as methods of the agent !

EstimationEstimation

Viewpoints Estimation

Separation of concerns    △Evolution   ×

Page 17: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Case3: AOP approach (Aspect Oriented Programming)

AOP is a programming paradigm such that a system is divided into a number of aspects and a program is described per aspect. A function that is dispersed among a group of objects is defined as an aspect.A compiler, called weaver, weaves aspects and objects together into a system.

Kendall, E.A. proposed role model designs and implementations with AspectJ that is an aspect-oriented extension to Java.

ApproachApproach

Page 18: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Description of case3 -- Described in Aspect/J

public class UserProxy{ public void roam(){ … }}

aspect Manager extends Role{

// introduces empty behavior // to the class UserProxy introduce public void UserProxy.start(){} introduce public void UserProxy.bid(){} introduce public void UserProxy.end(){}

// advise weaves for aspect instances // that will be attached to an instance // of the class UserProxy advise public void UserProxy.start(){ before{ ... } } advise public void UserProxy.bid(){ before{ ... } } advise public void UserProxy.end(){ before{ ... } }}

public class InfoSearcher{ public void executeTask(){ … }}

aspect Contractor extends Role{

// introduces empty behavior // to the class InfoSearcher introduce public void InfoSearcher.taskAnnounce(){} introduce public void InfoSearcher.award(){}

// advise weaves for aspect instances // that will be attached to an instance // of the class InfoSearcher advise public void InfoSearcher.taskAnnounce(){ before{ ... } } advise public void InfoSearcher.award(){ before{ // calls a method of the class InfoSearcher executeTask();} }}

weaver

program

staticweaving

Travelingfunction

Contract-netfunction

Contract-netfunction

Page 19: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Estimation of case3

Each aspect must be defined per a role. A description that cross-cuts roles may be dispersed in several aspects. Dynamic evolution is not emphasized.

ProblemProblem

MeritMerit

Code for roaming around hosts is separated from code for executing the contract-net protocol completely.

EstimationEstimation

Viewpoints Estimation

Separation of concerns    △Evolution   △

Page 20: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Estimation of traditional approaches (summary)

Approaches Viewpoints(Separation of concerns) (Evolution)

Orthodox approach × ×Design-pattern approach △ ×AOP approach △ △

Page 21: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

RoleEP modeland Java RoleEP Framework

Page 22: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

RoleEP ModelRoleEP is composed of four model constructs -- agents, roles, objects and environments

Traveling/Collaborationfunction

Traveling/Collaborationfunction

Original FunctionOriginal Function

separated

Evolution(object ---> agent)

Evolution(object ---> agent)

Page 23: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Model constructs (1)

Traveling/collaboration functions including tours around hosts and message communications among agents are described byrole attributes and role methods.

EnvironmentEnvironment

A field where a group of mobile agents collaborate with each other.

RoleRole

A function that an agent assumes in a field.

Page 24: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Model constructs (2)

Object, AgentObject, Agent

An object(instance) becomes an agent by binding itself to a role(instance) that is defined in an environment, and acquires functions needed for collaborating with other agents that exist in the same environment.

Binding-operations are implemented by creating delegational relations between roles and objects dynamically.

Binding-operationBinding-operation

Page 25: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Model constructs (Summary)

environment ::= [environment attributes, environment methods, roles]role ::= [role attributes, role methods, binding-interfaces]

object ::= [attributes, methods]

agent ::= [roles, object]agent.binding-interface => object.method

Page 26: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Construction of Cooperative Mobile Agent Applications in RoleEP

Cooperative distributed applications based on mobile agent systems, which may change their functions dynamically in order to adapt themselves to their external context, can be constructed by synthesizing multiple environments dynamically.

Evolutionaryconstruction

Page 27: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Epsilon/J --Java RoleEP Framework

Epsilon/J is a framework that supports RoleEP concepts includingenvironment and roles.

This framework, which is presented as class libraries, is implemented on Aglets that is a mobile agent system based on Java.

Page 28: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Description in Epsilon/J

public class Roaming extends Environment{ public class Visitor extends Role{ …}}

public class ContractNet extends Environment{ public class Manager extends Role{ public void start(){} public void bid(){} public void end(){} } public class Contractor extends Role{ public void award(){} }}

public class UserProxy extends EpsilonObj{ public void life(){ bind ... bind ... }}

public class InfoSearcher extends EpsilonObj{ public void life() { bind … }}

object object

Environment & role Environment & role

Dynamic evolution!

Page 29: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Estimation of RoleEP

Approaches Viewpoints(Separation of concerns) (Evolution)

RoleEP ○ ○

Orthodox approach × ×Design-pattern approach △ ×AOP approach △ △

Page 30: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Merits of RoleEP

1) Construction mechanisms for traveling/collaboration componentsEnvironment classes can be regarded as traveling/collaboration components.

2) Evolution mechanisms for agents:An object can dynamically evolve to an agent that can behave multiple roles. Using RoleEP, programs that adapt to external context can be described easily.

3) Agentification mechanisms:In RoleEP, a role corresponds to a transducer that accepts messages from other agents and translates them into messages that an object can understand. RoleEP can be regarded as one of dynamic agentification mechanisms.

Page 31: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Related works

Page 32: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Related works

Mobile Ambients (Cardelli, L. and Gordon, A.D.)

Aspect Oriented Programming (Kiczales, G., et al.)Subject Oriented Programming (Harrison, W. and Ossher, H.)Role model (VanHilst, M. and Notkin, D.)

Separation of ConcernsSeparation of Concerns

Mobile agentsMobile agents

This model gives a layered agent structure. In this model, agents run on fieldsconstructed by synthesizing contexts (environments) dynamically.

Page 33: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Conclusion

Page 34: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Summary

RoleEP separates concerns on mobility from agent systems.RoleEP provides a systematic evolutionary programming style.

We proposed RoleEP, a new approach that constructs cooperative mobile agent applications.

Page 35: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

Appendix

Page 36: RoleEP:  Role Based Evolutionary Programming for Cooperative Mobile Agent Applications

AOP vs RoleEP

viewpoint AOP RoleEP

aspects aspects environments and rolescomponents components objectsjoint points join points roles (between aspects and components)weaving method weaver binding-operation

aspect reuse emphasized emphasizeddynamic aspect syntheses not so emphasized emphasizeddynamic evolution not so emphasized emphasizeddynamic method adding emphasized emphasizeddynamic method modification emphasized ---