Package modelarium.attributes
Class AttributeSet
java.lang.Object
modelarium.attributes.AttributeSet
- All Implemented Interfaces:
DeepCopyable<AttributeSet>
Represents a named collection of attributes, organised into pre-events, properties, and post-events.
This class defines the execution order and data recording logic for all attributes linked to a model element such as an agent or environment. It is intended to be executed once per simulation tick, coordinating the flow of behaviour and conditionally recording attribute states.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an attribute set with a generated default name and empty components.AttributeSet(String name) Constructs an attribute set with a given name and empty event/property collections.AttributeSet(String name, Events preEvents, Properties properties, Events postEvents) Constructs an attribute set with a given name and specified components. -
Method Summary
Modifier and TypeMethodDescriptiondeepCopy()getName()voidrun(AttributeSetResults attributeSetResults) Executes all attributes in the prescribed order: Pre-events (conditionally triggered) Properties (always executed) Post-events (conditionally triggered)voidsetAssociatedModelElement(ModelElement associatedModelElement) Associates all contained attributes with the specified model element.
-
Constructor Details
-
AttributeSet
Constructs an attribute set with a given name and specified components.- Parameters:
name- the name of the attribute setpreEvents- the events to execute before propertiesproperties- the properties in this attribute setpostEvents- the events to execute after properties
-
AttributeSet
Constructs an attribute set with a given name and empty event/property collections.- Parameters:
name- the name of the attribute set
-
AttributeSet
public AttributeSet()Constructs an attribute set with a generated default name and empty components.
-
-
Method Details
-
setAssociatedModelElement
Associates all contained attributes with the specified model element. Typically called during initialisation.- Parameters:
associatedModelElement- the model element to associate with
-
getName
- Returns:
- the name of this attribute set
-
getPreEvents
- Returns:
- the pre-event attributes of this set
-
getProperties
- Returns:
- the property attributes of this set
-
getPostEvents
- Returns:
- the post-event attributes of this set
-
run
Executes all attributes in the prescribed order:- Pre-events (conditionally triggered)
- Properties (always executed)
- Post-events (conditionally triggered)
If any attribute is marked for recording, its value or triggered state is stored in the provided
AttributeSetResultscontainer for this tick.- Parameters:
attributeSetResults- the results object used to collect recorded values
-
deepCopy
- Specified by:
deepCopyin interfaceDeepCopyable<AttributeSet>
-