December 2019
Intermediate to advanced
368 pages
11h 10m
English
To simulate the solver agent navigating the maze, we need to define an environment that manages the configuration of the maze, tracks the position of the maze-solving agent, and provides inputs to the sensor data arrays of the navigating robot.
All of these features fit into one logical block that is encapsulated into the MazeEnvironment Python class, which has the following fields (as can be seen from the class constructor):
def __init__(self, agent, walls, exit_point, exit_range=5.0): self.walls = walls self.exit_point = exit_point self.exit_range = exit_range # The maze navigating agent self.agent = agent # The flag to indicate if exit was found self.exit_found = False # The initial distance ...
Read now
Unlock full access