Mobile Agent Programming Concepts - PowerPoint PPT Presentation

About This Presentation
Title:

Mobile Agent Programming Concepts

Description:

Mobile Agent Programming Concepts FK Dimensions of mobility Moving between different execution servers (processes, hosts) Moving in time Moving with the user ... – PowerPoint PPT presentation

Number of Views:106
Avg rating:3.0/5.0
Slides: 40
Provided by: FredrikK2
Category:

less

Transcript and Presenter's Notes

Title: Mobile Agent Programming Concepts


1
Mobile Agent ProgrammingConcepts
  • FK

2
Dimensions of mobility
  • Moving between different execution servers
    (processes, hosts)
  • Moving in time
  • Moving with the user (execution server)
  • Moving between contexts

3
Properties of agent execution environments
  • Static network (fixed host network address)
  • Roaming network (dyn. host netw. address)
  • Reliable real-time (stationary server computer)
  • Intermittent real-time (laptop, iPhone)
  • True persistence (Hard-disc, NV-RAM)
  • Volatile persistence (battery RAM)

4
Properties of agent execution environments
Dynamic network address Intermittent
realtime Volatile persistence
Static network address Reliable realtime True
persistence
Dynamic network address Intermittent
realtime True persistence
5
Properties of agent execution environments
Dynamic
Cell phones
Early wearables
Network address
Laptops
Intermittent
Real-time
Servers
Static
Persistence
Volatile
6
Dynamic network address
  • Difficult to find a particular host
  • Needs registration at a well-known name
  • LAN local discovery techniques (eg Jini)
  • WAN remote interaction (eg SIP)
  • Network Address Translation (NAT) imposes similar
    problem
  • IPv4 ? IPv6 needed but costly

7
Intermittent real-time
  • If the agent is suspended externally, eg by power
    management, it may not see the suspension.
  • Can the agent control power mgmt when it needs
    to?
  • Small devices (mobile phones) may be suspended
    without warning.

8
Volatile persistence
  • How much of the present state must be saved?
  • To where can it be saved?
  • How to (re)establish state after reanimation?
  • How can the saved state be found?
  • Time (how long was the agent asleep?)

9
Planned discontinuity (1)
2. Set timer
3. Sleep
1. Save state
4. Wake up
5. Restore state
10
Planned discontinuity (2)
3. External event
2. Terminate
1. Save state
4. Restart
5. Restore state
11
Planned discontinuity (3)
1. Negotiate hosting
3. Terminate
2. Save state
6. Restore state
5. Restart
4. Transfer identity and state
12
Mobile code (1)
Initial execution environment
Next execution environment
1. Locate exec. env.
2. Negotiate hosting
3. Transfer identity and state
5. Continue
4. Terminate
13
Mobile code (2)
Initial execution environment
Next execution environment
1. Locate exec. env.
2. Negotiate hosting
3. Transfer identity and state
5. Continue
6. Acknowledge
7. Terminate
14
What do we mean by state?
  • Memory and cpu configuration of process
  • Values of active variables (including call stack)
    and the execution point
  • A classifiable subset of the true state

switch (myState) case 0 / state 0 /
break case 1 / state 1 / break //
etc...
15
State (contd)
  • For the programmer, state and code are often the
    same concept
  • Mobile code (e.g. Java) may not be able to
    transfer the execution point
  • This breaks the code-state relationship

16
State (contd)
y1
START
y2
START
y y2
Migrate?
Yes
y y2
No
z y
Migrate?
z2
No
Variables evolve while code point is reset
z y
z4
17
Goal-driven execution
  • The task can be expressed as a sequence of
    discrete steps
  • The accomplishment of each step can be tested
  • What to do next is computable

