Class ExtendedEnvironment
- java.lang.Object
-
- fr.univ_artois.lgi2a.similar.microkernel.libs.abstractimpl.AbstractEnvironment
-
- fr.univ_artois.lgi2a.similar.extendedkernel.environment.ExtendedEnvironment
-
- All Implemented Interfaces:
IEnvironment
,IEnvironment4Engine
public class ExtendedEnvironment extends AbstractEnvironment
Models an environment in the extended kernel.On the opposite of the micro-kernel, where environment classes had to be created, this class is self-sufficient. The operational code of the natural action processes is defined in a separate class. The environment class only stores a reference to this class.
Benefits
This property has a huge benefit:- The behavior of the environment can evolve at runtime.
Environment specification
The specification of such environments requires two operations:
-
The definition of the initial local states of the environment, using the
AbstractEnvironment.includeNewLevel(LevelIdentifier, ILocalStateOfEnvironment, ILocalStateOfEnvironment)
method. -
The specification of the behavior of the environment in each level, using the
specifyBehaviorForLevel(LevelIdentifier, IEnvNaturalModel)
method.
Introspection and intercession
Environment introspection is achieved with the following methods:
Environment intercession is achieved with the following methods:
- Author:
- Yoann Kubera
-
-
Constructor Summary
Constructors Constructor Description ExtendedEnvironment()
Builds an environment for a simulation containing no levels.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IEnvNaturalModel
getNaturalModelForLevel(LevelIdentifier levelId)
Gets the model of the natural action of the environment from that level.void
natural(LevelIdentifier level, SimulationTimeStamp timeLowerBound, SimulationTimeStamp timeUpperBound, Map<LevelIdentifier,ILocalStateOfEnvironment> publicLocalStates, ILocalStateOfEnvironment privateLocalState, IPublicDynamicStateMap dynamicStates, InfluencesMap producedInfluences)
Models the natural action of the environment on the simulation, from a specific level.void
specifyBehaviorForLevel(LevelIdentifier levelId, IEnvNaturalModel naturalMdl)
Specifies the behavior of the environment from the specified level.-
Methods inherited from class fr.univ_artois.lgi2a.similar.microkernel.libs.abstractimpl.AbstractEnvironment
getPrivateLocalState, getPublicLocalState, getPublicLocalStates, includeNewLevel
-
-
-
-
Constructor Detail
-
ExtendedEnvironment
public ExtendedEnvironment()
Builds an environment for a simulation containing no levels. The environment has then to be initialized using the following methods:-
The definition of the initial local states of the environment, using the
AbstractEnvironment.includeNewLevel(LevelIdentifier, ILocalStateOfEnvironment, ILocalStateOfEnvironment)
method. -
The specification of the behavior of the environment in each level, using the
specifyBehaviorForLevel(LevelIdentifier, IEnvNaturalModel)
method.
-
The definition of the initial local states of the environment, using the
-
-
Method Detail
-
getNaturalModelForLevel
public IEnvNaturalModel getNaturalModelForLevel(LevelIdentifier levelId)
Gets the model of the natural action of the environment from that level.- Parameters:
levelId
- The identifier of the level.- Returns:
- The model of the natural action of the environment from that level.
- Throws:
NoSuchElementException
- If no natural model is defined for that environment for the level identified bylevelId
.
-
specifyBehaviorForLevel
public void specifyBehaviorForLevel(LevelIdentifier levelId, IEnvNaturalModel naturalMdl)
Specifies the behavior of the environment from the specified level.- Parameters:
levelId
- The identifier of the level for which a behavior is defined.naturalMdl
- The model of the natural action of the environment from that level.- Throws:
IllegalArgumentException
- If an argument isnull
or has an invalid value.
-
natural
public void natural(LevelIdentifier level, SimulationTimeStamp timeLowerBound, SimulationTimeStamp timeUpperBound, Map<LevelIdentifier,ILocalStateOfEnvironment> publicLocalStates, ILocalStateOfEnvironment privateLocalState, IPublicDynamicStateMap dynamicStates, InfluencesMap producedInfluences)
Models the natural action of the environment on the simulation, from a specific level.This method models the application natural]t,t+dtl[,l from the theory of SIMILAR.
- Parameters:
level
- The level from which the natural action of the environment is made (i.e. "l" in the notations).timeLowerBound
- Is the lower bound of the transitory period of the level identified bylevel
from which the natural action of the environment is made (i.e. "t" in the notations).timeUpperBound
- Is the upper bound of the transitory period of the level identified bylevel
from which the natural action of the environment is made (i.e. t+dtl in the notations).publicLocalStates
- All the public local states of the environment.privateLocalState
- The private local state of the environment in the level from which perception is made (i.e. φω-( t,level
) in the notations).dynamicStates
- The dynamic state of the various levels that can be perceived from the levellevel
. This value has previously been disambiguated by a heuristic defined in the simulation engine.producedInfluences
- The map where the influences resulting from the natural action are stored.
-
-