Record Class SchedulingActivity
java.lang.Object
java.lang.Record
gov.nasa.jpl.aerie.scheduler.model.SchedulingActivity
- Record Components:
id- unique idtype- the descriptor for the behavior invoked by this activity instancestartOffset- the time at which this activity instance is scheduled to startduration- the length of time this activity instances lasts for after its startarguments- arguments are stored in a String/SerializedValue hashmap.topParent- the parent activity if any
public record SchedulingActivity(gov.nasa.jpl.aerie.types.ActivityDirectiveId id, ActivityType type, gov.nasa.jpl.aerie.merlin.protocol.types.Duration startOffset, gov.nasa.jpl.aerie.merlin.protocol.types.Duration duration, Map<String,gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue> arguments, gov.nasa.jpl.aerie.types.ActivityDirectiveId topParent, gov.nasa.jpl.aerie.types.ActivityDirectiveId anchorId, boolean anchoredToStart, String name)
extends Record
Contains all known information about an activity, representing BOTH directive-only information
and instance-only information.
If an activity only has a directive and hasn't been simulated, instance-specific data like duration
will be null. If an activity is generated during simulation and thus doesn't have a directive, directive
ID will be null. Only generated activities can have a non-null parent.
-
Constructor Summary
ConstructorsConstructorDescriptionSchedulingActivity(gov.nasa.jpl.aerie.types.ActivityDirectiveId id, ActivityType type, gov.nasa.jpl.aerie.merlin.protocol.types.Duration startOffset, gov.nasa.jpl.aerie.merlin.protocol.types.Duration duration, Map<String, gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue> arguments, gov.nasa.jpl.aerie.types.ActivityDirectiveId topParent, gov.nasa.jpl.aerie.types.ActivityDirectiveId anchorId, boolean anchoredToStart, String name) Creates an instance of aSchedulingActivityrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArgument(String argument, gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue param) adds an argument to the activity instancebooleanReturns the value of theanchoredToStartrecord component.gov.nasa.jpl.aerie.types.ActivityDirectiveIdanchorId()Returns the value of theanchorIdrecord component.Returns the value of theargumentsrecord component.gov.nasa.jpl.aerie.merlin.protocol.types.Durationduration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanChecks equality but not in namestatic SchedulingActivityfromExistingActivityDirective(gov.nasa.jpl.aerie.types.ActivityDirectiveId id, gov.nasa.jpl.aerie.types.ActivityDirective activity, ActivityType type, gov.nasa.jpl.aerie.merlin.protocol.types.Duration duration) static SchedulingActivityfetches the activity with the earliest end time in a list of activity instancesstatic SchedulingActivityfetches the activity with the earliest starting time in a list of activity instancesstatic SchedulingActivityfetches the activity with the latest end time in a list of activity instancesstatic SchedulingActivityfetches the activity with the latest starting time in a list of activity instancesgov.nasa.jpl.aerie.merlin.protocol.types.DurationOptional<gov.nasa.jpl.aerie.types.ActivityDirectiveId> Returns the id of parent activity if this activity is generated.getType()fetches the activity type specification that this instance is based onfinal inthashCode()Returns a hash code value for this object.gov.nasa.jpl.aerie.types.ActivityDirectiveIdid()Returns the value of theidrecord component.instantiateArguments(Map<String, gov.nasa.jpl.aerie.constraints.tree.ProfileExpression<?>> arguments, gov.nasa.jpl.aerie.merlin.protocol.types.Duration startTime, gov.nasa.jpl.aerie.constraints.model.SimulationResults simulationResults, gov.nasa.jpl.aerie.constraints.model.EvaluationEnvironment environment, ActivityType activityType) name()Returns the value of thenamerecord component.static SchedulingActivityof(gov.nasa.jpl.aerie.types.ActivityDirectiveId id, ActivityType type, gov.nasa.jpl.aerie.merlin.protocol.types.Duration startOffset, gov.nasa.jpl.aerie.merlin.protocol.types.Duration duration, gov.nasa.jpl.aerie.types.ActivityDirectiveId anchorId, boolean anchoredToStart) static SchedulingActivityof(gov.nasa.jpl.aerie.types.ActivityDirectiveId id, ActivityType type, gov.nasa.jpl.aerie.merlin.protocol.types.Duration startOffset, gov.nasa.jpl.aerie.merlin.protocol.types.Duration duration, Map<String, gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue> parameters, gov.nasa.jpl.aerie.types.ActivityDirectiveId topParent, gov.nasa.jpl.aerie.types.ActivityDirectiveId anchorId, boolean anchoredToStart) gov.nasa.jpl.aerie.merlin.protocol.types.DurationReturns the value of thestartOffsetrecord component.gov.nasa.jpl.aerie.types.ActivityDirectiveIdReturns the value of thetopParentrecord component.toString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.withNewAnchor(gov.nasa.jpl.aerie.types.ActivityDirectiveId anchorId, boolean anchoredToStart, gov.nasa.jpl.aerie.merlin.protocol.types.Duration startOffset) withNewDirectiveId(gov.nasa.jpl.aerie.types.ActivityDirectiveId id) withNewDuration(gov.nasa.jpl.aerie.merlin.protocol.types.Duration duration) withNewTopParent(gov.nasa.jpl.aerie.types.ActivityDirectiveId topParent)
-
Constructor Details
-
SchedulingActivity
public SchedulingActivity(gov.nasa.jpl.aerie.types.ActivityDirectiveId id, ActivityType type, gov.nasa.jpl.aerie.merlin.protocol.types.Duration startOffset, gov.nasa.jpl.aerie.merlin.protocol.types.Duration duration, Map<String, gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue> arguments, gov.nasa.jpl.aerie.types.ActivityDirectiveId topParent, gov.nasa.jpl.aerie.types.ActivityDirectiveId anchorId, boolean anchoredToStart, String name) Creates an instance of aSchedulingActivityrecord class.- Parameters:
id- the value for theidrecord componenttype- the value for thetyperecord componentstartOffset- the value for thestartOffsetrecord componentduration- the value for thedurationrecord componentarguments- the value for theargumentsrecord componenttopParent- the value for thetopParentrecord componentanchorId- the value for theanchorIdrecord componentanchoredToStart- the value for theanchoredToStartrecord componentname- the value for thenamerecord component
-
-
Method Details
-
of
public static SchedulingActivity of(gov.nasa.jpl.aerie.types.ActivityDirectiveId id, ActivityType type, gov.nasa.jpl.aerie.merlin.protocol.types.Duration startOffset, gov.nasa.jpl.aerie.merlin.protocol.types.Duration duration, gov.nasa.jpl.aerie.types.ActivityDirectiveId anchorId, boolean anchoredToStart) -
of
public static SchedulingActivity of(gov.nasa.jpl.aerie.types.ActivityDirectiveId id, ActivityType type, gov.nasa.jpl.aerie.merlin.protocol.types.Duration startOffset, gov.nasa.jpl.aerie.merlin.protocol.types.Duration duration, Map<String, gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue> parameters, gov.nasa.jpl.aerie.types.ActivityDirectiveId topParent, gov.nasa.jpl.aerie.types.ActivityDirectiveId anchorId, boolean anchoredToStart) -
withNewDuration
public SchedulingActivity withNewDuration(gov.nasa.jpl.aerie.merlin.protocol.types.Duration duration) -
withNewAnchor
public SchedulingActivity withNewAnchor(gov.nasa.jpl.aerie.types.ActivityDirectiveId anchorId, boolean anchoredToStart, gov.nasa.jpl.aerie.merlin.protocol.types.Duration startOffset) -
withNewDirectiveId
-
withNewTopParent
-
fromExistingActivityDirective
public static SchedulingActivity fromExistingActivityDirective(gov.nasa.jpl.aerie.types.ActivityDirectiveId id, gov.nasa.jpl.aerie.types.ActivityDirective activity, ActivityType type, gov.nasa.jpl.aerie.merlin.protocol.types.Duration duration) -
getParentActivity
Returns the id of parent activity if this activity is generated. -
getEndTime
public gov.nasa.jpl.aerie.merlin.protocol.types.Duration getEndTime() -
getActWithEarliestEndTime
fetches the activity with the earliest end time in a list of activity instances- Returns:
- the activity
-
getActWithLatestEndTime
fetches the activity with the latest end time in a list of activity instances- Returns:
- the activity
-
getActWithEarliestStartTime
fetches the activity with the earliest starting time in a list of activity instances- Returns:
- the activity
-
getActWithLatestStartTime
fetches the activity with the latest starting time in a list of activity instances- Returns:
- the activity
-
getType
fetches the activity type specification that this instance is based on- Returns:
- the activity type specification that this instance is based on
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
equalsInProperties
Checks equality but not in name- Parameters:
that- the other activity instance to compare to- Returns:
- true if they are equal in properties, false otherwise
-
instantiateArguments
public static Map<String,gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue> instantiateArguments(Map<String, gov.nasa.jpl.aerie.constraints.tree.ProfileExpression<?>> arguments, gov.nasa.jpl.aerie.merlin.protocol.types.Duration startTime, gov.nasa.jpl.aerie.constraints.model.SimulationResults simulationResults, gov.nasa.jpl.aerie.constraints.model.EvaluationEnvironment environment, ActivityType activityType) -
addArgument
public void addArgument(String argument, gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue param) adds an argument to the activity instance- Parameters:
argument- specification. must be identical as the one defined in the modelparam- value of the argument
-
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
public gov.nasa.jpl.aerie.types.ActivityDirectiveId id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
startOffset
public gov.nasa.jpl.aerie.merlin.protocol.types.Duration startOffset()Returns the value of thestartOffsetrecord component.- Returns:
- the value of the
startOffsetrecord component
-
duration
public gov.nasa.jpl.aerie.merlin.protocol.types.Duration duration()Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-
arguments
Returns the value of theargumentsrecord component.- Returns:
- the value of the
argumentsrecord component
-
topParent
public gov.nasa.jpl.aerie.types.ActivityDirectiveId topParent()Returns the value of thetopParentrecord component.- Returns:
- the value of the
topParentrecord component
-
anchorId
public gov.nasa.jpl.aerie.types.ActivityDirectiveId anchorId()Returns the value of theanchorIdrecord component.- Returns:
- the value of the
anchorIdrecord component
-
anchoredToStart
public boolean anchoredToStart()Returns the value of theanchoredToStartrecord component.- Returns:
- the value of the
anchoredToStartrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-