public class AgentRuntime extends java.lang.Object implements IObserver<java.util.Map<java.lang.String,IPerceptor>>, IWorldModelInteract, java.io.Serializable
Constructor and Description |
---|
AgentRuntime(PlayerParameters params) |
Modifier and Type | Method and Description |
---|---|
void |
addBehavior(java.lang.String name,
IBehavior behavior)
Add a behavior to the behavior list (used by the sliders tool)
|
void |
beam(float x,
float y,
float rot)
Used by gui to beam the player to a specified position
|
IAction |
getAction()
Retrieve the action
|
IAgentMetaModel |
getAgentMetaModel()
Retrieve the agent meta model
|
IAgentModel |
getAgentModel()
Retrieve the agentModel
|
java.util.Map<java.lang.String,IBehavior> |
getBehaviors()
Retrieve the behavior map
|
java.util.Map<java.lang.String,IBelief> |
getBeliefs()
Retrieve the beliefs map
|
IChannelManager |
getChannelManager() |
IDecisionMaker |
getDecisionMaker()
Retrieve the decision maker
|
float |
getMaxGain() |
IPerception |
getPerception()
Retrieve the perception
|
IRCServerMetaModel |
getServerMetaModel()
Retrieve the server meta model
|
IThoughtModel |
getThoughtModel()
Retrieve the thouhgtModel
|
IGlobalMap |
getWorldModel()
Retrieve the worldModel
|
boolean |
isConnected()
Check if the agent is connected to the server
|
void |
moveto(float x,
float y,
float rot)
Used by GUI to make the player walk where we want.
|
IBehavior |
removeBehavior(java.lang.String name)
Remove a behavior from the behavior list (used by the sliders tool)
|
void |
setMaxGain(float motorGain) |
void |
setPaused(boolean paused) |
boolean |
startClient()
Starts the connection to the server, will only return after disconnection
Uses default IP and port
|
void |
stopClient()
Stops the connection to the server after the next message was received
|
void |
update(java.util.Map<java.lang.String,IPerceptor> content)
This method handles the main-loop of the magma agent framework.
|
public AgentRuntime(PlayerParameters params)
params
- - the configuration parameters to setup the clientpublic void update(java.util.Map<java.lang.String,IPerceptor> content)
update
in interface IObserver<java.util.Map<java.lang.String,IPerceptor>>
content
- reference to the object containing changed statepublic boolean startClient()
public boolean isConnected()
public void stopClient()
public void beam(float x, float y, float rot)
beam
in interface IWorldModelInteract
x
- x coordinate to beam toy
- y coordinate to beam torot
- rotation angle of the playerpublic void moveto(float x, float y, float rot)
moveto
in interface IWorldModelInteract
x
- x coordinate to move toy
- y coordinate to move torot
- rotation angle of the playerpublic void addBehavior(java.lang.String name, IBehavior behavior)
name
- Behavior namebehavior
- Behavior to addpublic IBehavior removeBehavior(java.lang.String name)
name
- Behavior name to removepublic IAgentMetaModel getAgentMetaModel()
public IRCServerMetaModel getServerMetaModel()
public IPerception getPerception()
public IAction getAction()
public IAgentModel getAgentModel()
public IGlobalMap getWorldModel()
public IThoughtModel getThoughtModel()
public java.util.Map<java.lang.String,IBehavior> getBehaviors()
public java.util.Map<java.lang.String,IBelief> getBeliefs()
public IDecisionMaker getDecisionMaker()
public IChannelManager getChannelManager()
public void setMaxGain(float motorGain)
motorGain
- public float getMaxGain()
public void setPaused(boolean paused)