TypeUtilsEditablePlanAdapter

An EditablePlan implementation for the type-utils Plan class. Allows for local simulation and plan editing, such as for custom scheduler drivers, constraint checkers, or other workflows that don't use the Aerie database. To use, create a SimulationUtility and use that to load the mission model. Then create a Plan object; you can create one with the constructor or by using gov.nasa.jpl.aerie.orchestration.PlanJsonParser to load a plan from file. Then you can create an editable plan object like this: ``` editablePlan = new DefaultEditablePlanDriver( new TypeUtilsEditablePlanAdapter( new TypeUtilsPlanAdapter(myPlan), simUtility, model ) ); ``` You can then edit and simulate the plan using the EditablePlan interface. You can pass it to a scheduling goal, a constraint, or anything else that needs the plan and sim results. The official constraint interface takes an immutable plan and sim results separately, so you can call a constraint like this: `new MyConstraint(...).run(plan, plan.simulate())`. (The EditablePlan will be upcast to the immutable gov.nasa.ammos.aerie.procedural.timeline.plan.Plan interface.

Constructors

Link copied to clipboard
constructor(plan: TypeUtilsPlanAdapter, simUtility: SimulationUtility, model: MissionModel<out Any>)

Functions

Link copied to clipboard
open fun create(@NotNull directive: Directive<AnyDirective>)
Create a directive in the plan.
Link copied to clipboard
open fun delete(@NotNull id: ActivityDirectiveId)
Remove a directive from the plan, specified by ID.
Link copied to clipboard

Queries activity directives, filtered by type, deserializing them as AnyDirective.

@NotNull
open fun <A> directives(@Nullable type: String, @NotNull deserializer: (in SerializedValue) -> out A): Directives<A>
Query activity directives.
Link copied to clipboard
open fun duration(): Duration

The total duration of the plan, whether simulated on the full extent or not.

Link copied to clipboard
@NotNull
open fun events(@NotNull query: EventQuery): ExternalEvents
Get external events associated with this plan.
Link copied to clipboard
@NotNull
open fun generateDirectiveId(): ActivityDirectiveId
Create a unique directive ID.
Link copied to clipboard
Get the latest simulation results.
Link copied to clipboard
@NotNull
open fun <V, TL : SerialSegmentOps<V, TL>?> resource(@NotNull name: String, @NotNull deserializer: (in List<Segment<SerializedValue>>) -> out TL): TL
Query a resource profile from the external datasets associated with this plan.
Link copied to clipboard
open fun simulate(@NotNull options: SimulateOptions)
Simulate the current plan.
Link copied to clipboard
@NotNull
open fun toAbsolute(@NotNull rel: Duration): Instant
Convert a relative duration to a time instant.
Link copied to clipboard
@NotNull
open fun toRelative(@NotNull abs: Instant): Duration
Convert a time instant to a relative duration (relative to plan start).
Link copied to clipboard
@NotNull
open fun totalBounds(): Interval
Total extent of the plan's bounds, whether it was simulated on the full extent or not.
Link copied to clipboard
open fun validate(directive: Directive<AnyDirective>)

Optional validation hook for new activities.