-
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
1077 persistent anchors #1390
1077 persistent anchors #1390
Conversation
I'm concerned about the e2e test failure:
|
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.
No major problem. Nice testing.
...a/gov/nasa/jpl/aerie/scheduler/constraints/timeexpressions/TimeExpressionRelativeBinary.java
Outdated
Show resolved
Hide resolved
...a/gov/nasa/jpl/aerie/scheduler/constraints/timeexpressions/TimeExpressionRelativeBefore.java
Outdated
Show resolved
Hide resolved
...in/java/gov/nasa/jpl/aerie/scheduler/constraints/timeexpressions/TimeExpressionRelative.java
Outdated
Show resolved
Hide resolved
scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/RecurrenceGoal.java
Outdated
Show resolved
Hide resolved
scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/RecurrenceGoal.java
Outdated
Show resolved
Hide resolved
scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/TestApplyWhen.java
Outdated
Show resolved
Hide resolved
scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/TestApplyWhen.java
Outdated
Show resolved
Hide resolved
.../java/gov/nasa/jpl/aerie/scheduler/worker/services/SchedulingDSLCompilationServiceTests.java
Outdated
Show resolved
Hide resolved
e2e-tests/src/test/java/gov/nasa/jpl/aerie/e2e/SchedulingTests.java
Outdated
Show resolved
Hide resolved
6ef16e5
to
3ef1771
Compare
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.
We're almost there. I'll approve after this last batch.
...er/src/main/java/gov/nasa/jpl/aerie/scheduler/worker/services/SynchronousSchedulerAgent.java
Outdated
Show resolved
Hide resolved
...er/src/main/java/gov/nasa/jpl/aerie/scheduler/worker/services/SynchronousSchedulerAgent.java
Outdated
Show resolved
Hide resolved
scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/TestPersistentAnchor.java
Outdated
Show resolved
Hide resolved
scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/CoexistenceGoal.java
Outdated
Show resolved
Hide resolved
...a/gov/nasa/jpl/aerie/scheduler/constraints/timeexpressions/TimeExpressionRelativeBinary.java
Outdated
Show resolved
Hide resolved
...in/java/gov/nasa/jpl/aerie/scheduler/constraints/timeexpressions/TimeExpressionRelative.java
Outdated
Show resolved
Hide resolved
scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationFacade.java
Outdated
Show resolved
Hide resolved
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.
Looks good now ! thank you.
…ved. All time expressions are actually relative. TimeExpressoinRelatveFixed replaced refactored as TimeExpressionRelativeSimple
…ctiveIds and ActivityDirectiveIds
…methods. Also add a type method returning the AcitivityType of the directive. Changes used in PrioritySolver, MissingActivityTemplateConflict and goals
…d/update anchorIds PersistentTimeAnchor.java adds the three states of an anchor: Disabled, anchoring to start or anchoring to end ActivityExpression.java adds a new matches method to evaluate the time offset considering the absolute time, which is calculated by iteratively navigating the anchors. GraphQLMerlinService.java provides a new method to update the anchorids in a list of activities MerlinService.java adds a new method to update a list of SchedulingActivityDirectives from a plan, replacing the anchorids generated by the scheduler by new anchorids provided by the database Plan.java and PlanInMemory.java provide methods to replace an old activity by a new one
…t. They incorporate the anchorId (if any) and whether the anchor is to Start as information for PrioritySolver.java to solve the conflict
… on anchors. The logic is: 1. If persistentTimeAnchor is disabled, then no anchors are created. There are two scenarios: 1.1 Matching activity found: MissingAssociationConflict created. 1.2 No matching activity found: MissingActivityTemplateConflict created 2. If persistentTimeAnchor is enabled (START or END) then an anchor will be created. There are three scenarios 2.1 Matching activity with anchor found. MissingAssociationConflict created. 2.2 Matching activity found, but only without anchor. MissingAssociationConflict created, passing the ID of the matching activity in order to create the anchor 2.3 No matching activity found: MissingActivityTemplateConflict created
The scenarios are: If existing activity act is a match but is missing the anchor, then the appropriate anchorId has been included in MissingAssociationConflict. In that case, a new activity must be created as a copy of act but including the anchorId. This activity is then added to all appropriate data structures and the association is created If there is no match, a MissingActivityTemplateConflict.java has been created, including the ID of the directive to which the new activity should be anchored. In that case, we calculate the absolute start offset and create the new activity with the anchorid
…c classes and mechanism based on EnumMap to define hierarchically subsystem states for system states
…ned a HashMap. That has been superseded by getBidiAcitivbityIdCorrespondence which uses the new type BidiMap. The old method has been removed and the only call to the getActivityIdCorrespondence, in class SynchronousSchedulerAgent, has been modified to receive a BidiMap and then convert to HashMap so that the existing logic doesn't need to be changed.
ed75820
to
cd3cb33
Compare
Thanks! This had a failing test before but it passed on re-run so I think it was a fluke. Rebased & merging now. |
Description
Inclusion of Persistent Anchors in Coexistence Goal. The anchor definition is optional so that backwards compatibility with older Coexistence Goals is guaranteed. An anchor can be either disabled, to the start of a directive or to its end.
Implementation has focused on mitigating the impact on existing code trying to reuse as much as possible existing AERIE infrastructure. Even so, 40 classes haven been added/modified/deleted. TimeExpression has been heavily re-architected as there were many legacy relations. CoexistenceGoal and PrioritySolver have been modified to account for the indentification and resolution of conflicts related to anchors. The need for new conflict types was explored and discarded for the sake of simplicity.
Verification
Multiple tests have been added, including a dedicated TestPersistentAnchors that explores all possible combinations of anchors and existing/non-existing directives in the plan.
Documentation
No documentation is invalidated. New documentation needs to be produced to explain the anchor behaviour
Future work
This work is self contained and complete. Future extensions such as deeper control on when/how anchors are created should derive from user experience