PlanEditAdapter

interface PlanEditAdapter : Plan

Functions

Link copied to clipboard
abstract fun create(directive: Directive<AnyDirective>)

Create a directive in the plan.

Link copied to clipboard
abstract fun delete(id: ActivityDirectiveId)

Remove a directive from the plan, specified by ID.

Link copied to clipboard

Queries all activity directives, deserializing them as AnyDirective.

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

abstract fun <A : Any> directives(type: String?, deserializer: (SerializedValue) -> 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

Get all external events across all derivation groups associated with this plan.

abstract fun events(query: EventQuery): ExternalEvents

Get external events associated with this plan.

Link copied to clipboard
abstract fun generateDirectiveId(): ActivityDirectiveId

Create a unique directive ID.

Link copied to clipboard

Get the latest simulation results.

Link copied to clipboard
abstract fun <V : Any, TL : SerialSegmentOps<V, TL>> resource(name: String, deserializer: (List<Segment<SerializedValue>>) -> TL): TL

Query a resource profile from the external datasets associated with this plan.

Link copied to clipboard
abstract fun simulate(options: SimulateOptions)

Simulate the current plan.

Link copied to clipboard
abstract fun toAbsolute(rel: Duration): Instant

Convert a relative duration to a time instant.

Link copied to clipboard
abstract fun toRelative(abs: Instant): Duration

Convert a time instant to a relative duration (relative to plan start).

Link copied to clipboard
abstract 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.