Class PlanInMemory

java.lang.Object
gov.nasa.jpl.aerie.scheduler.model.PlanInMemory
All Implemented Interfaces:
Plan

public class PlanInMemory extends Object implements Plan
an in-memory solution to a planning problem including a schedule of activities may only be a partial solution to the whole planning problem, ie some goals may be left unsatisfied
  • Field Details

    • evaluation

      protected Evaluation evaluation
      the set of all evaluations posted to the plan note that different solvers may evaluate the same plan differently
  • Constructor Details

    • PlanInMemory

      public PlanInMemory()
      ctor creates a new empty solution plan
    • PlanInMemory

      public PlanInMemory(PlanInMemory other)
  • Method Details

    • duplicate

      public PlanInMemory duplicate()
      Description copied from interface: Plan
      Duplicates a plan
      Specified by:
      duplicate in interface Plan
      Returns:
      the duplicate plan
    • add

      public void add(Collection<SchedulingActivity> acts)
      adds the given activity instances to the scheduled plan solution the provided instances must have start times specified
      Specified by:
      add in interface Plan
      Parameters:
      acts - IN the set of activity instances to schedule into the plan
    • size

      public int size()
    • add

      public void add(SchedulingActivity act)
      adds the given activity instance to the scheduled plan solution the provided instance must have start time specified
      Specified by:
      add in interface Plan
      Parameters:
      act - IN activity instance to schedule into the plan
    • remove

      public void remove(Collection<SchedulingActivity> acts)
      Description copied from interface: Plan
      adds the given activity instances to the scheduled plan solution the provided instances must have start times specified
      Specified by:
      remove in interface Plan
      Parameters:
      acts - IN the set of activity instances to remove from the plan
    • remove

      public void remove(SchedulingActivity act)
      Description copied from interface: Plan
      removes the given activity instance to the scheduled plan solution the provided instance must have start time specified
      Specified by:
      remove in interface Plan
      Parameters:
      act - IN activity instance to remove from the plan
    • getActivitiesByTime

      public List<SchedulingActivity> getActivitiesByTime()
      fetches activities in the plan ordered by start time
      Specified by:
      getActivitiesByTime in interface Plan
      Returns:
      set of all activities in the plan ordered by start time
    • replaceActivity

      public void replaceActivity(SchedulingActivity oldAct, SchedulingActivity newAct)
      Description copied from interface: Plan
      replace and old activity by a new one
      Specified by:
      replaceActivity in interface Plan
      Parameters:
      oldAct - Old Activity
      newAct - New Activity
    • getActivitiesByType

      public Map<ActivityType,List<SchedulingActivity>> getActivitiesByType()
      fetches activities in the plan by type
      Specified by:
      getActivitiesByType in interface Plan
      Returns:
      map of all activities in the plan by type
    • getActivitiesById

      public Map<gov.nasa.jpl.aerie.types.ActivityDirectiveId,SchedulingActivity> getActivitiesById()
      Description copied from interface: Plan
      fetches activities in the plan by id
      Specified by:
      getActivitiesById in interface Plan
      Returns:
      map of all activities in the plan by id
    • getAnchorIds

      public Set<gov.nasa.jpl.aerie.types.ActivityDirectiveId> getAnchorIds()
      Specified by:
      getAnchorIds in interface Plan
      Returns:
      the set of anchors from all activities in the plan
    • getActivities

      public Set<SchedulingActivity> getActivities()
      fetches activities in the plan
      Specified by:
      getActivities in interface Plan
      Returns:
      set of all activities in the plan
    • find

      public Collection<SchedulingActivity> find(ActivityExpression template, gov.nasa.jpl.aerie.constraints.model.SimulationResults simulationResults, gov.nasa.jpl.aerie.constraints.model.EvaluationEnvironment evaluationEnvironment)
      finds activity instances in the plan that meet the given criteria
      Specified by:
      find in interface Plan
      Parameters:
      template - IN the matching criteria to use on activity instances
      Returns:
      collection of instances that match the given template
    • addEvaluation

      public void addEvaluation(Evaluation eval)
      adds a new evaluation to the plan note that different solvers or metrics will have different evaluations for the same plan
      Specified by:
      addEvaluation in interface Plan
      Parameters:
      eval - IN the new evaluation to add to the plan
    • getEvaluation

      public Evaluation getEvaluation()
      fetches evaluation posted to the plan
      Specified by:
      getEvaluation in interface Plan
      Returns:
      evaluation posted to the plan
    • calculateAbsoluteStartOffsetAnchoredActivity

      public gov.nasa.jpl.aerie.merlin.protocol.types.Duration calculateAbsoluteStartOffsetAnchoredActivity(SchedulingActivity act)
      Specified by:
      calculateAbsoluteStartOffsetAnchoredActivity in interface Plan
    • replaceIds

      public PlanInMemory replaceIds(Map<gov.nasa.jpl.aerie.types.ActivityDirectiveId,gov.nasa.jpl.aerie.types.ActivityDirectiveId> map)
      Specified by:
      replaceIds in interface Plan