Class ReadOnlyResultsForAgents

java.lang.Object
modelarium.results.readonly.ReadOnlyResultsForAgents

public final class ReadOnlyResultsForAgents extends Object
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 Details

    • agentLogCount

      public int agentLogCount()
      Returns the number of agents with logs in the results.
      Returns:
      the agent log count
    • attributeSetLogCount

      public int attributeSetLogCount(String agentName)
      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

      public int attributeLogCount(String agentName, String attributeSetName)
      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 count
      attributeSetName - the name of the attribute set whose logs to count
      Returns:
      the attribute set's attribute log count
    • attributeLogs

      public List<Object> attributeLogs(String agentName, String attributeSetName, String attributeName)
      Retrieves the values logged for a single attribute of an agent.
      Parameters:
      agentName - the name of the agent the attribute belongs to
      attributeSetName - the name of the attribute set the attribute belongs to
      attributeName - 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 to
      attributeSetName - the name of the attribute set the attribute belongs to
      attributeName - the name of the attribute whose values to retrieve
      type - the class to cast each logged value to
      Returns:
      an unmodifiable list of the attribute's logged values, one per tick
    • attributeSetLogs

      public Map<String,List<Object>> attributeSetLogs(String agentName, String attributeSetName)
      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 to
      attributeSetName - the name of the attribute set whose logs to retrieve
      Returns:
      an unmodifiable map from attribute name to that attribute's logged values
    • agentLogs

      public Map<String,Map<String,List<Object>>> agentLogs(String agentName)
      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

      public Map<String,Map<String,Map<String,List<Object>>>> 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