amaze.simu.simulation¶
Classes
|
Serves as a bare-bones simulator for the maze-navigation environment. |
- class amaze.simu.simulation.Simulation( )[source]¶
Serves as a bare-bones simulator for the maze-navigation environment.
Handles all three configurations: full discrete, full continuous and hybrid
- step(action: Vec) float | None[source]¶
Apply the requested action to the agent and return the corresponding reward
- classmethod compute_metrics( ) dict[MazeMetrics | str][source]¶
Computes metrics about a maze.
- Parameters:
maze – The maze to process
inputs – The type of inputs (currently unused)
vision – The agent’s retina size (currently unused)
- Returns:
a dictionary of the different metrics
- classmethod inputs_evaluation(
- results_path: Path | str,
- controller: BaseController,
- signs: dict[SignType, List[Sign]],
- empty_intersections: bool = False,
- draw_inputs: bool = False,
- draw_individual_files: bool = False,
- draw_summary_file: bool = True,
- summary_file_ratio: float = 1.7777777777777777,
Evaluates the provided controller on all possible inputs.
Uses the provided lists of clues/lures/traps and tests the controller’s capacity to take the appropriate action in all cases. Unlike conventional, maze-navigation evaluation for generalization performance evaluation, this method does not suffer from cumulative failure (e.g. missing one intersection may prevent reaching the goal).
Warning
Only available for fully discrete and hybrid spaces
- Parameters:
results_path – Folder under which to store the resulting files.
controller – Controller to evaluate.
signs – Dictionary of clues/lures/traps.
empty_intersections – Also evaluate agent on intersections without signs (nasty, disabled by default)
draw_inputs – Whether to draw inputs (without the actions)
draw_individual_files – Whether to generate a separate file for every input/action
draw_summary_file – Whether to generate a summary file for all input/action pairs
summary_file_ratio – Width/Height ratio of the summary file
- classmethod inputs_evaluation_from(
- simulation: Simulation,
- results_path: Path | str,
- controller: BaseController,
- **kwargs,
Evaluates the provided controller on all possible inputs.
Uses the simulation’s maze to generate the list of clues/lures/traps and delegates to
inputs_evaluation().Warning
Only available for fully discrete and hybrid spaces
- Parameters:
simulation – The simulation to grab maze data from.
results_path – Folder under which to store the resulting files.
controller – Controller to evaluate.
kwargs – Additional keyword arguments.