Class InMemorySimulationResourceManager

java.lang.Object
gov.nasa.jpl.aerie.merlin.driver.resources.InMemorySimulationResourceManager
All Implemented Interfaces:
SimulationResourceManager

public class InMemorySimulationResourceManager extends Object implements SimulationResourceManager
A variant of the SimulationResourceManager that keeps all segments in memory
  • Constructor Details

    • InMemorySimulationResourceManager

      public InMemorySimulationResourceManager()
    • InMemorySimulationResourceManager

      public InMemorySimulationResourceManager(InMemorySimulationResourceManager other)
  • Method Details

    • clear

      public void clear()
      Clear out the Resource Manager's cache of Resource Segments
    • computeProfiles

      public ResourceProfiles computeProfiles(gov.nasa.jpl.aerie.merlin.protocol.types.Duration elapsedDuration)
      Compute all ProfileSegments stored in this resource manager.
      Specified by:
      computeProfiles in interface SimulationResourceManager
      Parameters:
      elapsedDuration - the amount of time elapsed since the start of simulation.
    • computeProfiles

      public ResourceProfiles computeProfiles(gov.nasa.jpl.aerie.merlin.protocol.types.Duration elapsedDuration, Set<String> resources)
      Compute a subset of the ProfileSegments stored in this resource manager
      Specified by:
      computeProfiles in interface SimulationResourceManager
      Parameters:
      elapsedDuration - the amount of time elapsed since the start of simulation.
      resources - the set of names of the resources to be computed
    • acceptUpdates

      public void acceptUpdates(gov.nasa.jpl.aerie.merlin.protocol.types.Duration elapsedTime, Map<String,Pair<gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema,gov.nasa.jpl.aerie.merlin.protocol.types.RealDynamics>> realResourceUpdates, Map<String,Pair<gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema,gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue>> discreteResourceUpdates)
      Add new segments to this manager's internal store of segments.
      Specified by:
      acceptUpdates in interface SimulationResourceManager
      Parameters:
      elapsedTime - the amount of time elapsed since the start of simulation. Must be monotonically increasing on subsequent calls.
      realResourceUpdates - the set of updates to real resources. Up to one update per resource is permitted.
      discreteResourceUpdates - the set of updates to discrete resources. Up to one update per resource is permitted.