Unique Images

Data system for recording unique images of targets.

class UniqueImageReward(reward_fn: ~typing.Callable = <function UniqueImageReward.<lambda>>)[source]

Bases: GlobalReward

GlobalReward for rewarding unique images.

This data system should be used with the ImagingSatellite and a scenario that generates targets, such as UniformTargets or CityTargets.

The satellites all start with complete knowledge of the targets in the scenario. Each target can only give one satellite a reward once; if any satellite has imaged a target, reward will never again be given for that target. The satellites filter known imaged targets from consideration for imaging to prevent duplicates. Communication can transmit information about what targets have been imaged in order to prevent reimaging.

Parameters:
  • scenario – GlobalReward.scenario

  • reward_fn (Callable) – Reward as function of priority.

datastore_type

alias of UniqueImageStore

initial_data(satellite: Satellite) UniqueImageData[source]

Furnish data to the scenario.

Currently, it is assumed that all targets are known a priori, so the initial data given to the data store is the list of all targets.

Parameters:

satellite (Satellite)

Return type:

UniqueImageData

create_data_store(satellite: Satellite) None[source]

Override the access filter in addition to creating the data store.

Parameters:

satellite (Satellite)

Return type:

None

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

Reward each new unique image once.

Reward is evaluated based on self.reward_fn(target.priority).

Parameters:

new_data_dict (dict[str, UniqueImageData]) – Record of new images for each satellite

Returns:

Cumulative reward across satellites for one step

Return type:

reward

class UniqueImageStore(*args, **kwargs)[source]

Bases: DataStore

DataStore for unique images.

Detects new images by watching for an increase in data in each target’s corresponding buffer.

data_type

alias of UniqueImageData

get_log_state() ndarray[source]

Log the instantaneous storage unit state at the end of each step.

Returns:

storedData from satellite storage unit

Return type:

array

compare_log_states(old_state: ndarray, new_state: ndarray) UniqueImageData[source]

Check for an increase in logged data to identify new images.

Parameters:
  • old_state (ndarray) – Older storedData from satellite storage unit.

  • new_state (ndarray) – Newer storedData from satellite storage unit.

Returns:

Targets imaged at new_state that were unimaged at old_state.

Return type:

list

class UniqueImageData(imaged: list[Target] | None = None, duplicates: int = 0, known: list[Target] | None = None)[source]

Bases: Data

Construct unit of data to record unique images.

Keeps track of imaged targets, a count of duplicates (i.e. images that were not rewarded due to the target already having been imaged), and all known targets in the environment.

Parameters:
  • imaged (list[Target] | None) – List of targets that are known to be imaged.

  • duplicates (int) – Count of target imaging duplication.

  • known (list[Target] | None) – List of targets that are known to exist (imaged and unimaged).