interact: Interaction between agent and environment.

View source: R/interact.R

interactR Documentation

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

env = makeEnvironment("windy.gridworld")
agent = makeAgent("softmax", "table", "qlearning")
interact(env, agent, n.episodes = 10L)

markdumke/reinforcelearn documentation built on Nov. 17, 2022, 12:53 a.m.