Changes to ActivityCodelet and ActivityTrackingCodelet #21
Merged
andre-paraense merged 4 commits intomasterfrom Nov 18, 2020
Merged
Changes to ActivityCodelet and ActivityTrackingCodelet #21andre-paraense merged 4 commits intomasterfrom
andre-paraense merged 4 commits intomasterfrom
Conversation
…onSequencePlan and ActionStep) to include a way for executed ActionSteps to conclude the plan, after the ActivityTrackingCodelet has advanced to the following ActionStep. This is necessary, usually, to set the MotorCodelet to null, after the ActionStep was concluded.
src/main/java/br/unicamp/meca/system1/codelets/ActivityCodelet.java
Outdated
Show resolved
Hide resolved
src/main/java/br/unicamp/meca/system1/codelets/ActivityTrackingCodelet.java
Outdated
Show resolved
Hide resolved
Conflicts: src/main/java/br/unicamp/meca/system1/codelets/ActivityCodelet.java
andre-paraense
requested changes
Nov 18, 2020
src/main/java/br/unicamp/meca/system1/codelets/ActivityTrackingCodelet.java
Outdated
Show resolved
Hide resolved
|
Code Climate has analyzed commit 1079a8c and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 97.2% (90% is the threshold). This pull request will bring the total coverage in the repository to 61.3% (1.7% change). View more on Code Climate. |
andre-paraense
approved these changes
Nov 18, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(and also ActionSequencePlan and ActionStep) to include a way for executed ActionSteps to conclude the plan, after the ActivityTrackingCodelet has advanced to the following ActionStep. This is necessary, usually, to set the MotorCodelet to null, after the ActionStep was concluded.
Why was it necessary?
In MECA 0.4.2, when an ActionSequencePlan is advanced by ActivityTrackingCodelet, the advance to a new step does not allow the conclusion of the old step, usually setting the MotorCodelet to null. This leads to an erroneous behavior, where the MotorCodelet still holds traces of the old step, which is not necessary anymore. In this new code, as soon as the ActivityTrackingCodelet advances to a new ActionStep, it marks the old ActionStep as in need of a conclusion. Then, the ActivityCodelet can detect this situation e provide the finalization of the old step.
How was it done?
We include two flags in the ActionStep: executed and needsConclusion. As soon as the ActivityTrackingCodelet advances to a new ActionStep, it sets the executed and needsConclusion flags to true. With this aid, the ActivityCodelet can detect this situation, and call a new doConclusion() procedure, which provides this finalization, allowing the cleaning of a finished ActionStep.
Implementation details
We created a new abstract method doConclusion which every ActivityCodelet will have to implement, in order to provide this cleaning code. This method is called just once, after que ActivityTrackingCodelet advances to a new ActionStep. The main changes were on ActivityTrackingCodelet, ActivityCodelet, ActionStep and ActionSequencePlan, in order to implement this new mechanism for finalization.
How to test?
New tests were included in the Testing code in order to test all these new functionalities.
Future works
No further development is necessary for this issue.