mpcrl.wrappers.agents#

Wrappers for learning and non-learning agents.

First of all, this submodule introduces two base classes for wrappers to be appplied to agents, not environments. These classes are mpcrl.wrappers.agents.Wrapper and mpcrl.wrappers.agents.LearningWrapper. The former is a wrapper for non-learning agents, while the latter is a wrapper for learning agents. Both classes define an interface equal to the agent’s, so that they can be used as agents themselves seamlessly.

Outside of these base classes, this submodule provides a few concrete wrappers for logging information about the agent’s learning/evaluation process, recording the updates of the MPC parametrization during learning, and launching periodic evaluations of the agent during training.

Classes

Evaluate(agent, eval_env, hook, frequency[, ...])

Wrapper for evaluating an agent during training.

LearningWrapper(agent)

A Wrapper subclass dedicated to wrapping instances of mpcrl.LearningAgent.

Log(agent[, log_name, level, to_file, mode, ...])

A wrapper class for logging information about an agent.

RecordUpdates(agent[, frequency])

Wrapper for recording the history of updated parametrizations by the learning agent.

Wrapper(agent)

Wraps an instance of mpcrl.Agent to allow a modular transformation of its behaviour.