Learn R Programming

reinforcelearn (version 0.2.1)

interact: Interaction between agent and environment.

Description

Run interaction between agent and environment for specified number of steps or episodes.

Usage

interact(env, agent, n.steps = Inf, n.episodes = Inf,
  max.steps.per.episode = Inf, learn = TRUE, visualize = FALSE)

Arguments

env

[Environment] Reinforcement learning environment created by makeEnvironment.

agent

[Agent] Agent created by makeAgent.

n.steps

[integer(1)] Number of steps to run.

n.episodes

[integer(1)] Number of episodes to run.

max.steps.per.episode

[integer(1)] Maximal number of steps allowed per episode.

learn

[logical(1)] Should the agent learn?

visualize

[logical(1)] Visualize the interaction between agent and environment?

Value

[list] Return and number of steps per episode.

Examples

Run this code
# NOT RUN {
env = makeEnvironment("windy.gridworld")
agent = makeAgent("softmax", "table", "qlearning")
interact(env, agent, n.episodes = 10L)
# }

Run the code above in your browser using DataLab