states

class off.states.States(number_of_time_steps: int, number_of_states: int, state_names: list)

Bases: ABC

Abstract state class Provides basic functions for state lists, such as get, set, initialize and iterate

get_all_states() ndarray

Returns state matrix

Returns:

m x n matrix, columns mark different states, rows time steps

get_ind_state(index: int) ndarray

Returns the state at a given index

Parameters:

index (int) – index of the state to return

Returns:

state – 1 x n state vector

Return type:

np.ndarray

get_state_names() list

List with names of the stored states

Returns:

List with the names of the stored states in the corresponding order

Return type:

list

init_all_states(init_state: ndarray)

Copies a given state across all state entries as initialisation. For more advanced initialisation, use set_all_states()

Parameters:

init_state (np.ndarray) – 1 x n vector of init state

iterate_states(new_state: ndarray)

shift_states shifts all states and adds a new entry in first place

Parameters:

new_state – 1 x n vector

Returns:

none

iterate_states_and_keep()

shift_states shifts all states and but keeps the first entry the same

Returns:

none

n_states = 0
n_time_steps = 0
set_all_states(new_states: array)

Overwrites the states with the given matrix.

Parameters:

new_states – m x n matrix with new states, columns mark different states, rows time steps

Returns:

none

set_ind_state(index: int, new_state: ndarray)

Overwrites a state at the given index

Parameters:
  • index (int) – index of state to overwrite

  • new_state (np.ndarray) – 1 x n vector which overwrites the state

state_names = []
states = array([], dtype=float64)