Package modelarium.results.readonly
Class ReadOnlyResultsForAgents
java.lang.Object
modelarium.results.readonly.ReadOnlyResultsForAgents
Class for providing a read-only view of the model's agent-level results.
This class wraps a ResultsForAgents instance so that agent logs can be queried without being
modifiable, with every returned list and map wrapped as unmodifiable.
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of agents with logs in the results.Retrieves the values logged for every attribute of an agent.allLogs()Retrieves the values logged for every attribute of every agent in the model.intattributeLogCount(String agentName, String attributeSetName) Returns the number of attribute logs recorded in the named agent's named attribute set.attributeLogs(String agentName, String attributeSetName, String attributeName) Retrieves the values logged for a single attribute of an agent.<T> List<T> attributeLogs(String agentName, String attributeSetName, String attributeName, Class<T> type) Retrieves the values logged for a single attribute of an agent, cast to the given type.intattributeSetLogCount(String agentName) Returns the number of attribute set logs recorded for the named agent.attributeSetLogs(String agentName, String attributeSetName) Retrieves the values logged for every attribute in one of an agent's attribute sets.
-
Method Details
-
agentLogCount
public int agentLogCount()Returns the number of agents with logs in the results.- Returns:
- the agent log count
-
attributeSetLogCount
Returns the number of attribute set logs recorded for the named agent.- Parameters:
agentName- the name of the agent whose logs to count- Returns:
- the agent's attribute set log count
-
attributeLogCount
Returns the number of attribute logs recorded in the named agent's named attribute set.- Parameters:
agentName- the name of the agent whose logs to countattributeSetName- the name of the attribute set whose logs to count- Returns:
- the attribute set's attribute log count
-
attributeLogs
Retrieves the values logged for a single attribute of an agent.- Parameters:
agentName- the name of the agent the attribute belongs toattributeSetName- the name of the attribute set the attribute belongs toattributeName- the name of the attribute whose values to retrieve- Returns:
- an unmodifiable list of the attribute's logged values, one per tick
-
attributeLogs
public <T> List<T> attributeLogs(String agentName, String attributeSetName, String attributeName, Class<T> type) Retrieves the values logged for a single attribute of an agent, cast to the given type.- Type Parameters:
T- the type the logged values are returned as- Parameters:
agentName- the name of the agent the attribute belongs toattributeSetName- the name of the attribute set the attribute belongs toattributeName- the name of the attribute whose values to retrievetype- the class to cast each logged value to- Returns:
- an unmodifiable list of the attribute's logged values, one per tick
-
attributeSetLogs
Retrieves the values logged for every attribute in one of an agent's attribute sets.- Parameters:
agentName- the name of the agent the attribute set belongs toattributeSetName- the name of the attribute set whose logs to retrieve- Returns:
- an unmodifiable map from attribute name to that attribute's logged values
-
agentLogs
Retrieves the values logged for every attribute of an agent.- Parameters:
agentName- the name of the agent whose logs to retrieve- Returns:
- an unmodifiable map from attribute set name to a map from attribute name to that attribute's logged values
-
allLogs
Retrieves the values logged for every attribute of every agent in the model.- Returns:
- an unmodifiable map from agent name to a map from attribute set name to a map from attribute name to that attribute's logged values
-