E
- The subclass of StandardEntity that this agent wants to control.public abstract class StandardAgent<E extends StandardEntity> extends AbstractAgent<StandardWorldModel,E>
config, connection, model, random
Constructor and Description |
---|
StandardAgent() |
Modifier and Type | Method and Description |
---|---|
protected StandardWorldModel |
createWorldModel()
Construct the world model.
|
protected java.util.List<Refuge> |
getRefuges()
Get a list of all refuges in the world.
|
java.lang.String[] |
getRequestedEntityURNs()
Get the list of entity URNs that this agent is willing to control.
|
protected abstract java.util.EnumSet<StandardEntityURN> |
getRequestedEntityURNsEnum()
Get an EnumSet containing requested entity URNs.
|
protected StandardEntity |
location()
Get the location of the entity controlled by this agent.
|
protected void |
postConnect()
Perform any post-connection work required before acknowledgement of the connection is made.
|
protected void |
sendClear(int time,
EntityID target)
Send a clear command to the kernel.
|
protected void |
sendClear(int time,
int destX,
int destY)
Send a clear command to the kernel.
|
protected void |
sendExtinguish(int time,
EntityID target,
int water)
Send an extinguish command to the kernel.
|
protected void |
sendLoad(int time,
EntityID target)
Send a load command to the kernel.
|
protected void |
sendMove(int time,
java.util.List<EntityID> path)
Send a move command to the kernel.
|
protected void |
sendMove(int time,
java.util.List<EntityID> path,
int destX,
int destY)
Send a move command to the kernel.
|
protected void |
sendRescue(int time,
EntityID target)
Send a rescue command to the kernel.
|
protected void |
sendRest(int time)
Send a rest command to the kernel.
|
protected void |
sendSay(int time,
byte[] data)
Send a say command to the kernel.
|
protected void |
sendSpeak(int time,
int channel,
byte[] data)
Send a speak command to the kernel.
|
protected void |
sendSubscribe(int time,
int... channels)
Send a subscribe command to the kernel.
|
protected void |
sendTell(int time,
byte[] data)
Send a tell command to the kernel.
|
protected void |
sendUnload(int time)
Send an unload command to the kernel.
|
protected boolean |
shouldIndex()
Should the world model be automatically indexed?
|
connect, getID, getPreferredNDC, me, postConnect, processMessage, processSense, think
getName, getPreferredLogContext, getPreferredRegistry, initialise, postConnect, processImmediately, send, shutdown
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, getPreferredLogContext, getPreferredRegistry, initialise, shutdown
public final java.lang.String[] getRequestedEntityURNs()
Agent
protected abstract java.util.EnumSet<StandardEntityURN> getRequestedEntityURNsEnum()
protected StandardWorldModel createWorldModel()
AbstractComponent
createWorldModel
in class AbstractComponent<StandardWorldModel>
protected void postConnect()
AbstractComponent
postConnect
in class AbstractAgent<StandardWorldModel,E extends StandardEntity>
protected void sendRest(int time)
time
- The current time.protected void sendMove(int time, java.util.List<EntityID> path)
time
- The current time.path
- The path to send.protected void sendMove(int time, java.util.List<EntityID> path, int destX, int destY)
time
- The current time.path
- The path to send.destX
- The destination X coordinate.destY
- The destination Y coordinate.protected void sendExtinguish(int time, EntityID target, int water)
time
- The current time.target
- The target building.water
- The amount of water to use.protected void sendClear(int time, EntityID target)
time
- The current time.target
- The target road.protected void sendClear(int time, int destX, int destY)
time
- The current time.destX
- The destination X coordinate to clear.destY
- The destination Y coordinate to clear.protected void sendRescue(int time, EntityID target)
time
- The current time.target
- The target human.protected void sendLoad(int time, EntityID target)
time
- The current time.target
- The target human.protected void sendUnload(int time)
time
- The current time.protected void sendSpeak(int time, int channel, byte[] data)
time
- The current time.channel
- The channel to speak on.data
- The data to send.protected void sendSubscribe(int time, int... channels)
time
- The current time.channels
- The channels to subscribe to.protected void sendSay(int time, byte[] data)
time
- The current time.data
- The data to send.protected void sendTell(int time, byte[] data)
time
- The current time.data
- The data to send.protected java.util.List<Refuge> getRefuges()
protected StandardEntity location()
protected boolean shouldIndex()