Scenario
bsk_rl.scene provides scenarios, or the underlying environment in which the satellite can collect data.
Scenarios typically correspond to certain type(s) of Data & Reward systems.
For Earth observation, the following scenarios have been implemented:
UniformTargets: Uniformly distributed targets to be imaged by anImagingSatellite.CityTargets: Targets distributed near population centers.UniformNadirScanning: Uniformly desireable data over the surface of the Earth.
For RSO Inspection tasks, the following scenario has been implemented:
SphericalRSO: A RSO with spherical points and radial normals.
These RSO scenarios can be used with RSOInspectionReward.
- class Scenario[source]
Bases:
ABC,ResetableBase scenario class.
- link_satellites(satellites: list[Satellite]) None[source]
Link the environment satellite list to the scenario.
- Parameters:
satellites (list[Satellite]) – List of satellites to communicate between.
- Return type:
None
- validate_satellite_names(satellites: list[Satellite]) None[source]
Optionally validate original participant names before automatic renaming.
The default permits existing environment name normalization. Scenarios with explicit identity bindings can reject ambiguous original names.
- Parameters:
satellites (list[Satellite])
- Return type:
None
- class UniformTargets(n_targets: int | tuple[int, int], priority_distribution: Callable | None = None, radius: float = 6378136.6)[source]
Bases:
ScenarioAn environment with evenly-distributed static targets.
Can be used with
UniqueImageReward.- Parameters:
n_targets (int | tuple[int, int]) – Number of targets to generate. Can also be specified as a range
(low, high)where the number of targets generated is uniformly selectedlow ≤ n_targets ≤ high.priority_distribution (Callable | None) – Function for generating target priority. Defaults to
lambda: uniform(0, 1)if not specified.radius (float) – [m] Radius to place targets from body center. Defaults to Earth’s equatorial radius.
- reset_overwrite_previous() None[source]
Overwrite target list from previous episode.
- Return type:
None
- regenerate_targets() None[source]
Regenerate targets uniformly.
Override this method (as demonstrated in
CityTargets) to generate other distributions.- Return type:
None
- class CityTargets(n_targets: int | tuple[int, int], n_select_from: int | None = None, location_offset: float = 0, priority_distribution: Callable | None = None, radius: float = 6378136.6)[source]
Bases:
UniformTargetsConstruct environment with static targets around population centers.
Uses the simplemaps Word Cities Database for population center locations.
- Parameters:
n_targets (int | tuple[int, int]) – Number of targets to generate, as a fixed number or a range.
n_select_from (int | None) – Generate targets from the top n_select_from most populous cities. Will use all cities in the database if not specified.
location_offset (float) – [m] Offset targets randomly from the city center by up to this amount.
priority_distribution (Callable | None) – Function for generating target priority.
radius (float) – Radius to place targets from body center.
- class UniformNadirScanning(value_per_second: float = 1.0)[source]
Bases:
ScenarioConstruct uniform data over the surface of the planet.
Can be used with
ScanningTimeReward.- Parameters:
value_per_second (float) – Reward per second for imaging nadir.
- class RSOPoints[source]
Bases:
Scenario- reset_overwrite_previous() None[source]
Overwrite target list from previous episode.
- Return type:
None
- visualize_rso_point(rso_point: RSOPoint, vizSupport=None, vizInstance=None)[source]
Visualize target in Vizard.
- Parameters:
rso_point (RSOPoint)
- class SphericalRSO(n_points: int = 100, radius: float = 1.0, theta_max: float = np.float64(0.7853981633974483), range_max: float = -1, theta_solar_max: float = np.float64(1.0471975511965976), min_illumination_factor: float = 0.1)[source]
Bases:
RSOPointsGenerate points on a sphere using the Fibonacci sphere method.
- Parameters:
n_points (int) – Number of points to generate on the sphere.
radius (float) – [m] Radius of the sphere.
theta_max (float) – [rad] Maximum angle from the normal for inspection.
range_max (float) – [m] Maximum range for inspection.
theta_solar_max (float) – [rad] Minimum solar incidence angle for illumination.
min_illumination_factor (float) – Minimum illumination factor for imaging.
- class RSOTarget(id: str, satellite_name: str, rN: tuple[float, float, float], vN: tuple[float, float, float], priority: float = 1.0, sigma_init: tuple[float, float, float] = (0.0, 0.0, 0.0), omega_init: tuple[float, float, float] = (0.0, 0.0, 0.0), wheel_speeds_rpm: tuple[float, float, float] = (0.0, 0.0, 0.0), disturbance_torque_Nm: tuple[float, float, float] = (0.0, 0.0, 0.0), physical_parameters: tuple[tuple[str, float], ...] = ())[source]
Bases:
objectImmutable definition of one independently orbiting imaging target.
IDs are nonempty strings; they have no relationship to simulator indices.
satellite_nameisname, the environment’s agent identifier. It is distinct from the Basilisk spacecraft model’s name and binds exactly one explicitly supplied satellite, rather than a group. Physical parameters are optional(sat_args key, scalar value)pairs.- Parameters:
id (str)
satellite_name (str)
rN (tuple[float, float, float])
vN (tuple[float, float, float])
priority (float)
sigma_init (tuple[float, float, float])
omega_init (tuple[float, float, float])
wheel_speeds_rpm (tuple[float, float, float])
disturbance_torque_Nm (tuple[float, float, float])
physical_parameters (tuple[tuple[str, float], ...])
- id: str
- satellite_name: str
- rN: tuple[float, float, float]
- vN: tuple[float, float, float]
- priority: float = 1.0
- sigma_init: tuple[float, float, float] = (0.0, 0.0, 0.0)
- omega_init: tuple[float, float, float] = (0.0, 0.0, 0.0)
- wheel_speeds_rpm: tuple[float, float, float] = (0.0, 0.0, 0.0)
- disturbance_torque_Nm: tuple[float, float, float] = (0.0, 0.0, 0.0)
- physical_parameters: tuple[tuple[str, float], ...] = ()
- class RSOTargetCatalog(targets: tuple[RSOTarget, ...], utc_init: str | None = None, priority_events: tuple[RSOPriorityEvent, ...] = ())[source]
Bases:
objectReplayable target definitions, ordering, optional epoch, and priority events.
If
utc_initis omitted, target states refer to the environment’s realized epoch on each reset. After reset,catalogcontains that explicit epoch and can be saved for replay. An explicitly supplied catalog epoch must match the environment; states are never silently retimed.- Parameters:
targets (tuple[RSOTarget, ...])
utc_init (str | None)
priority_events (tuple[RSOPriorityEvent, ...])
- utc_init: str | None = None
- priority_events: tuple[RSOPriorityEvent, ...] = ()
- to_dict() dict[str, Any][source]
Return a versioned, JSON-compatible mission target definition.
- Return type:
dict[str, Any]
- save(path: str | Path) None[source]
Save target definitions and their optional epoch without rounding.
Save
env.scenario.catalogafter reset to include the realized epoch when the original definition omitted it.- Parameters:
path (str | Path)
- Return type:
None
- classmethod from_dict(values: dict[str, Any]) RSOTargetCatalog[source]
Validate and load the supported schema and units.
- Parameters:
values (dict[str, Any])
- Return type:
- classmethod load(path: str | Path) RSOTargetCatalog[source]
Load a saved catalog without resampling any target.
- Parameters:
path (str | Path)
- Return type:
- class RSOPriorityEvent(time_s: float, priorities: tuple[tuple[str, float], ...])[source]
Bases:
objectPriority changes applied at the first decision boundary at/after time_s.
Changes occur after the preceding step’s reward and before its observation. Events at zero occur before the initial observation. They do not clear pending images or cooldowns. Pairs are
(target ID, new priority).- Parameters:
time_s (float)
priorities (tuple[tuple[str, float], ...])
- time_s: float
- priorities: tuple[tuple[str, float], ...]
- class RSOTargets(catalog: RSOTargetCatalog, imager_names: list[str])[source]
Bases:
ScenarioSelect participants by explicit identity, independently of list order.
- Parameters:
catalog (RSOTargetCatalog)
imager_names (list[str])
- property catalog: RSOTargetCatalog
Configured catalog before reset, or the epoch-resolved episode snapshot.
The input definition remains immutable. Save this property after reset to retain the realized epoch without pinning subsequent episode resets.
- validate_satellite_names(satellites) None[source]
Reject ambiguous/missing original names before the environment renames.
- Return type:
None
- link_satellites(satellites) None[source]
Bind only the copied participants used by the actual environment.
- Return type:
None
- reset_overwrite_previous() None[source]
Drop runtime bindings, centralized eligibility, and event history.
- Return type:
None
- reset_pre_sim_init() None[source]
Bind this episode’s objects and override only catalog target conditions.
- Return type:
None
- static partition_name(target_id: str) str[source]
Bounded simulator-safe partition name, independent of array position.
- Parameters:
target_id (str)
- Return type:
str
- reset_during_sim_init() None[source]
Register each target separately in each imager’s access model.
- Return type:
None