NASA-AMMOS / aerie

A software framework for modeling spacecraft.
https://nasa-ammos.github.io/aerie-docs/
MIT License
73 stars 19 forks source link

Define a goal type that instantiates one single activity #994

Closed jmdelfa closed 1 year ago

jmdelfa commented 1 year ago

Checked for duplicates

Yes - I've already checked

Alternatives considered

Yes - and alternatives don't suffice

Related problems

No response

Describe the feature request

I want to add the capability to express a goal that results in the instantiation of one single activity. The use should be able to add logic or temporal conditions to the goal such as indicating the specific interval at where the activity should be place (for example a direct to earth communication from the rover at the end of a sol)

jmdelfa commented 1 year ago

CoexistenceGoal can be used to place a goal within an interval determined by certain condition. It is therefore proposed to close the ticket:

export default () =>
  Goal.CoexistenceGoal({
    forEach: Real.Resource('/fruit').greaterThan(1.0),
    activityTemplate: interval =>
      ActivityTemplates.BiteBanana({
        biteSize: 1,
      }),
    startsWithin: TimingConstraint.range(WindowProperty.END, Operator.PLUS, Temporal.Duration.from( { minutes: 5 })),
  });
mattdailis commented 1 year ago

Before closing this ticket, let's do the following:

jmdelfa commented 1 year ago

Updated example to place a single activity at a time instant:

export default () => Goal.CoexistenceGoal({
  forEach: Windows.Value(true, Interval.At(Temporal.Instant.from("2021-01-01T05:00:00.000Z"))).assignGaps(false),
  activityTemplate: (span) => ActivityTemplates.PeelBanana({peelDirection: "fromStem"}),
  startsAt: TimingConstraint.singleton(WindowProperty.START)
})

I will proceed now to upload two additional tests in SchedulingIntegrationTests and update the documentation