Data Composition
Data composition classes.
- class ComposedReward(*rewarders: GlobalReward)[source]
Bases:
GlobalRewardRewarder 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
- link_scenario(scenario: Scenario) None[source]
Link every component to the shared scenario.
- Parameters:
scenario (Scenario)
- Return type:
None
- initial_data(satellite: Satellite) ComposedData[source]
Furnish every component’s initial data in a fixed order.
- Parameters:
satellite (Satellite)
- Return type:
- create_data_store(satellite: Satellite) None[source]
Create a
CompositeDataStorefor 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, *data_store_types: type[DataStore], initial_data: ComposedData | None = None, data_store_kwargs: list | None = None)[source]
Bases:
DataStoreDataStore 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 (list | None) – List of data_store kwargs matching data_store_types.
- 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:
- class ComposedData(*data: Data)[source]
Bases:
DataData for composed data types.
- Parameters:
data (Data) – Data types to compose.
- class MixedReward(rewarders: Mapping[str, GlobalReward], satellite_mapping: Mapping[str, Sequence[str]], scenario_mapping: Mapping[str, str] | None = None)[source]
Bases:
GlobalRewardInitialize explicit channel or scenario bindings.
- Parameters:
rewarders (Mapping[str, GlobalReward])
satellite_mapping (Mapping[str, Sequence[str]])
scenario_mapping (Mapping[str, str] | None)
- data_store_type
alias of
MixedDataStore
- link_scenario(scenario: Scenario) None[source]
Bind reward channels to the selected scenario instances.
- Parameters:
scenario (Scenario)
- Return type:
None
- pass_data() None[source]
Synchronize component data with the parent channel mapping.
- Return type:
None
- reset_overwrite_previous() None[source]
Clear episode state and reset each component once.
- Return type:
None
- reset_pre_sim_init() None[source]
Prepare each component before simulator construction.
- Return type:
None
- reset_during_sim_init() None[source]
Prepare each component during simulator construction.
- Return type:
None
- reset_post_sim_init() None[source]
Finalize component setup after simulator initialization.
- Return type:
None
- initial_data(satellite: Satellite) MixedData[source]
Provide initial knowledge for the satellite’s assigned channels.
- create_data_store(satellite: Satellite) None[source]
Create assigned stores using each rewarder’s setup hooks.
- Parameters:
satellite (Satellite)
- Return type:
None
- calculate_reward(new_data_dict: dict[str, MixedData]) dict[str, float][source]
Route local deltas and sum rewards against previous global data.
- Parameters:
new_data_dict (dict[str, MixedData])
- Return type:
dict[str, float]
- reward(new_data_dict: dict[str, MixedData]) dict[str, float][source]
Calculate rewards, merge global deltas, and synchronize child data.
- Parameters:
new_data_dict (dict[str, MixedData])
- Return type:
dict[str, float]
- class MixedDataStore(satellite: Satellite, data_stores: Mapping[str, DataStore], initial_data: MixedData | None = None)[source]
Bases:
DataStoreInitialize explicit channel or scenario bindings.
- Parameters:
- pass_data() None[source]
Synchronize component data with the parent channel mapping.
- Return type:
None
- compare_log_states(prev_state: dict, new_state: dict) MixedData[source]
Generate deltas only for locally active channels.
- Parameters:
prev_state (dict)
new_state (dict)
- Return type: