Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(controller): 2 - add planner functions to select the next step for the controller #303

Closed
wants to merge 14 commits into from

Conversation

hollandjg
Copy link
Member

Description

Added functions for planning the next step in the AER cycle, based on the current state.

This is part of the solution to:

This builds on:

Type of change:

  • New feature (non-breaking change which adds functionality)

Features:

  • Add a new concept – the Planner – which takes in an arbitrary cycle state and returns the name of a step (i.e. experimentalist, experiment_runner, theorist, full_cycle or any other name the experiment might understand)
  • Add a Planner full_cycle_planner which returns just the string "full_cycle"
  • Add a Planner last_result_kind_planner which returns the correct operation based on the last result.
  • Add a Planner random_operation_planner which returns one of the steps at random

Copy link
Collaborator

@musslick musslick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Just one small suggestions which may deserve to be addressed in another PR. It would be great to add a "customizable planner" in which the user can simply pass a transition function to determine which kind of state leads to which execution of an expeirmentalist/theorist.
For instance, if there are no observations available, then we specify to execute experimentalist1. If observations and theories are available, then we specify to execute experimentalist2. I wonder which way might be the best so specify that (e.g., a transition matrix).

Copy link
Collaborator

@gtdang gtdang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@hollandjg
Copy link
Member Author

This looks great! Just one small suggestions which may deserve to be addressed in another PR. It would be great to add a "customizable planner" in which the user can simply pass a transition function to determine which kind of state leads to which execution of an expeirmentalist/theorist.
For instance, if there are no observations available, then we specify to execute experimentalist1. If observations and theories are available, then we specify to execute experimentalist2. I wonder which way might be the best so specify that (e.g., a transition matrix).

Yes, at the moment you'd have to define a planner function like on line 425 in the example init.py which will have complete access to the state object, whatever it is. It's also perfectly fine to duplicate and modify the planners in the planner.py file if you want a different state-transition matrix but the same kind of set-up.

There isn't an abstract representation of "states" like has a theory, has more than two theories, has no data which we could use for a general function, but if someone can work one out based on the state objects (or a different state object with a similar interface) then we could include that.

@hollandjg hollandjg changed the title feature: add planner functions to select the next step for the controller feature(controller): 2 - add planner functions to select the next step for the controller Apr 6, 2023
@hollandjg
Copy link
Member Author

this is too big. Closing for now, will move this to a separate repo. Thanks for the feedback!

@hollandjg hollandjg closed this Apr 20, 2023
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.

3 participants