Package modelarium.entities
Class Environment
java.lang.Object
modelarium.entities.Entity<EnvironmentSimulationContext,EnvironmentContext,EnvironmentAttributeSet,AttributeSetLog<EnvironmentSimulationContext>>
modelarium.entities.Environment
public final class Environment
extends Entity<EnvironmentSimulationContext,EnvironmentContext,EnvironmentAttributeSet,AttributeSetLog<EnvironmentSimulationContext>>
Class for representing the environment of the model.
This class is an entity that owns EnvironmentAttributeSet instances and uses an
EnvironmentSimulationContext for its behaviour and interactions.
-
Constructor Summary
ConstructorsConstructorDescriptionEnvironment(String name, List<EnvironmentAttributeSet> attributeSets) Constructs a new environment with the specified name and attribute sets.Environment(List<EnvironmentAttributeSet> attributeSets) Constructs a new environment with an attribute sets. -
Method Summary
Modifier and TypeMethodDescriptionCreates and returns an immutable version of this environment.Retrieves an event attribute from one of this environment's attribute sets.getProperty(String attributeSetName, String propertyName) Retrieves a property attribute from one of this environment's attribute sets.getRoutine(String attributeSetName, String routineName) Retrieves a routine attribute from one of this environment's attribute sets.Methods inherited from class modelarium.entities.Entity
attributeCount, attributeSetCount, context, getAttributeSet, getAttributeSet, getLog, name, run
-
Constructor Details
-
Environment
Constructs a new environment with the specified name and attribute sets.- Parameters:
name- the name of the environment, used to identify it within the modelattributeSets- the attribute sets the environment will own
-
Environment
Constructs a new environment with an attribute sets.- Parameters:
attributeSets- the attribute sets the environment will own
-
-
Method Details
-
getEvent
Retrieves an event attribute from one of this environment's attribute sets.- Parameters:
attributeSetName- the name of the attribute set containing the eventeventName- the name of the event to retrieve- Returns:
- the
EnvironmentEventwith the specified name
-
getRoutine
Retrieves a routine attribute from one of this environment's attribute sets.- Parameters:
attributeSetName- the name of the attribute set containing the routineroutineName- the name of the routine to retrieve- Returns:
- the
EnvironmentRoutinewith the specified name
-
getProperty
Retrieves a property attribute from one of this environment's attribute sets.- Parameters:
attributeSetName- the name of the attribute set containing the propertypropertyName- the name of the property to retrieve- Returns:
- the
EnvironmentPropertywith the specified name
-
getAsImmutable
Creates and returns an immutable version of this environment.- Specified by:
getAsImmutablein classEntity<EnvironmentSimulationContext,EnvironmentContext, EnvironmentAttributeSet, AttributeSetLog<EnvironmentSimulationContext>> - Returns:
- the new
ReadOnlyEnvironmentinstance
-