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.

data_store_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]

Furnish 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]

is_truncated(satellite: Satellite) bool[source]

Check if the episode is truncated by any rewarder.

Parameters:

satellite (Satellite)

Return type:

bool

is_terminated(satellite) bool[source]

Check if the episode is terminated by any rewarder.

Return type:

bool

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

Bases: DataStore

DataStore for composed data types.

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

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

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

  • data_store_kwargs (dict | None) – Dictionary mapping data_store types to their kwargs.

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.