cz.cuni.amis.pogamut.base.agent.params.impl
Class RemoteAgentParameters

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.agent.params.impl.AgentParameters
      extended by cz.cuni.amis.pogamut.base.agent.params.impl.RemoteAgentParameters
All Implemented Interfaces:
IAgentParameters, IRemoteAgentParameters
Direct Known Subclasses:
TeamRemoteAgentParameters, UT2004AgentParameters

public class RemoteAgentParameters
extends AgentParameters
implements IRemoteAgentParameters

Remote agent parameters are meant to provide run-time parameters needed by various agents that works on client/server paradigm.

If you need to populate the parameters after instantiation, use setters available in this class: setAgentId(IAgentId), setWorldAddress(IWorldConnectionAddress).

NOTE: all IAgentParameters implementors are usually used together with IAgentRunner or IMultipleAgentRunner which usually contains sensible default params, therefore there is no need to set all parameters into newly created ones as runners will supply them via IAgentParameters.assignDefaults(IAgentParameters).

See Also:
AgentParameters

Constructor Summary
RemoteAgentParameters()
           
 
Method Summary
 void assignDefaults(IAgentParameters defaults)
          Fills missing parameters of 'this' with values from 'defaults'.
 IWorldConnectionAddress getWorldAddress()
          Address of the environment the newly created agent has to connect into.
 RemoteAgentParameters setAgentId(IAgentId agentId)
          Sets agent id into the parameters.
 RemoteAgentParameters setWorldAddress(IWorldConnectionAddress address)
          Sets connection address into the parameters.
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.params.impl.AgentParameters
getAgentId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.base.agent.params.IAgentParameters
getAgentId
 

Constructor Detail

RemoteAgentParameters

public RemoteAgentParameters()
Method Detail

getWorldAddress

public IWorldConnectionAddress getWorldAddress()
Description copied from interface: IRemoteAgentParameters
Address of the environment the newly created agent has to connect into.

Specified by:
getWorldAddress in interface IRemoteAgentParameters
Returns:
environment address

setAgentId

public RemoteAgentParameters setAgentId(IAgentId agentId)
Description copied from class: AgentParameters
Sets agent id into the parameters.

WARNING: Note that you should not mess with 'setters' in different threads as they are non-thread-safe and may interrupt horrible agent instantiations with such behavior.

Overrides:
setAgentId in class AgentParameters
Returns:
this instance

setWorldAddress

public RemoteAgentParameters setWorldAddress(IWorldConnectionAddress address)
Sets connection address into the parameters.

WARNING: Note that you should not mess with 'setters' in different threads as they are non-thread-safe and may interrupt horrible agent instantiations with such behavior.

Parameters:
address -
Returns:
this instance

assignDefaults

public void assignDefaults(IAgentParameters defaults)
Description copied from interface: IAgentParameters
Fills missing parameters of 'this' with values from 'defaults'.

This method is meant as a hook for IAgentRunners that can ease the burden of instantiating&launching the agent into a specific environment.

It assigns params from 'default' only to fields (of this) that are null!

Specified by:
assignDefaults in interface IAgentParameters
Overrides:
assignDefaults in class AgentParameters
Parameters:
defaults - values that should filled missing parameters