Transcript Slide 1

Agents & Mobile Agents
Agents
• An agent is anything that can be viewed as
perceiving its environment through sensors and
acting upon that environment through actuators
•
• Human agent: eyes, ears, and other organs for
sensors; hands,
• legs, mouth, and other body parts for actuators
•
• Robotic agent: cameras and infrared range
finders for sensors;
• various motors for actuators
•
Agents and environments
The agent function maps from percept histories to actions
[f: P*  A]
The agent program runs on the physical architecture to
produce f
agent = architecture + program
Vacuum-cleaner world
Percepts: location and contents, e.g.,
[A,Dirty]
Actions: Left, Right, Suck, NoOp
Agents - what are they?
Objects and Agents – An
Analogy
• Objects encapsulate state, Agents
encapsulate state + execution behaviour
• Objects have no control over the execution
of methods
• Invocation of method m on object o –
involuntary – whether object o likes it or
not
Objects and Agents – An
Analogy
• Agents have control of whether or not to
perform any given action
• Request actions rather than invoke methods
Microsoft Agent
• persons Microsoft Agent
Basic Definitions
Rational agents
An agent should strive to "do the right thing",
based on what it can perceive and the actions it
can perform. The right action is the one that will
cause the agent to be most successful
Performance measure: An objective criterion for
success of an agent's behavior
E.g., performance measure of a vacuum-cleaner
agent could be amount of dirt cleaned up,
amount of time taken, amount of electricity
consumed, amount of noise generated, etc.
Simple reflex agents
Agents - Applications
• many due to:
– agent research spans disciplines:
artificial intelligence, distributed
computing, software engineering
(ABSE), sociology, psychology,
economics, object-oriented systems,
artificial life, game theory, ...
• a sampling...
What is a Mobile Agent ?
What is a Mobile Agent ?
• Software program
• Moves from machine to machine under its own
control….
• Suspend execution at any point in time,
transport itself to a new machine and resume
execution
• Once created, a mobile agent autonomously
decides which locations to visit and what
instructions to perform
• Continuous interaction with the agent’s
originating source is not required
• HOW?
– Implicitly specified through the agent code
– Specified through a run-time modifiable
itinerary
Mobile Agent
• Derives from AI and distributed systems
• Agent that migrates under its own control
in a heterogeneous environment
• Mobility can be
– Strong:
move code with current
execution state
– Weak: move only code
Agent
Client
Server
Server
Evolution
• BOTTOMLINE: Mobile Agents are a distributed
computing paradigm
• End point in the incremental evolution of mobile
abstractions such as mobile code, mobile objects,
mobile processes.
– Mobile Code – transfers code
– Mobile Object – transfers code + data
– Mobile Process – transfers
code + data + thread state
• Mobile Agent – transfers
code + data + thread + authority of its owner
Inter-Agent Message Passing
- Requirements
• Efficiency
– Low location updating overhead
– Low message delivery overhead
• Asynchrony
– Asynchronous execution
– Little constraint on the mobile agent
mobility.
• Adaptability
– Suit different Communication and Migration
Pattern
Inter-Agent Message Passing
- Requirements
• Location Transparency
– Message sender does not need to know the
physical location of the receiver agent, whose
address changes frequently by moving from one
host to another.
• Reliability
– The concurrent and asynchronous nature of
message forwarding and agent migration may
cause message loss or chasing problem.
– By reliability we mean the message can reach the
target agent by a bounded number of forwarding.
RPC Vs Mobile Agents
• Mobile Agents
– Instead of calling a procedure, supply the
procedure as well
– Messages: Mobile Agent ( procedure + data +
state)
– “Sending” computer may have begun the
procedure and the receiving computer will
continue the procedure
– On-going interaction, but NO on-going
communication
Mobile
CLIENT
network
Service
Agent
SERVER
Applets, Servlets and Mobile
Agents
• Applet – Downloaded from server to
client
• Servlet – Uploaded from client to
server
• Mobile Agents – Detached from
client, can have multiple hops
Advantages of the Mobile
Agent Paradigm
• reduce bandwidth consumption and network loads
• allow dynamic deployment of application components to
arbitrary network sites
• encapsulate protocols
• execute asynchronously and autonomously
• can adapt by moving
• run on heterogeneous platforms
• most distributed applications fit naturally into the mobile
agent model
• intuitively suitable for mobile users and disconnected
operations
• Mobile agents combine the strengths of techniques such
as RPC, java applets etc. into a single, convenient
framework
Levels of Mobility
• Weak Mobility
– When moving a mobile agent
carries code + data state
– On moving, execution has to start
from the beginning
Levels of Mobility
• Strong Mobility
– When moving a mobile agent carries
code + data state + execution state
– Execution State – local variables and
threads
– On moving, execution can continue
from the point it stopped on the previous
host
MAP
MAP
MAP
MAP
Design of ARP (Adaptive and
Reliable Protocol)
•
•
•
•
Mobile IP solution
Extention1: Mobile IP + Synchronization
Extension2: Distributed Home Scheme
Extension3: Mailbox-Based Scheme =
ARP
Mobile IP Solution
MAP
MAP-Home
Reg
MAP
MAP
Design of ARP
• Mobile IP solution
– No Reliability Support
• Extention1: Mobile IP +Synchronization
– The agent home coordinates message
passing and agent migration
• Extension2: Distributed Home Scheme
• Extension3: Mailbox-Based Scheme =
ARP
Mobile IP + Synchronization
MAP
MAP-Home
Dereg
ACK
MAP
Reg
MAP
Mobile IP + Synchronization
MAP
MAP-Home
Dereg
ACK
MAP
Reg
MAP
Caching Mechanism
MAP-1
MAP-2
MAP-3
Properties of ARP
• Location Transparency
– Home + Caching Mechanism
• Reliability
– Synchronization is used
• Asynchronous Migration
• Adaptability
– Mobile IP + Synchronization
– Distributed Home Scheme
• Efficiency
IBM’s Aglet Toolkit
 An Applet-like programming model
for mobile agents
 Java (as many mobile agent toolkits
are! )
 Aglet = Agent + Applet
 Aglet’s API facilitates mobile
technology
 Aglet: mobile java object that visits
aglet enabled hosts in a computer
network
 An Aglet = Instance of a Java class
extending the Aglet Class
IBM’s Aglet Toolkit
• An Aglet =Aglet state (values in
variables) +
Aglet code (class implementation)
• Autonomous – runs its own thread
after arriving at a host
• Reactive – responds to incoming
messages
• Weak Mobility
Thank you for
lessening