Class PlanInMemory
java.lang.Object
gov.nasa.jpl.aerie.scheduler.model.PlanInMemory
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionprotected Evaluationthe set of all evaluations posted to the plan note that different solvers may evaluate the same plan differently -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(SchedulingActivity act) adds the given activity instance to the scheduled plan solution the provided instance must have start time specifiedvoidadd(Collection<SchedulingActivity> acts) adds the given activity instances to the scheduled plan solution the provided instances must have start times specifiedvoidaddEvaluation(Evaluation eval) adds a new evaluation to the plan note that different solvers or metrics will have different evaluations for the same plangov.nasa.jpl.aerie.merlin.protocol.types.DurationDuplicates a planfind(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 criteriafetches activities in the planMap<gov.nasa.jpl.aerie.types.ActivityDirectiveId, SchedulingActivity> fetches activities in the plan by idfetches activities in the plan ordered by start timefetches activities in the plan by typeSet<gov.nasa.jpl.aerie.types.ActivityDirectiveId> fetches evaluation posted to the planvoidremove(SchedulingActivity act) removes the given activity instance to the scheduled plan solution the provided instance must have start time specifiedvoidremove(Collection<SchedulingActivity> acts) adds the given activity instances to the scheduled plan solution the provided instances must have start times specifiedvoidreplaceActivity(SchedulingActivity oldAct, SchedulingActivity newAct) replace and old activity by a new onereplaceIds(Map<gov.nasa.jpl.aerie.types.ActivityDirectiveId, gov.nasa.jpl.aerie.types.ActivityDirectiveId> map) intsize()
-
Field Details
-
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
-
-
Method Details
-
duplicate
Description copied from interface:PlanDuplicates a plan -
add
adds the given activity instances to the scheduled plan solution the provided instances must have start times specified -
size
public int size() -
add
adds the given activity instance to the scheduled plan solution the provided instance must have start time specified -
remove
Description copied from interface:Planadds the given activity instances to the scheduled plan solution the provided instances must have start times specified -
remove
Description copied from interface:Planremoves the given activity instance to the scheduled plan solution the provided instance must have start time specified -
getActivitiesByTime
fetches activities in the plan ordered by start time- Specified by:
getActivitiesByTimein interfacePlan- Returns:
- set of all activities in the plan ordered by start time
-
replaceActivity
Description copied from interface:Planreplace and old activity by a new one- Specified by:
replaceActivityin interfacePlan- Parameters:
oldAct- Old ActivitynewAct- New Activity
-
getActivitiesByType
fetches activities in the plan by type- Specified by:
getActivitiesByTypein interfacePlan- Returns:
- map of all activities in the plan by type
-
getActivitiesById
Description copied from interface:Planfetches activities in the plan by id- Specified by:
getActivitiesByIdin interfacePlan- Returns:
- map of all activities in the plan by id
-
getAnchorIds
- Specified by:
getAnchorIdsin interfacePlan- Returns:
- the set of anchors from all activities in the plan
-
getActivities
fetches activities in the plan- Specified by:
getActivitiesin interfacePlan- 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 -
addEvaluation
adds a new evaluation to the plan note that different solvers or metrics will have different evaluations for the same plan- Specified by:
addEvaluationin interfacePlan- Parameters:
eval- IN the new evaluation to add to the plan
-
getEvaluation
fetches evaluation posted to the plan- Specified by:
getEvaluationin interfacePlan- Returns:
- evaluation posted to the plan
-
calculateAbsoluteStartOffsetAnchoredActivity
public gov.nasa.jpl.aerie.merlin.protocol.types.Duration calculateAbsoluteStartOffsetAnchoredActivity(SchedulingActivity act) - Specified by:
calculateAbsoluteStartOffsetAnchoredActivityin interfacePlan
-
replaceIds
public PlanInMemory replaceIds(Map<gov.nasa.jpl.aerie.types.ActivityDirectiveId, gov.nasa.jpl.aerie.types.ActivityDirectiveId> map) - Specified by:
replaceIdsin interfacePlan
-