Data Composition

Data composition classes.

class ComposedReward(*rewarders: GlobalReward)[source]

Bases: GlobalReward

Rewarder for composed data types.

This type can be automatically constructed by passing a tuple of rewarders to the environment constructor’s reward argument.

Parameters:

rewarders (GlobalReward) – Global rewarders to compose.

datastore_type

alias of ComposedDataStore

reset_pre_sim_init() None[source]

Handle resetting for all rewarders.

Return type:

None

reset_post_sim_init() None[source]

Handle resetting for all rewarders.

Return type:

None

reset_overwrite_previous() None[source]

Handle resetting for all rewarders.

Return type:

None

Link the rewarder to the scenario.

Parameters:

scenario (Scenario)

Return type:

None

initial_data(satellite: Satellite) ComposedData[source]

Furnsish the datastore with ComposedData.

Parameters:

satellite (Satellite)

Return type:

ComposedData

create_data_store(satellite: Satellite) None[source]

Create a CompositeDataStore for a satellite.

Parameters:

satellite (Satellite)

Return type:

None

calculate_reward(new_data_dict: dict[str, ComposedData]) dict[str, float][source]

Calculate reward for each data type and combine them.

Parameters:

new_data_dict (dict[str, ComposedData])

Return type:

dict[str, float]

reward(new_data_dict: dict[str, ComposedData]) dict[str, float][source]

Return combined reward calculation and update data.

Parameters:

new_data_dict (dict[str, ComposedData])

Return type:

dict[str, float]

class ComposedDataStore(satellite: Satellite, *datastore_types: type[DataStore], initial_data: ComposedData | None = None)[source]

Bases: DataStore

DataStore for composed data types.

Parameters:
  • satellite (Satellite) – Satellite which data is being stored for.

  • datastore_types (type[DataStore]) – DataStore types to compose.

  • initial_data (ComposedData | None) – Initial data to start the store with. Usually comes from initial_data.

data_type

alias of ComposedData

get_log_state() list[source]

Pull information used in determining current data contribution.

Return type:

list

compare_log_states(prev_state: list, new_state: list) Data[source]

Generate a unit of composed data based on previous step and current step logs.

Parameters:
  • prev_state (list)

  • new_state (list)

Return type:

Data

update_from_logs() Data[source]

Update the data store based on collected information.

Return type:

Data

update_with_communicated_data() None[source]

Update the data store based on collected information from other satellites.

Return type:

None

class ComposedData(*data: Data)[source]

Bases: Data

Data for composed data types.

Parameters:

data (Data) – Data types to compose.