ActivityTypes as activity type paremeters #1280
Replies: 4 comments 7 replies
-
This work also allows for scheduling goals to be written with activity presets as demonstrated below:
One downside of my current prototype is that you cannot tell if an activity was produced via a preset since we do not have separate directives for each of the children. |
Beta Was this translation helpful? Give feedback.
-
@Alexander-Da-Great here's what I had in mind in terms of leveraging existing functionality: https://github.com/NASA-AMMOS/aerie/compare/example/activity-type-as-parameter I'll add my notes from this morning's meeting - though I think you had a better list of open questions Notes from our meeting this morning:
Open questions:
|
Beta Was this translation helpful? Give feedback.
-
Could you describe the "override" use case one more time? I want to make sure I understand how that mechanic is expected to work |
Beta Was this translation helpful? Give feedback.
-
Comment to address the questions at the end of the first post:
|
Beta Was this translation helpful? Give feedback.
-
Problem
Currently aerie does not have infrastructure to make expressing parent activity types (activities which call other activities within their effect model) easy when trying to interact with the parameters of child activity calls. The current method of allowing users to control parameters used in child activity calls requires activity authors to create a parameter at the level of a parent just to pass through information to a child. For a small number of parameters this is not an issue, however, in cases where child activities have a few dozen or more parameters it quickly becomes difficult to write parent activities that have to duplicate many dozen parameters just to call child activities. The need to manually add parameters to the parent level creates complication / additional work for maintaining the definitions of these activities and opens up the possibility of typos at the definition or implementation for all this non-unique information.
Proposed Solution
One solution is to add support in the aerie core to auto-generate value mappers for activity types as part of the mission model processor. After generating value mappers for every activity type in a model, an activity author can create a parent activity type with parameters that are themselves activity types. This paradigm simplifies parent activity types greatly and makes them much easier to maintain. In addition, we can now clearly outline which parameters are used for parent level effect modeling and which are used to pass through info to child activity calls since the pass through information will just be an activity type parameter.
Prototype Demo
I have created a fork of the aerie repo to demo my approach. The main additions made to the code base include the addition of typeRules for activity types so that parameters can be processed correctly as well as the generation of value mappers for each activity type in a parallel way to how the ActivtyType Mappers are generated.
In addition to the core changes, I have forked the aerie-ui repo to demo UI support for using presets to update activity type parameters. To inform the UI whether a parameter is an activity type I include a new field to the activity type parameter metadata which is added via the getValueSchema method of the activity value mappers. For activity type parameters an additional SearchableDropdown will appear in the UI to which is populated with the presets for the activity in question. When a user selects a preset an event is kicked off which grabs the arguments for said preset and uses them to update the parameter.
Since presets are attached to directives I decided to only allow the selection of presets when interacting with activity type parameters and not allow addition, deletion, or editing of presets.
Selected Activity Interface:
Below we can see that activity type parameters have drop downs for presets. Also, compound types such as lists of activity types are valid parameters as seen with
biteBananaActivity
When you select a preset, in this case 'Tip' we see that the activity arguments for
peelBananaActivity
have changed such thatpeelDirection
is nowfromTip
After simulating we can see that
biteBananaActivity
andpeelBananaActivity
were successfully used to call their corresponding child activities.This is what a parent activity implementation for
RussianBanana
looks like with these changes:Potential Issues
Next Steps
After a discussion between @mattdailis, @bradNASA , @Mythicaeda, @joswig and @Alexander-Da-Great we have a list of questions that need to be answered before going forward with the prototype.
Beta Was this translation helpful? Give feedback.
All reactions