Record Class SchedulingActivity

java.lang.Object
java.lang.Record
gov.nasa.jpl.aerie.scheduler.model.SchedulingActivity
Record Components:
id - unique id
type - the descriptor for the behavior invoked by this activity instance
startOffset - the time at which this activity instance is scheduled to start
duration - the length of time this activity instances lasts for after its start
arguments - 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

    Constructors
    Constructor
    Description
    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 a SchedulingActivity record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addArgument(String argument, gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue param)
    adds an argument to the activity instance
    boolean
    Returns the value of the anchoredToStart record component.
    gov.nasa.jpl.aerie.types.ActivityDirectiveId
    Returns the value of the anchorId record component.
    Map<String,gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue>
    Returns the value of the arguments record component.
    gov.nasa.jpl.aerie.merlin.protocol.types.Duration
    Returns the value of the duration record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    boolean
    Checks equality but not in name
    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)
     
    fetches the activity with the earliest end time in a list of activity instances
    fetches the activity with the earliest starting time in a list of activity instances
    fetches the activity with the latest end time in a list of activity instances
    fetches the activity with the latest starting time in a list of activity instances
    gov.nasa.jpl.aerie.merlin.protocol.types.Duration
     
    Optional<gov.nasa.jpl.aerie.types.ActivityDirectiveId>
    Returns the id of parent activity if this activity is generated.
    fetches the activity type specification that this instance is based on
    final int
    Returns a hash code value for this object.
    gov.nasa.jpl.aerie.types.ActivityDirectiveId
    id()
    Returns the value of the id record component.
    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)
     
    Returns the value of the name record component.
    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(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.Duration
    Returns the value of the startOffset record component.
    gov.nasa.jpl.aerie.types.ActivityDirectiveId
    Returns the value of the topParent record component.
    Returns a string representation of this record class.
    Returns the value of the type record 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)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a SchedulingActivity record class.
      Parameters:
      id - the value for the id record component
      type - the value for the type record component
      startOffset - the value for the startOffset record component
      duration - the value for the duration record component
      arguments - the value for the arguments record component
      topParent - the value for the topParent record component
      anchorId - the value for the anchorId record component
      anchoredToStart - the value for the anchoredToStart record component
      name - the value for the name record 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

      public SchedulingActivity withNewDirectiveId(gov.nasa.jpl.aerie.types.ActivityDirectiveId id)
    • withNewTopParent

      public SchedulingActivity withNewTopParent(gov.nasa.jpl.aerie.types.ActivityDirectiveId topParent)
    • 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

      public Optional<gov.nasa.jpl.aerie.types.ActivityDirectiveId> getParentActivity()
      Returns the id of parent activity if this activity is generated.
    • getEndTime

      public gov.nasa.jpl.aerie.merlin.protocol.types.Duration getEndTime()
    • getActWithEarliestEndTime

      public static SchedulingActivity getActWithEarliestEndTime(List<SchedulingActivity> acts)
      fetches the activity with the earliest end time in a list of activity instances
      Returns:
      the activity
    • getActWithLatestEndTime

      public static SchedulingActivity getActWithLatestEndTime(List<SchedulingActivity> acts)
      fetches the activity with the latest end time in a list of activity instances
      Returns:
      the activity
    • getActWithEarliestStartTime

      public static SchedulingActivity getActWithEarliestStartTime(List<SchedulingActivity> acts)
      fetches the activity with the earliest starting time in a list of activity instances
      Returns:
      the activity
    • getActWithLatestStartTime

      public static SchedulingActivity getActWithLatestStartTime(List<SchedulingActivity> acts)
      fetches the activity with the latest starting time in a list of activity instances
      Returns:
      the activity
    • getType

      public ActivityType getType()
      fetches the activity type specification that this instance is based on
      Returns:
      the activity type specification that this instance is based on
    • toString

      public String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • equalsInProperties

      public boolean equalsInProperties(SchedulingActivity that)
      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 model
      param - 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public gov.nasa.jpl.aerie.types.ActivityDirectiveId id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • type

      public ActivityType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • startOffset

      public gov.nasa.jpl.aerie.merlin.protocol.types.Duration startOffset()
      Returns the value of the startOffset record component.
      Returns:
      the value of the startOffset record component
    • duration

      public gov.nasa.jpl.aerie.merlin.protocol.types.Duration duration()
      Returns the value of the duration record component.
      Returns:
      the value of the duration record component
    • arguments

      public Map<String,gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue> arguments()
      Returns the value of the arguments record component.
      Returns:
      the value of the arguments record component
    • topParent

      public gov.nasa.jpl.aerie.types.ActivityDirectiveId topParent()
      Returns the value of the topParent record component.
      Returns:
      the value of the topParent record component
    • anchorId

      public gov.nasa.jpl.aerie.types.ActivityDirectiveId anchorId()
      Returns the value of the anchorId record component.
      Returns:
      the value of the anchorId record component
    • anchoredToStart

      public boolean anchoredToStart()
      Returns the value of the anchoredToStart record component.
      Returns:
      the value of the anchoredToStart record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component