-
Notifications
You must be signed in to change notification settings - Fork 2
Bluebird gymnasium test agents #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from 6 commits
6c96272
3c461ee
4865028
47002fd
fd61111
3fa6c14
c9b9a8d
a492b7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import datetime | ||
|
|
||
| from bluebird_dt.simulator import Simulator | ||
|
|
||
| from bluebird_gymnasium.envs import EnvConfig, ViewType | ||
| from bluebird_gymnasium.envs.sector_xplus import SectorXPlusEnv | ||
|
|
||
|
|
||
| class FlightSchoolEnv(SectorXPlusEnv): | ||
| """Gymnasium environment for the Flight School scenario.""" | ||
|
|
||
| def _generate_scenario(self) -> Simulator: | ||
| category = "Flight School" | ||
| scenario = "Xplus-Sector" | ||
| timestamp = datetime.datetime.now().strftime("%Y_%m_%d__%H_%M_%S") | ||
|
|
||
| suffix = self.config.simulation_log_config.get("log_suffix", None) | ||
| suffix = "" if suffix is None or suffix == "" else f"__{suffix}" | ||
| log_filename = f"{category}_{scenario}_{timestamp}{suffix}" | ||
|
|
||
| return self.scenario_manager.to_simulator( | ||
| category=category, | ||
| scenario_name=scenario, | ||
| save_log_to_file=False, | ||
| log_filename=log_filename, | ||
| predictor=None, | ||
| ) | ||
|
|
||
| @classmethod | ||
| def get_default_env_config(cls, view_type: ViewType | str = ViewType.CENTRALIZED) -> EnvConfig: | ||
| config = super().get_default_env_config(view_type) | ||
| config.scenario_config = { | ||
| "cls": "infinite", | ||
| "args": { | ||
| "random_seed": None, | ||
| "num_starter_aircraft": 2, | ||
| "initial_spawn_rate": 0.002, | ||
| "spawn_rate_increment": 0.002, | ||
| "spawn_rate_increase_interval": 60, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this value of spawn_rate_increase_interval a bit on the low side? I could imagine the rate would ramp up quite quickly, but maybe it's manageable if that's what you've been using?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're probably right but as my notebooks got to a maximum of two aircraft I'm not sure. |
||
| "max_spawn_rate": 0.03, | ||
| "total_time_seconds": 3600.0, | ||
| }, | ||
| } | ||
| config.reward_config = { | ||
| "fns": [ | ||
| "position_status_const", | ||
| "lateral_centreline_distance_shaped", | ||
| "safety_simple_avoidance_exp", | ||
| ], | ||
| "coeffs": [1.0, 1.0, 1.2], | ||
| } | ||
| config.scenario_duration = 10 * 60 | ||
| return config | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean the FlightSchoolEnv is the same as SectorXPlusEnv?
I can't see the key difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlightSchoolEnv inherits the X-plus airspace implementation, but swaps in a different scenario generator/default scenario configuration. Flight School specifically asserts that its scenario manager is Infinite.