GridWorld.get_agent_state#

GridWorld.get_agent_state(when='current')[source]#

Get state of the agent.

Parameters:

when (str {"current", "init"} (default: "current")) – Choose to get the initial (“init”) or current (“current”) state of the agent.

Returns:

agent_current_state – Coordinate of the state where the agent stays.

Return type:

tuple of ints

Examples

>>> W = GridWorld()
>>> W.add_area((2, 2))
>>> W.add_path((0, 0, 0), (1, 0, 0))
>>> W.init_agent()
>>> W.step((1, 0))
((1, 0, 0), 0.0, False)
>>> W.get_agent_state()
(1, 0, 0)
>>> W.get_agent_state(when="init")
(0, 0, 0)