|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmadkit.kernel.AbstractAgent
madkit.kernel.Agent
madkit.demos.PingPong
public class PingPong
| Constructor Summary | |
|---|---|
PingPong()
|
|
| Method Summary | |
|---|---|
void |
activate()
This method sets the agent to create or join a "ping-pong" group, and then registers it with a role of "player" Could be simpler, but I wanted to show a complete and careful implementation |
void |
end()
This method is called by the agent micro-kernel at the end of the agent lifecycle. |
AgentAddress |
getOther()
This method allows the user to get the "other" agent address in the G-Box property sheet |
void |
live()
This method defines the main behavior for threaded agents. |
void |
setOther(AgentAddress add)
This method allows the user to set the "other" agent with the G-Box property sheet |
| 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, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PingPong()
| Method Detail |
|---|
public void setOther(AgentAddress add)
public AgentAddress getOther()
public void activate()
activate in class AbstractAgentpublic void live()
Agent
live in class Agentpublic void end()
AbstractAgent
end in class AbstractAgent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||