Class InMemorySimulationResourceManager
java.lang.Object
gov.nasa.jpl.aerie.merlin.driver.resources.InMemorySimulationResourceManager
- All Implemented Interfaces:
SimulationResourceManager
A variant of the SimulationResourceManager that keeps all segments in memory
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptUpdates(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.voidclear()Clear out the Resource Manager's cache of Resource SegmentscomputeProfiles(gov.nasa.jpl.aerie.merlin.protocol.types.Duration elapsedDuration) Compute all ProfileSegments stored in this resource manager.computeProfiles(gov.nasa.jpl.aerie.merlin.protocol.types.Duration elapsedDuration, Set<String> resources) Compute a subset of the ProfileSegments stored in this resource manager
-
Constructor Details
-
InMemorySimulationResourceManager
public InMemorySimulationResourceManager() -
InMemorySimulationResourceManager
-
-
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:
computeProfilesin interfaceSimulationResourceManager- 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:
computeProfilesin interfaceSimulationResourceManager- 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:
acceptUpdatesin interfaceSimulationResourceManager- 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.
-