matrx.agents.agent_utils.navigator.Navigator

class Navigator(agent_id, action_set, algorithm='a_star', is_circular=False)

A navigator object that can be used for path planning and navigation.

Parameters
agent_id: string

ID of the agent that wants to navigate through a grid world.

action_set: list

List of actions the agent can perform.

algorithm: string. Optional, default “a_star”

The path planning algorithm to use. As of now only A* is supported.

is_circular: bool (Default: False)

When True, it will continuously navigate given waypoints, until infinity.

Warning

This class still depends on the deprecated StateTracker instead of the new State. Note that the StateTracker is created from a state dictionary that can be obtained from a State instance. This is the current workaround to still make the Navigator work with the current State.

Another approach is to not use State at all, and only rely on a StateTracker. See the matrx.agents.agent_types.patrolling_agent.PatrollingAgentBrain which uses this approach.

Methods

add_waypoint(self, waypoint)

Adds a waypoint to the path.

add_waypoints(self, waypoints[, is_circular])

Adds multiple waypoints to the path in order.

get_all_waypoints(self)

Returns all current waypoints stored.

get_current_waypoint(self)

Returns the current waypoint the navigator will try to visit.

get_move_action(self, state_tracker)

Returns the next move action.

get_upcoming_waypoints(self)

Returns all waypoints not yet visited.

reset(self)

Resets all waypoints to not being visited.

reset_full(self)

Clears all waypoints to an empty Navigator.

__init__(self, agent_id, action_set, algorithm='a_star', is_circular=False)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(self, agent_id, action_set[, …])

Initialize self.

add_waypoint(self, waypoint)

Adds a waypoint to the path.

add_waypoints(self, waypoints[, is_circular])

Adds multiple waypoints to the path in order.

get_all_waypoints(self)

Returns all current waypoints stored.

get_current_waypoint(self)

Returns the current waypoint the navigator will try to visit.

get_move_action(self, state_tracker)

Returns the next move action.

get_upcoming_waypoints(self)

Returns all waypoints not yet visited.

reset(self)

Resets all waypoints to not being visited.

reset_full(self)

Clears all waypoints to an empty Navigator.

Attributes

A_STAR_ALGORITHM