gameboy_worlds.interface.survival_kids.environments
1from gameboy_worlds.emulation.emulator import Emulator 2from gameboy_worlds.emulation.survival_kids.trackers import ( 3 SurvivalKidsOCRTracker, 4 SurvivalKidsTracker, 5) 6from gameboy_worlds.interface.environment import ( 7 DummyEnvironment, 8 Environment, 9 TestEnvironmentMixin, 10 TrainEnvironmentMixin, 11) 12 13 14class SurvivalKidsEnvironment(DummyEnvironment): 15 """A basic Survival Kids environment.""" 16 17 REQUIRED_EMULATOR = Emulator 18 REQUIRED_STATE_TRACKER = SurvivalKidsTracker 19 20 21class SurvivalKidsOCREnvironment(SurvivalKidsEnvironment): 22 """A Survival Kids environment that includes OCR region captures.""" 23 24 REQUIRED_EMULATOR = Emulator 25 REQUIRED_STATE_TRACKER = SurvivalKidsOCRTracker 26 27 @staticmethod 28 def override_emulator_kwargs(emulator_kwargs: dict) -> dict: 29 Environment.override_state_tracker_class( 30 emulator_kwargs, SurvivalKidsOCREnvironment.REQUIRED_STATE_TRACKER 31 ) 32 return emulator_kwargs 33 34 35class SurvivalKidsTestEnvironment(TestEnvironmentMixin, SurvivalKidsOCREnvironment): 36 pass 37 38 39class SurvivalKidsTrainEnvironment(TrainEnvironmentMixin, SurvivalKidsOCREnvironment): 40 pass
15class SurvivalKidsEnvironment(DummyEnvironment): 16 """A basic Survival Kids environment.""" 17 18 REQUIRED_EMULATOR = Emulator 19 REQUIRED_STATE_TRACKER = SurvivalKidsTracker
A basic Survival Kids environment.
The highest level emulator that the environment can interface with.
The state tracker that tracks the minimal state information required for the environment to function.
Inherited Members
- gameboy_worlds.interface.environment.DummyEnvironment
- DummyEnvironment
- observation_space
- get_observation
- determine_reward
- determine_terminated
- render_obs
- render_info
- gameboy_worlds.interface.environment.Environment
- override_emulator_kwargs
- override_state_tracker_class
- action_space
- actions
- render_mode
- save_custom_state
- delete_custom_state
- load_custom_state
- get_info
- get_final_info
- reset
- determine_truncated
- before_step
- after_step
- step
- step_high_level_action
- step_str
- string_to_high_level_action
- sim
- sim_str
- sim_high_level_action
- close
- render
- seed
- get_action_strings
- human_step_play
22class SurvivalKidsOCREnvironment(SurvivalKidsEnvironment): 23 """A Survival Kids environment that includes OCR region captures.""" 24 25 REQUIRED_EMULATOR = Emulator 26 REQUIRED_STATE_TRACKER = SurvivalKidsOCRTracker 27 28 @staticmethod 29 def override_emulator_kwargs(emulator_kwargs: dict) -> dict: 30 Environment.override_state_tracker_class( 31 emulator_kwargs, SurvivalKidsOCREnvironment.REQUIRED_STATE_TRACKER 32 ) 33 return emulator_kwargs
A Survival Kids environment that includes OCR region captures.
The highest level emulator that the environment can interface with.
The state tracker that tracks the minimal state information required for the environment to function.
28 @staticmethod 29 def override_emulator_kwargs(emulator_kwargs: dict) -> dict: 30 Environment.override_state_tracker_class( 31 emulator_kwargs, SurvivalKidsOCREnvironment.REQUIRED_STATE_TRACKER 32 ) 33 return emulator_kwargs
Override default emulator keyword arguments for this environment.
Override this method in subclasses to modify the default emulator keyword arguments.
You may want to use override_state_tracker_class or that style to ensure compatibility of state tracker classes.
Arguments:
- emulator_kwargs (dict): Incoming emulator keyword arguments.
Returns:
dict: The overridden emulator keyword arguments.
Inherited Members
- gameboy_worlds.interface.environment.DummyEnvironment
- DummyEnvironment
- observation_space
- get_observation
- determine_reward
- determine_terminated
- render_obs
- render_info
- gameboy_worlds.interface.environment.Environment
- override_state_tracker_class
- action_space
- actions
- render_mode
- save_custom_state
- delete_custom_state
- load_custom_state
- get_info
- get_final_info
- reset
- determine_truncated
- before_step
- after_step
- step
- step_high_level_action
- step_str
- string_to_high_level_action
- sim
- sim_str
- sim_high_level_action
- close
- render
- seed
- get_action_strings
- human_step_play
Mixin class for testing environments. Ensures the State Tracker used is a TestTrackerMixin and checks these for termination / truncation.
Inherited Members
- gameboy_worlds.interface.environment.DummyEnvironment
- DummyEnvironment
- observation_space
- get_observation
- determine_reward
- render_obs
- render_info
- gameboy_worlds.interface.environment.TestEnvironmentMixin
- REQUIRED_STATE_TRACKER
- determine_truncated
- determine_terminated
- gameboy_worlds.interface.environment.Environment
- override_state_tracker_class
- action_space
- actions
- render_mode
- save_custom_state
- delete_custom_state
- load_custom_state
- get_info
- get_final_info
- reset
- before_step
- after_step
- step
- step_high_level_action
- step_str
- string_to_high_level_action
- sim
- sim_str
- sim_high_level_action
- close
- render
- seed
- get_action_strings
- human_step_play
Mixin class for training environments. Records the allowed initial states for training and random shuffles between them when resetting.
Inherited Members
- gameboy_worlds.interface.environment.DummyEnvironment
- DummyEnvironment
- observation_space
- get_observation
- determine_reward
- determine_terminated
- render_obs
- render_info
- gameboy_worlds.interface.environment.Environment
- override_state_tracker_class
- action_space
- actions
- render_mode
- save_custom_state
- delete_custom_state
- load_custom_state
- get_info
- get_final_info
- determine_truncated
- before_step
- after_step
- step
- step_high_level_action
- step_str
- string_to_high_level_action
- sim
- sim_str
- sim_high_level_action
- close
- render
- seed
- get_action_strings
- human_step_play