Class AttributeSetResults

java.lang.Object
modelarium.attributes.results.AttributeSetResults

public class AttributeSetResults extends Object
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 Details

    • AttributeSetResults

      public AttributeSetResults(String modelElementName, AttributeSet attributeSet)
      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

      public String getModelElementName()
      Returns:
      the name of the owning model element (agent/environment)
    • getAttributeSetName

      public String getAttributeSetName()
      Returns:
      the name of the attribute set being recorded
    • getPropertyNamesList

      public List<String> getPropertyNamesList()
      Returns:
      list of names of recorded properties
    • getPreEventNamesList

      public List<String> getPreEventNamesList()
      Returns:
      list of names of recorded pre-events
    • getPostEventNamesList

      public List<String> getPostEventNamesList()
      Returns:
      list of names of recorded post-events
    • getPropertyClass

      public Class<?> getPropertyClass(String propertyName)
      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

      public void recordProperty(String propertyName, Object value)
      Records a property value to the backing database for this tick.
      Parameters:
      propertyName - the property to record
      value - the value to store
    • recordPreEvent

      public void recordPreEvent(String eventName, boolean isTriggered)
      Records a pre-event trigger status for this tick.
      Parameters:
      eventName - the pre-event name
      isTriggered - whether it was triggered
    • recordPostEvent

      public void recordPostEvent(String eventName, boolean isTriggered)
      Records a post-event trigger status for this tick.
      Parameters:
      eventName - the post-event name
      isTriggered - whether it was triggered
    • getPropertyValues

      public List<Object> getPropertyValues(String propertyName)
      Retrieves all recorded values for a property.
      Parameters:
      propertyName - the property name
      Returns:
      list of recorded values
    • getPreEventValues

      public List<Boolean> getPreEventValues(String eventName)
      Retrieves all recorded trigger states for a pre-event.
      Parameters:
      eventName - the pre-event name
      Returns:
      list of trigger states per tick
    • getPostEventValues

      public List<Boolean> getPostEventValues(String eventName)
      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.