18
Goal-driven execution (contd)
Task Deliver a message (to a user) The message
is executable and must run on the recipients
current host.
19
Goal-driven execution
while (true) do if (the current host is the user
host) then execute the message exit else lo
cate the user host move to user host endif done
20
Goal-driven execution
  • Gets complicated quite fast, e.g. remember
    failures, responses, a dialogue...
  • State must be knitted into the task resolution
    structure
  • Goal stack approach

21
Goal stack interpreter
  • Useful for intermittent real-time (wearable
    devices, power management)
  • The goal stack is maintained as a data structure
  • The goal on top of the stack is either replaced
    by a sequence of subgoals, or executed as an
    idempotent unit until it succeeds

22
Goal stack interpreter
Execute goal-code
Goal expansion
Establish host of Ralph
Y
Fail?
Move to Ralphs host
Execute message code
Deliver message to Ralph
N
Pop stack
N
Empty stack?
Move commanded by external events has small
impact on top-most goal.
Y
Establish host of Ralph
Stop
Move to Ralphs host
Execute message code
23
Goal stack interpreter
Execute goal-code
Pop
Establish host of Ralph
Y
Fail?
Move to Ralphs host
Move to Ralphs host
Execute message code
Execute message code
N
Pop stack
N
Empty stack?
Current goal
Y
Current goal
Stop
24
Layers of abstraction
Task
Transport
Discovery
Communication
25
Layers of abstraction
Task
Code for identifying and approaching the goal.
Transport
Discovery
Communication
26
Layers of abstraction
Code for moving the agent between places of
execution.
Task
Code for identifying and approaching the goal.
Transport
Discovery
Communication
27
Layers of abstraction
Code for moving the agent between places of
execution.
Task
Code for identifying and approaching the goal.
Transport
Discovery
Methods for finding (the addresses) to resources.
Communication
28
Layers of abstraction
Code for moving the agent between places of
execution.
Task
Code for identifying and approaching the goal.
Transport
Discovery
Methods for finding (the addresses) to resources.
Sending the bits of the agent to another place.
Communication
29
Agent enabling middleware
  • Discovery mechanisms (execution hosts, other
    agents, negotiation partners ...)
  • Addressing namespaces (IP, URLs, SIP, RMI)
  • Communication means (netw. stack)
  • Protocol (language and semantics)

30
Game of Tag for agents
  • Discover execution environments
  • Query properties of the exec. env.
  • Locate other agents
  • Negotiate for status (being it or not)
  • Transaction (reliably transferring it between
    players)
  • Multiple roles and tasks dep. on being it.

31
TAG player outline
Acquire state of game
Decide what to do
Execute choice
32
TAG player outline
Locate all Bailiffs and players
Am I it?
YES
NO
YES
NO
YES
NO
Is the it player here?
Is there a player here?
Tag a player
Move to a Bailiff with players
Move to another Bailiff
Move or wait according to strategy
33
TAG player outline
Locate all Bailiffs and players
Am I it?
YES
NO
YES
NO
YES
NO
Is the it player here?
Is there a player here?
Tag a player
Move to a Bailiff with players
Move to another Bailiff
Move or wait according to strategy
State information must be updated
34
TAG player outline
Locate all Bailiffs and players
Am I it?
YES
NO
YES
NO
YES
NO
Is the it player here?
Is there a player here?
Tag a player
Move to a Bailiff with players
Move to another Bailiff
Move or wait according to strategy
Seek to be lonely Seek company Act randomly
35
TAG player outline
Seek to be lonely Seek company Act randomly
36
TAG player outline
Seek to be lonely Seek company Act randomly
37
TAG player outline
Seek to be lonely Seek company Act randomly
38
TAG player outline
  • The lonely strategy
  • increases the chance that the it player goes to
    another Bailiff
  • makes the player faster
  • needs as many Bailiffs as there are players, but
    no more
  • with fewer Bailiffs it approaches the company
    strategy
  • The company strategy
  • increases the chance that the it player tags
    another player
  • needs fewer Bailiffs
  • makes the player slower

39
End
Write a Comment
User Comments (0)
About PowerShow.com