textworld.agents

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

Bases: textworld.core.Agent

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.
Returns:

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]

Bases: textworld.core.Agent

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.
Returns:

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]

Bases: textworld.core.Agent

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.
Returns:

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]

Bases: textworld.core.Agent

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.
Returns:

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]

Bases: textworld.core.Agent

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.
Returns:

Text command to be performed in this current state.

reset(env)[source]

Let the agent set some environment’s flags.

Parameters:env – TextWorld environment.