|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fhg.igd.semoa.agent.RoundtripAgent examples.postcard.TouristAgent
An agents which is intended to wander round the world and bring
back a time-stamped picture from every place it visits. The picture
is provided by the postcard service
, which
is expected at the visited servers.
This demo application is inspired by the movie "The fantastic world of Amelie", which deals with the young woman Amelie living at Paris and trying to solve other people's problems. In order help her father to deal with her mothers death, Amelie sends her father's Gartenzwerg (a small statue of a dwarf, put in a garden for decoration. Very popular in Germany) on a trip round the world. From every place the statue visits it takes a picutre of itself and a famous place and sends it home.
Oh, and no - it's not an American movie and it won't get any Oscar.
Field Summary | |
private static String |
LOGFILE
Defines where the log file is stored in the agent's corpus. |
private List |
postcards_
An ordered list of postcards the agent has collected yet. |
private static int |
state_
Represents the state of the agent's lifecycle. |
Fields inherited from class de.fhg.igd.semoa.agent.RoundtripAgent |
debug_, env_, MAX_RETRIES, mob_, start_, time_, vars_ |
Constructor Summary | |
TouristAgent()
Creates the agent and initializes the member fields properly. |
Method Summary | |
private String |
currentLocation()
|
private String |
currentURL()
|
private Postcard |
fetchPostcard()
|
protected void |
finish()
This method is called when the agent reached its final hop. |
String |
getLog()
|
void |
log(String message)
Appends at message line at the end of the log file in the agent's corpus. |
protected void |
perform()
This method must be implemented by subclasses. |
Methods inherited from class de.fhg.igd.semoa.agent.RoundtripAgent |
getHopNumber, onRunning, run |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private List postcards_
private static int state_
private static final String LOGFILE
mutable/log.txt
Constructor Detail |
public TouristAgent()
Method Detail |
protected void perform()
RoundtripAgent
perform
in class RoundtripAgent
protected void finish()
RoundtripAgent
finish
in class RoundtripAgent
private Postcard fetchPostcard()
private String currentLocation()
private String currentURL()
public String getLog()
public void log(String message)
LOGFILE
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |