Class ReadOnlyResultsForEnvironment

java.lang.Object
modelarium.results.readonly.ReadOnlyResultsForEnvironment

public final class ReadOnlyResultsForEnvironment extends Object
Class for providing a read-only view of the model's environment-level results.

This class wraps a ResultsForEnvironment instance so that the environment's logs can be queried without being modifiable, with every returned list and map wrapped as unmodifiable.

  • Method Details

    • attributeSetLogCount

      public int attributeSetLogCount()
      Returns the number of attribute set logs recorded for the environment.
      Returns:
      the environment's attribute set log count
    • attributeLogCount

      public int attributeLogCount(String attributeSetName)
      Returns the number of attribute logs recorded in the environment's named attribute set.
      Parameters:
      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 attributeSetName, String attributeName)
      Retrieves the values logged for a single attribute of the environment.
      Parameters:
      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 attributeSetName, String attributeName, Class<T> type)
      Retrieves the values logged for a single attribute of the environment, cast to the given type.
      Type Parameters:
      T - the type the logged values are returned as
      Parameters:
      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 attributeSetName)
      Retrieves the values logged for every attribute in one of the environment's attribute sets.
      Parameters:
      attributeSetName - the name of the attribute set whose logs to retrieve
      Returns:
      an unmodifiable map from attribute name to that attribute's logged values
    • environmentLogs

      public Map<String,Map<String,List<Object>>> environmentLogs()
      Retrieves the values logged for every attribute of the environment.
      Returns:
      an unmodifiable map from attribute set name to a map from attribute name to that attribute's logged values