# textworld.agents¶

class textworld.agents.human.HumanAgent(autocompletion=False, walkthrough=False)[source]
act(game_state, reward, done)[source]

Acts upon the current game state.

Parameters: game_state – Current game state. reward – Accumulated reward up until now. done – Whether the game is finished. Text command to be performed in this current state.
reset(env)[source]

Let the agent set some environment’s flags.

Parameters: env – TextWorld environment.
class textworld.agents.random.NaiveAgent(seed=1234)[source]
act(game_state, reward, done)[source]

Acts upon the current game state.

Parameters: game_state – Current game state. reward – Accumulated reward up until now. done – Whether the game is finished. Text command to be performed in this current state.
reset(env)[source]

Let the agent set some environment’s flags.

Parameters: env – TextWorld environment.
class textworld.agents.random.RandomCommandAgent(seed=1234)[source]
act(game_state, reward, done)[source]

Acts upon the current game state.

Parameters: game_state – Current game state. reward – Accumulated reward up until now. done – Whether the game is finished. Text command to be performed in this current state.
reset(env)[source]

Let the agent set some environment’s flags.

Parameters: env – TextWorld environment.
class textworld.agents.simple.NaiveAgent(seed=1234)[source]
act(game_state, reward, done)[source]

Acts upon the current game state.

Parameters: game_state – Current game state. reward – Accumulated reward up until now. done – Whether the game is finished. Text command to be performed in this current state.
reset(env)[source]

Let the agent set some environment’s flags.

Parameters: env – TextWorld environment.
exception textworld.agents.walkthrough.WalkthroughDone[source]

Bases: NameError

class textworld.agents.walkthrough.WalkthroughAgent(commands=None)[source]

Agent that simply follows a list of commands.

act(game_state, reward, done)[source]

Acts upon the current game state.

Parameters: game_state – Current game state. reward – Accumulated reward up until now. done – Whether the game is finished. Text command to be performed in this current state.
reset(env)[source]

Let the agent set some environment’s flags.

Parameters: env – TextWorld environment.