Skip to content

Changes to ActivityCodelet and ActivityTrackingCodelet #21

Merged
andre-paraense merged 4 commits intomasterfrom
activityCodelet
Nov 18, 2020
Merged

Changes to ActivityCodelet and ActivityTrackingCodelet #21
andre-paraense merged 4 commits intomasterfrom
activityCodelet

Conversation

@rgudwin
Copy link
Copy Markdown
Member

@rgudwin rgudwin commented Nov 17, 2020

(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.

…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.
Conflicts:
	src/main/java/br/unicamp/meca/system1/codelets/ActivityCodelet.java
@qlty-cloud-legacy
Copy link
Copy Markdown

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 andre-paraense merged commit f3a1604 into master Nov 18, 2020
@andre-paraense andre-paraense deleted the activityCodelet branch November 18, 2020 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants