-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ForEach activity template parameter from anchor #546
ForEach activity template parameter from anchor #546
Conversation
933567d
to
7c63501
Compare
7c63501
to
15f58cd
Compare
15f58cd
to
34f0188
Compare
@adrienmaillard provided the following examples for the Banananation model: export default () =>
Goal.CoexistenceGoal({
forEach: ActivityExpression.ofType(ActivityTypes.GrowBanana),
activityTemplate: growBananaActivity =>
ActivityTemplates.PickBanana({ quantity: growBananaActivity.parameters.quantity }),
startsAt: TimingConstraint.singleton(WindowProperty.END).plus(Temporal.Duration.from({ minutes: 5 })),
}); export default () =>
Goal.CoexistenceGoal({
forEach: ActivityExpression.ofType(ActivityTypes.GrowBanana),
activityTemplate: growBananaActivity =>
ActivityTemplates.ChangeProducer({
producer: Discrete.Resource('/producer').valueAt(growBananaActivity.span().starts()),
}),
startsAt: TimingConstraint.singleton(WindowProperty.END).plus(Temporal.Duration.from({ minutes: 5 })),
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a review of the constraints side of things. I won't have time to go through all of the scheduler things today. Nice work!
constraints/src/main/java/gov/nasa/jpl/aerie/constraints/model/Profile.java
Outdated
Show resolved
Hide resolved
constraints/src/main/java/gov/nasa/jpl/aerie/constraints/time/Spans.java
Outdated
Show resolved
Hide resolved
constraints/src/main/java/gov/nasa/jpl/aerie/constraints/time/Windows.java
Show resolved
Hide resolved
constraints/src/main/java/gov/nasa/jpl/aerie/constraints/time/Spans.java
Outdated
Show resolved
Hide resolved
constraints/src/main/java/gov/nasa/jpl/aerie/constraints/tree/AssignGaps.java
Outdated
Show resolved
Hide resolved
constraints/src/main/java/gov/nasa/jpl/aerie/constraints/tree/ListExpressionAt.java
Show resolved
Hide resolved
constraints/src/main/java/gov/nasa/jpl/aerie/constraints/tree/ListExpressionAt.java
Show resolved
Hide resolved
constraints/src/main/java/gov/nasa/jpl/aerie/constraints/tree/ValueAt.java
Outdated
Show resolved
Hide resolved
constraints/src/main/java/gov/nasa/jpl/aerie/constraints/tree/ValueAt.java
Outdated
Show resolved
Hide resolved
merlin-server/constraints-dsl-compiler/src/libs/mission-model-generated-code.ts
Show resolved
Hide resolved
9b44bd9
to
094c837
Compare
094c837
to
f3f6c3a
Compare
f3f6c3a
to
d52594e
Compare
d52594e
to
66ef552
Compare
Conflicts carry EvaluationEnvironment to solver Activity expression implements Expression<Spans> As a result of the immediate above, aerie lander have been commented out, the constraints language do not have enough components to write the goals.
66ef552
to
3ab6974
Compare
Conflicts carry EvaluationEnvironment to solver Activity expression implements Expression<Spans> As a result of the immediate above, aerie lander have been commented out, the constraints language do not have enough components to write the goals.
…from-anchro' into 443-activity-template-parameter-from-anchro
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noice
Resolves #443
Resolves #445
Description
Features
ForEachActivity
pattern where an alias is defined for the coexistence goal and the activity template is a function of anActivityInstance
(from the constraints eDSL) with this alias as a parameter. This allows to express the reference to the anchoring activity to the backend and to evaluate expressions.SerializedValue
anymore.valueAt(profile, spans):DiscreteProfile
is a new expression returning the value of a profile at a specific time. In this case, the passed spans must be a single instant. I believe this solves Choose the parameter of a “to be scheduled activity” based on a resource #445.Fixes/changes:
AssignGaps
now evaluates on the forever horizon.ActivityInstance
(in scheduler-driver) has been refactored into a record.CoexistenceGoal
now takes anExpression<Spans>
as inputActivityExpression
now implementsExpressions<Spans>
so it can be used byCoexistenceGoal
CoexistenceGoal
takes anExpression<Spans>
,AerieLander
tests have been commented. The constraints does not have the necessary expressive power yet to express what was expressed in these tests.Verification
A few tests were added but more are needed. I just want this PR to start.
Documentation
Probably quite a lot of scheduling doc has to be updated.
Future work