Class SystemInfluenceAddAgent
- java.lang.Object
-
- fr.univ_artois.lgi2a.similar.microkernel.influences.AbstractInfluence
-
- fr.univ_artois.lgi2a.similar.microkernel.influences.SystemInfluence
-
- fr.univ_artois.lgi2a.similar.microkernel.influences.system.SystemInfluenceAddAgent
-
- All Implemented Interfaces:
IInfluence
public final class SystemInfluenceAddAgent extends SystemInfluence
The system influence sent to a level when the reaction of that level has to insert a new agent into the simulation and make appear it public local state into the public dynamic state of the levels.Usage
The agent has to be fully initialized before being added using this influence. This initialization has to include calls to the
IAgent4Engine.includeNewLevel(LevelIdentifier, fr.univ_artois.lgi2a.similar.microkernel.agents.ILocalStateOfAgent, fr.univ_artois.lgi2a.similar.microkernel.agents.ILocalStateOfAgent)
method to specify where the agent initially lies.- Author:
- Yoann Kubera
-
-
Constructor Summary
Constructors Constructor Description SystemInfluenceAddAgent(LevelIdentifier targetLevel, SimulationTimeStamp timeLowerBound, SimulationTimeStamp timeUpperBound, IAgent4Engine agent)
Builds an 'Add agent' system influence adding a specific agent to the simulation during the next reaction of a specific level.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IAgent4Engine
getAgent()
Gets the agent to add to the simulation.String
toString()
Uses the category, the target level and the added agent of the influence to build a printable version of this object.-
Methods inherited from class fr.univ_artois.lgi2a.similar.microkernel.influences.SystemInfluence
isSystem
-
Methods inherited from class fr.univ_artois.lgi2a.similar.microkernel.influences.AbstractInfluence
getCategory, getTargetLevel, getTimeLowerBound, getTimeUpperBound
-
-
-
-
Field Detail
-
CATEGORY
public static final String CATEGORY
The category of this influence.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SystemInfluenceAddAgent
public SystemInfluenceAddAgent(LevelIdentifier targetLevel, SimulationTimeStamp timeLowerBound, SimulationTimeStamp timeUpperBound, IAgent4Engine agent)
Builds an 'Add agent' system influence adding a specific agent to the simulation during the next reaction of a specific level.- Parameters:
targetLevel
- The target level as described inIInfluence.getTargetLevel()
timeLowerBound
- The lower bound of the transitory period during which this influence was created.timeUpperBound
- The upper bound of the transitory period during which this influence was created.agent
- The agent to add to the simulation. The agent has to be fully initialized before being added using this influence. This initialization has to include calls to theIAgent4Engine.includeNewLevel(LevelIdentifier, fr.univ_artois.lgi2a.similar.microkernel.agents.ILocalStateOfAgent, fr.univ_artois.lgi2a.similar.microkernel.agents.ILocalStateOfAgent)
method to specify where the agent initially lies.- Throws:
IllegalArgumentException
- If the target level or the agent arenull
.
-
-
Method Detail
-
getAgent
public IAgent4Engine getAgent()
Gets the agent to add to the simulation.- Returns:
- The agent to add to the simulation.
-
toString
public String toString()
Uses the category, the target level and the added agent of the influence to build a printable version of this object.- Overrides:
toString
in classAbstractInfluence
- Returns:
- The concatenation of the category, the target level and the added agent of the influence.
-
-