Class StreamingSimulationResourceManager

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

public class StreamingSimulationResourceManager extends Object implements SimulationResourceManager
A variant of a SimulationResourceManager that streams resources as needed in order to conserve memory. The way it streams resources is determined by the Consumer passed to it during construction
  • Constructor Details

  • Method Details

    • computeProfiles

      public ResourceProfiles computeProfiles(gov.nasa.jpl.aerie.merlin.protocol.types.Duration elapsedDuration)
      Compute all ProfileSegments stored in this resource manager, and stream them to the database
      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)
      This class streams all resources it has as it accepts updates, so it cannot only compute a subset of ProfileSegments.
      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
      Throws:
      UnsupportedOperationException
    • 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. Will stream all held segments should any resource's number of stored segments exceed the streaming threshold.
      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.