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

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

public class AgentParameters
extends java.lang.Object
implements IAgentParameters

Agent parameters are meant to provide run-time parameters needed by various agents.

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

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).


Constructor Summary
AgentParameters()
           
 
Method Summary
 void assignDefaults(IAgentParameters defaults)
          Fills missing parameters of 'this' with values from 'defaults'.
 IAgentId getAgentId()
          Returns unique agent's id (and human-readable name) that is going to be used by the newly created agent instance.
 AgentParameters setAgentId(IAgentId agentId)
          Sets agent id into the parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentParameters

public AgentParameters()
Method Detail

getAgentId

public IAgentId getAgentId()
Description copied from interface: IAgentParameters
Returns unique agent's id (and human-readable name) that is going to be used by the newly created agent instance.

Specified by:
getAgentId in interface IAgentParameters
Returns:
unique agent's id

setAgentId

public AgentParameters setAgentId(IAgentId agentId)
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.

Parameters:
agentId -
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
Parameters:
defaults - values that should filled missing parameters