Package modelarium.results
Class ModelElementResults
java.lang.Object
modelarium.results.ModelElementResults
- Direct Known Subclasses:
AgentResults,EnvironmentResults
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 Summary
ConstructorsConstructorDescriptionModelElementResults(List<? extends ModelElement> modelElements) Constructs a new results container from a list of model elements.ModelElementResults(ModelElement modelElement) Constructs a new results container for a single model element. -
Method Summary
Modifier and TypeMethodDescriptionvoidDisconnects all underlying databases associated with stored attribute set results.getAttributeSetCollectionResults(int index) Retrieves anAttributeSetCollectionResultsby its index.getAttributeSetCollectionResults(String modelElementName) Retrieves theAttributeSetCollectionResultsfor a specific model element.intgetPostEventValues(String modelElementName, String attributeSetName, String eventName) Retrieves the recorded trigger values for a post-event.getPreEventValues(String modelElementName, String attributeSetName, String eventName) Retrieves the recorded trigger values for a pre-event.getPropertyValues(String modelElementName, String attributeSetName, String propertyName) Retrieves the recorded values for a property from a specific attribute set and model element.voidmergeWith(ModelElementResults otherResults) Merges another results object into this one.
-
Constructor Details
-
ModelElementResults
Constructs a new results container from a list of model elements.- Parameters:
modelElements- the model elements (agents or environment)
-
ModelElementResults
Constructs a new results container for a single model element.- Parameters:
modelElement- the agent or environment to track results for
-
-
Method Details
-
mergeWith
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/environmentattributeSetName- the name of the attribute setpropertyName- 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/environmentattributeSetName- the attribute set's nameeventName- 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/environmentattributeSetName- the attribute set's nameeventName- the event's name- Returns:
- a list of boolean values representing event triggers
-
getAttributeSetCollectionResults
Retrieves theAttributeSetCollectionResultsfor a specific model element.- Parameters:
modelElementName- the model element's name- Returns:
- the associated attribute results
-
getAttributeSetCollectionResults
Retrieves anAttributeSetCollectionResultsby 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.
-