Class ModelElementResults

java.lang.Object
modelarium.results.ModelElementResults
Direct Known Subclasses:
AgentResults, EnvironmentResults

public class ModelElementResults extends Object
Container class for storing and accessing results from one or more ModelElements, including agents and the environment.

Each model element has an associated AttributeSetCollectionResults instance, which records its attribute outputs over time.

This class provides methods to query and merge results, as well as to disconnect any underlying database resources.

  • Constructor Details

    • ModelElementResults

      public ModelElementResults(List<? extends ModelElement> modelElements)
      Constructs a new results container from a list of model elements.
      Parameters:
      modelElements - the model elements (agents or environment)
    • ModelElementResults

      public ModelElementResults(ModelElement modelElement)
      Constructs a new results container for a single model element.
      Parameters:
      modelElement - the agent or environment to track results for
  • Method Details

    • mergeWith

      public void mergeWith(ModelElementResults otherResults)
      Merges another results object into this one.
      Parameters:
      otherResults - the results to merge
    • getPropertyValues

      public List<Object> getPropertyValues(String modelElementName, String attributeSetName, String propertyName)
      Retrieves the recorded values for a property from a specific attribute set and model element.
      Parameters:
      modelElementName - the name of the agent/environment
      attributeSetName - the name of the attribute set
      propertyName - the name of the property
      Returns:
      a list of recorded property values
    • getPreEventValues

      public List<Boolean> getPreEventValues(String modelElementName, String attributeSetName, String eventName)
      Retrieves the recorded trigger values for a pre-event.
      Parameters:
      modelElementName - the name of the agent/environment
      attributeSetName - the attribute set's name
      eventName - the event's name
      Returns:
      a list of boolean values representing event triggers
    • getPostEventValues

      public List<Boolean> getPostEventValues(String modelElementName, String attributeSetName, String eventName)
      Retrieves the recorded trigger values for a post-event.
      Parameters:
      modelElementName - the name of the agent/environment
      attributeSetName - the attribute set's name
      eventName - the event's name
      Returns:
      a list of boolean values representing event triggers
    • getAttributeSetCollectionResults

      public AttributeSetCollectionResults getAttributeSetCollectionResults(String modelElementName)
      Retrieves the AttributeSetCollectionResults for a specific model element.
      Parameters:
      modelElementName - the model element's name
      Returns:
      the associated attribute results
    • getAttributeSetCollectionResults

      public AttributeSetCollectionResults getAttributeSetCollectionResults(int index)
      Retrieves an AttributeSetCollectionResults by its index.
      Parameters:
      index - the index of the result
      Returns:
      the results at the given index
    • getAttributeSetCollectionSetCount

      public int getAttributeSetCollectionSetCount()
      Returns:
      the number of attribute set collections stored
    • disconnectDatabases

      public void disconnectDatabases()
      Disconnects all underlying databases associated with stored attribute set results. Should be called when results are no longer needed to free resources.