You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Activity class currently maintains a nextActivity, childActivity and State. The first two make up the list and tree of activities. The first activity being the start and head of the list.
Each time when a (next) activity is executed the start of list is traversed to find the first child and/or sibling and execute that activity. After that the list is searched again from the start to find the next non done activity. The more activities the slower it gets to find them.
Maintaining two second lists nextDoneActivity and childDoneActivity - which contain done activities - gives the benefit that no search has to be done for the first non done activity. However this cannot be implemented as the State member is public and can be modified at any time - causing an element to be in the wrong list. Currently it seems the State is not set outside Activity though.
Many activities have 5+ child activities.
Additionally it seems a chain of activities is never reused(?). The State does not seem to be reset to again execute the same chain of activities(?). This suggests we could perhaps just drop/remove done activities.
Feature request:
No longer let Activity maintain a pointer to the next activity nextActivity. Only an array list of child activities.
Use a top level ActivityChain class that maintains a pointer to a root top level activity. That 'manages' activities.
Let ActivityChain only be responsible for settings the State of activities and their children. Be the main interface to users of activities.
Allow ActivityChain to drop/remove activities once done - or move them to a separate list - or maintain a pointer to first none done activity.
Let Activity maintain a pointer to its current active child. Or drop children once done.
Optionalyl let ActivityChain maintain a stack to all current active activities and their active child activities.
Optionally allow it to maintain stats on i.e. activity execution time.
Interfaces could possible stay as they are if each Activity receives a pointer to the main ActivityChain its part of.
Benefit:
The possibility to ignore done activities.
Avoid traversing a list of 4+ done activities each tick to find that last non done activity - for many actors.
In summary avoid calls to Activity.SkipDoneActivities
Alternative solution:
Make State private and allow it to change to state done only once. So that done activities can be removed.
The text was updated successfully, but these errors were encountered:
The
Activity
class currently maintains anextActivity
,childActivity
andState
. The first two make up the list and tree of activities. The first activity being the start and head of the list.Each time when a (next) activity is executed the start of list is traversed to find the first child and/or sibling and execute that activity. After that the list is searched again from the start to find the next non done activity. The more activities the slower it gets to find them.
Maintaining two second lists
nextDoneActivity
andchildDoneActivity
- which contain done activities - gives the benefit that no search has to be done for the first non done activity. However this cannot be implemented as theState
member is public and can be modified at any time - causing an element to be in the wrong list. Currently it seems theState
is not set outside Activity though.Many activities have 5+ child activities.
Additionally it seems a chain of activities is never reused(?). The
State
does not seem to be reset to again execute the same chain of activities(?). This suggests we could perhaps just drop/remove done activities.Feature request:
nextActivity
. Only an array list of child activities.ActivityChain
class that maintains a pointer to a root top level activity. That 'manages' activities.ActivityChain
only be responsible for settings theState
of activities and their children. Be the main interface to users of activities.ActivityChain
to drop/remove activities once done - or move them to a separate list - or maintain a pointer to first none done activity.Activity
maintain a pointer to its current active child. Or drop children once done.ActivityChain
maintain a stack to all current active activities and their active child activities.Interfaces could possible stay as they are if each Activity receives a pointer to the main ActivityChain its part of.
Benefit:
Activity.SkipDoneActivities
Alternative solution:
State
private and allow it to change to state done only once. So that done activities can be removed.The text was updated successfully, but these errors were encountered: