Interface IInfluence
-
- All Known Implementing Classes:
AbstractInfluence
,RegularInfluence
,SystemInfluence
,SystemInfluenceAddAgent
,SystemInfluenceAddAgentToLevel
,SystemInfluenceRemoveAgent
,SystemInfluenceRemoveAgentFromLevel
public interface IInfluence
Models an influence produced by the agents, the environment or the reaction to modify the dynamic state of the simulation.An influence is characterized by a category, telling which kind of influence it models. This category is especially used during the reaction phase to identify which type of influence it is, without having to perform a class test (
instanceof
).Correspondence with theory
An instance of this class models an influence i∈𝕀.
Usage
To facilitate the use of influences, it is advised to define a public and static field defining the category of the influence. This way, there won't be any misspelling during the reaction phase of the simulation, when these categories are used to identify the influences.
- Author:
- Yoann Kubera
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getCategory()
Gets the category of the influence, i.e. a name identifying the type of the influence.LevelIdentifier
getTargetLevel()
Gets the identifier of the level whose reaction will process this influence.SimulationTimeStamp
getTimeLowerBound()
Gets the lower bound of the transitory period during which this influence was created.SimulationTimeStamp
getTimeUpperBound()
Gets the upper bound of the transitory period during which this influence was created.boolean
isSystem()
Checks if this influence is a system influence, and has to be managed by the simulation engine.
-
-
-
Method Detail
-
getCategory
String getCategory()
Gets the category of the influence, i.e. a name identifying the type of the influence.Examples:
- Accelerate
- Eat prey
- Crouch
- Returns:
- The category of the influence, as defined in the public static field declared in the concrete influence class.
-
getTargetLevel
LevelIdentifier getTargetLevel()
Gets the identifier of the level whose reaction will process this influence.- Returns:
- The identifier of the level whose reaction will process this influence.
-
isSystem
boolean isSystem()
Checks if this influence is a system influence, and has to be managed by the simulation engine.- Returns:
true
if the influence is a system influence.
-
getTimeLowerBound
SimulationTimeStamp getTimeLowerBound()
Gets the lower bound of the transitory period during which this influence was created.- Returns:
- The lower bound of the transitory period during which this influence was created.
-
getTimeUpperBound
SimulationTimeStamp getTimeUpperBound()
Gets the upper bound of the transitory period during which this influence was created.- Returns:
- The upper bound of the transitory period during which this influence was created.
-
-