Class AttributeSetCollectionResults

java.lang.Object
modelarium.attributes.results.AttributeSetCollectionResults

public class AttributeSetCollectionResults extends Object
Holds the result containers for all AttributeSet instances associated with a single model element (e.g. an agent or the environment).

This class provides access to individual AttributeSetResults, indexed both by name and position. It is created during model setup and reused during each tick for recording attribute values.

  • Constructor Details

    • AttributeSetCollectionResults

      public AttributeSetCollectionResults()
  • Method Details

    • setup

      public void setup(String modelElementName, List<AttributeSet> attributeSets)
      Prepares this result container for a given model element and its attribute sets.
      Parameters:
      modelElementName - the name of the owning agent or environment
      attributeSets - the list of attribute sets to track results for
    • getAttributeSetResults

      public AttributeSetResults getAttributeSetResults(String attributeSetName)
      Retrieves the results object for a given attribute set name.
      Parameters:
      attributeSetName - the name of the attribute set
      Returns:
      the associated AttributeSetResults
    • getAttributeSetResults

      public AttributeSetResults getAttributeSetResults(int index)
      Retrieves the results object by index.
      Parameters:
      index - the index of the attribute set
      Returns:
      the corresponding AttributeSetResults
    • getAttributeSetCount

      public int getAttributeSetCount()
      Returns:
      the number of attribute sets tracked in this collection
    • getModelElementName

      public String getModelElementName()
      Returns:
      the name of the model element this result set belongs to
    • disconnectDatabases

      public void disconnectDatabases()
      Closes and clears all result databases associated with this collection.

      This should be called when the simulation ends or when the data is no longer needed.