|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmadkit.kernel.AbstractAgent
madkit.kernel.Agent
SEdit.FormalismAgent
public class FormalismAgent
Field Summary | |
---|---|
static java.lang.String |
FORMALISM_FOLDER
|
java.util.Vector |
formalisms
|
Constructor Summary | |
---|---|
FormalismAgent()
|
Method Summary | |
---|---|
void |
activate()
This method is initially called when the micro-kernel registers the agent. |
Formalism |
getFormalism(java.lang.String _name)
|
void |
getFromDirectory(java.io.File directory)
|
protected void |
handleMessage(SEditMessage m)
|
void |
live()
This method defines the main behavior of threaded agents. |
protected void |
updateFormalisms(Formalism f)
|
Methods inherited from class madkit.kernel.Agent |
---|
connectAgencyToAgency, createPlace, createPlace, enableMobility, enableMobility, exitImmediatlyOnKill, getAgencyNamed, joinPlace, joinPlace, joinPlace, pause, receiveMessage, run, waitNextMessage, waitNextMessage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FORMALISM_FOLDER
public java.util.Vector formalisms
Constructor Detail |
---|
public FormalismAgent()
Method Detail |
---|
public void getFromDirectory(java.io.File directory)
public void activate()
AbstractAgent
Here is a typical example (taken from the PingPong
agent of MadKit (plugin demos)) :
public void activate() { try { createGroup(true,"ping-pong",null,null); println ("No ping-pong group : I created one"); creator=true; } catch (OrganizationRequestException e) { // the group already exists creator=false; println ("A ping-pong group already exists : I will join"); } requestRole("ping-pong","player",null); }
activate
in class AbstractAgent
protected void updateFormalisms(Formalism f)
protected void handleMessage(SEditMessage m)
public Formalism getFormalism(java.lang.String _name)
public void live()
Agent
live
in class Agent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |