dcegm.interfaces.index_functions

Functions

get_child_state_index_per_states_and_choices(states, ...)

get_state_choice_index_per_discrete_states(states, ...)

Get the state-choice index for a given set of discrete states.

get_state_choice_index_per_discrete_states_and_choices(...)

Get the state-choice index for a given set of discrete states and a choice.

Module Contents

dcegm.interfaces.index_functions.get_child_state_index_per_states_and_choices(states, choices, model_structure)
dcegm.interfaces.index_functions.get_state_choice_index_per_discrete_states(states, map_state_choice_to_index, discrete_states_names)

Get the state-choice index for a given set of discrete states.

Parameters:
  • map_state_choice_to_index (dict) – Mapping from a state-choice tuple to an index.

  • states (dict) – Dictionary of state values.

  • discrete_states_names (list[str]) – Names of discrete state variables.

Returns:

The index corresponding to the given discrete states.

Return type:

int

dcegm.interfaces.index_functions.get_state_choice_index_per_discrete_states_and_choices(model_structure, states, choices)

Get the state-choice index for a given set of discrete states and a choice.

Parameters:
  • model_structure (dict) – Model structure containing all information on the structure of the model.

  • states (dict) – Dictionary containing discrete states and the choice.

Returns:

The index corresponding to the specified discrete states and choice.

Return type:

int