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

DecisionModule does not accumulate state #333

Closed
willu47 opened this issue Mar 27, 2019 · 2 comments
Closed

DecisionModule does not accumulate state #333

willu47 opened this issue Mar 27, 2019 · 2 comments
Assignees
Labels

Comments

@willu47
Copy link
Member

willu47 commented Mar 27, 2019

We are dealing with system state in an inconsistent manner, which means that while pre-specified planning decisions are included in every year of the state file, outputs from previous years of a decision module are not rewritten to a state file.

Solutions:

TLDR; either write separately and read in a bundle, or read separately and write in a bundle;

  1. only write pre-specified planning in base timestep state file and accumulate state through successive years for each decision iteration/timestep path followed, rewriting only the current decisions in each state file, reading them all in through the data_handle.get_state method
  2. the statefile in each timestep holds the complete history, so only the most recent statefile is needed to see a history of all the interventions that took place in a particular timestep/iteration path.
@willu47
Copy link
Member Author

willu47 commented Mar 27, 2019

In chat with Tom:

  • data_handle.get_state should read state from three sources - initial conditions, pre-specified planning and decision_module decisions
  • decision module needs to read the state in the previous year (consisting of only available interventions and accumulated from the base year) and write state for the current decision timestep

@willu47
Copy link
Member Author

willu47 commented Mar 27, 2019

Methods to tidy up include:

data_layer/*/*_data_store.py

  • read_strategy_interventions
  • read_initial_conditions

data_layer/store.py

  • read_strategies
  • read_all_initial_conditions
  • read_strategy_interventions

decisions/decision.py

  1. Strip out all concept of multiple strategies and pre-specified planning - both initial conditions and pre-specified planning can be handled using the existing concept of state. They should be read in and filtered by the get_state method for the current timestep.
    • this may require interventions to drop lifetime attribute, and the state to be pre-computed so that an intervention is present in the state for each timestep during its lifetime
  2. Decision module creates a register of available interventions. These should contain the set of interventions minus the subset of interventions installed in pre-specified and initial condition states.
  3. Decision module requires access to previous timestep/iteration state. (results_handle should provide read only access to state from previous timestep/iterations #334)
  4. DecisionManager get_and_save_decisions writes state for the current timestep which excludes pre-specified and initial_conditions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant