Package modelarium.attributes.results
Class AttributeSetResults
java.lang.Object
modelarium.attributes.results.AttributeSetResults
Stores and manages the recorded results for a single
AttributeSet,
including properties and events marked for recording.
This class is responsible for writing tick-level data to the backing database, and for providing access to stored values after simulation.
-
Constructor Summary
ConstructorsConstructorDescriptionAttributeSetResults(String modelElementName, AttributeSet attributeSet) Constructs the results container for a given attribute set. -
Method Summary
Modifier and TypeMethodDescriptionvoidCloses the underlying database and releases any held resources.getPostEventValues(String eventName) Retrieves all recorded trigger states for a post-event.getPreEventValues(String eventName) Retrieves all recorded trigger states for a pre-event.Class<?> getPropertyClass(String propertyName) Returns the recorded value type of a given property.getPropertyValues(String propertyName) Retrieves all recorded values for a property.voidrecordPostEvent(String eventName, boolean isTriggered) Records a post-event trigger status for this tick.voidrecordPreEvent(String eventName, boolean isTriggered) Records a pre-event trigger status for this tick.voidrecordProperty(String propertyName, Object value) Records a property value to the backing database for this tick.
-
Constructor Details
-
AttributeSetResults
Constructs the results container for a given attribute set.This initialises a backing database and indexes the recorded attributes by name for fast access and later analysis.
- Parameters:
modelElementName- the name of the model element (agent or environment)attributeSet- the attribute set this result container tracks
-
-
Method Details
-
getModelElementName
- Returns:
- the name of the owning model element (agent/environment)
-
getAttributeSetName
- Returns:
- the name of the attribute set being recorded
-
getPropertyNamesList
- Returns:
- list of names of recorded properties
-
getPreEventNamesList
- Returns:
- list of names of recorded pre-events
-
getPostEventNamesList
- Returns:
- list of names of recorded post-events
-
getPropertyClass
Returns the recorded value type of a given property.- Parameters:
propertyName- the name of the property- Returns:
- the class type of the property's values
-
recordProperty
Records a property value to the backing database for this tick.- Parameters:
propertyName- the property to recordvalue- the value to store
-
recordPreEvent
Records a pre-event trigger status for this tick.- Parameters:
eventName- the pre-event nameisTriggered- whether it was triggered
-
recordPostEvent
Records a post-event trigger status for this tick.- Parameters:
eventName- the post-event nameisTriggered- whether it was triggered
-
getPropertyValues
Retrieves all recorded values for a property.- Parameters:
propertyName- the property name- Returns:
- list of recorded values
-
getPreEventValues
Retrieves all recorded trigger states for a pre-event.- Parameters:
eventName- the pre-event name- Returns:
- list of trigger states per tick
-
getPostEventValues
Retrieves all recorded trigger states for a post-event.- Parameters:
eventName- the post-event name- Returns:
- list of trigger states per tick
-
disconnectDatabase
public void disconnectDatabase()Closes the underlying database and releases any held resources.
-