Package modelarium.results
Class Results
java.lang.Object
modelarium.results.Results
- All Implemented Interfaces:
DeepCopyable<Results>
- Direct Known Subclasses:
FunctionalResults
Abstract base class for storing and manipulating simulation results.
Encapsulates agent and environment results, including raw data as well as processed or accumulated values. The class supports transitioning to an immutable state after simulation and includes functionality for connecting/disconnecting underlying result databases.
Subclasses must define how agent property and event data are accumulated.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAccumulates agent data over all ticks.protected abstract List<?> accumulateAgentPostEventResults(String attributeSetName, String postEventName, List<?> accumulatedValues, List<Boolean> valuesToBeProcessed) Subclasses must define how to accumulate agent post-event values.protected abstract List<?> accumulateAgentPreEventResults(String attributeSetName, String preEventName, List<?> accumulatedValues, List<Boolean> valuesToBeProcessed) Subclasses must define how to accumulate agent pre-event values.protected abstract List<?> accumulateAgentPropertyResults(String attributeSetName, String propertyName, List<?> accumulatedValues, List<?> valuesToBeProcessed) Subclasses must define how to accumulate agent property values.deepCopy()voidDisconnects all accumulated/processed databases if connected.voidDisconnects all raw and processed databases.voidDisconnects all raw (per-agent and environment) databases if connected.getAccumulatedAgentPostEventValues(String attributeSetName, String eventName) getAccumulatedAgentPreEventValues(String attributeSetName, String eventName) getAccumulatedAgentPropertyValues(String attributeSetName, String propertyName) getAccumulatedEnvironmentPostEventValues(String attributeSetName, String eventName) getAccumulatedEnvironmentPreEventValues(String attributeSetName, String eventName) getAccumulatedEnvironmentPropertyValues(String attributeSetName, String propertyName) Returns a list of all agent names involved in the model.getAgentPostEventValues(String agentName, String attributeSetName, String eventName) getAgentPreEventValues(String agentName, String attributeSetName, String eventName) getAgentPropertyValues(String agentName, String attributeSetName, String propertyName) getEnvironmentPostEventValues(String attributeSetName, String eventName) getEnvironmentPreEventValues(String attributeSetName, String eventName) getEnvironmentPropertyValues(String attributeSetName, String propertyName) voidmergeWithBeforeAccumulation(Results otherResults) Merges agent results from another simulation run prior to accumulation.voidProcesses the environment data across all ticks.protected List<?> processEnvironmentPostEventResults(String attributeName, String eventName, List<?> postEventValues) protected List<?> processEnvironmentPreEventResults(String attributeName, String eventName, List<?> preEventValues) protected List<?> processEnvironmentPropertyResults(String attributeName, String propertyName, List<?> propertyValues) voidseal()Makes this Results instance immutable, preventing further modification.voidsetAgentNames(List<AgentSet> agentSetList) Stores the names of all agents from a list of agent sets.voidsetAgentNames(AgentSet agents) Stores the names of all agents in the model.voidsetAgentResults(AgentResults agentResults) Sets the raw agent results and connects the underlying database.voidsetEnvironmentResults(EnvironmentResults environmentResults) Sets the raw environment results and connects the underlying database.
-
Constructor Details
-
Results
public Results()
-
-
Method Details
-
seal
public void seal()Makes this Results instance immutable, preventing further modification. -
setAgentNames
Stores the names of all agents in the model.- Parameters:
agents- the set of agents
-
setAgentNames
Stores the names of all agents from a list of agent sets.- Parameters:
agentSetList- list of agent sets
-
getAgentNames
Returns a list of all agent names involved in the model.- Returns:
- the list of agent names
-
setAgentResults
Sets the raw agent results and connects the underlying database.- Parameters:
agentResults- the raw agent results
-
setEnvironmentResults
Sets the raw environment results and connects the underlying database.- Parameters:
environmentResults- the raw environment results
-
deepCopy
- Specified by:
deepCopyin interfaceDeepCopyable<Results>
-
getAgentPropertyValues
-
getAgentPreEventValues
-
getAgentPostEventValues
-
getEnvironmentPropertyValues
-
getEnvironmentPreEventValues
-
getEnvironmentPostEventValues
-
getAccumulatedAgentPropertyValues
-
getAccumulatedAgentPreEventValues
-
getAccumulatedAgentPostEventValues
-
getAccumulatedEnvironmentPropertyValues
-
getAccumulatedEnvironmentPreEventValues
-
getAccumulatedEnvironmentPostEventValues
-
disconnectRawDatabases
public void disconnectRawDatabases()Disconnects all raw (per-agent and environment) databases if connected. -
disconnectAccumulatedDatabases
public void disconnectAccumulatedDatabases()Disconnects all accumulated/processed databases if connected. -
disconnectAllDatabases
public void disconnectAllDatabases()Disconnects all raw and processed databases. -
accumulateAgentAttributeData
public void accumulateAgentAttributeData()Accumulates agent data over all ticks. Must be called before accessing accumulated values. -
processEnvironmentAttributeData
public void processEnvironmentAttributeData()Processes the environment data across all ticks. Must be called before accessing processed environment values. -
mergeWithBeforeAccumulation
Merges agent results from another simulation run prior to accumulation.- Parameters:
otherResults- the results to merge into this one
-
accumulateAgentPropertyResults
protected abstract List<?> accumulateAgentPropertyResults(String attributeSetName, String propertyName, List<?> accumulatedValues, List<?> valuesToBeProcessed) Subclasses must define how to accumulate agent property values. -
accumulateAgentPreEventResults
protected abstract List<?> accumulateAgentPreEventResults(String attributeSetName, String preEventName, List<?> accumulatedValues, List<Boolean> valuesToBeProcessed) Subclasses must define how to accumulate agent pre-event values. -
accumulateAgentPostEventResults
protected abstract List<?> accumulateAgentPostEventResults(String attributeSetName, String postEventName, List<?> accumulatedValues, List<Boolean> valuesToBeProcessed) Subclasses must define how to accumulate agent post-event values. -
processEnvironmentPropertyResults
-
processEnvironmentPreEventResults
-
processEnvironmentPostEventResults
-