Refine joint decision sequential action mode#219
Conversation
…current event buffer implementation
Codecov Report
@@ Coverage Diff @@
## v0.2 #219 +/- ##
==========================================
- Coverage 64.01% 63.99% -0.02%
==========================================
Files 114 114
Lines 5605 5602 -3
==========================================
- Hits 3588 3585 -3
Misses 2017 2017
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
…sion_sequential_action_mode_refine
Jinyu-W
left a comment
There was a problem hiding this comment.
What situation is this mode for?
| # Ignore following pending events that have no action matched. | ||
| pending_event.state = EventState.FINISHED | ||
| else: | ||
| # Set the state as executing, so event buffer will not pop them again. |
There was a problem hiding this comment.
same as joint mode, that pop all pending decision event at one time, not sequentially, it expect an action list that size is same as decision event. With this change, joint mode can accept actions one by one, and assign the to decision events in the same order, until all decision events get an action.
| for i, pending_event in enumerate(pending_events): | ||
| if i >= len(actions): | ||
| if self._decision_mode == DecisionMode.Joint: | ||
| # Ignore following pending events that have no action matched. |
There was a problem hiding this comment.
So for the Joint Mode, if we have 5 decision events and receive only 3 actions, we map these 3 actions to the first 3 decision events? and directly mark treat the late 2 decision events as finished without any operation?
There was a problem hiding this comment.
yes, joint mode expect an action list.
There was a problem hiding this comment.
And with new mode, we can pop the last 2 decision event again, as we will not mark them as finished.
| pending_events[i].state = EventState.FINISHED | ||
| if self._decision_mode == DecisionMode.Sequential: | ||
| # Generate a new atom event first. | ||
| action_event = self._event_buffer.gen_action_event(self._tick, actions) |
There was a problem hiding this comment.
for Sequential mode, the actions is a List?
There was a problem hiding this comment.
just wrap it as a list, make it same with joint mode, also it can be an action list in sequential mode, we have no requirement at sequential mode.
Description
Changes:
Linked issue(s)/Pull request(s)
Type of Change
Related Component
Has Been Tested
Needs Follow Up Actions
Checklist