Stable Baselines Experiment

class or_suite.experiment.sb_experiment.SB_Experiment(env, model, dict)[source]

Optional instrumentation for running an experiment.

Runs a simulation between an arbitrary openAI Gym environment and a STABLE BASELINES ALGORITHM, saving a dataset of (reward, time, space) complexity across each episode, and optionally saves trajectory information.

seed

random seed set to allow reproducibility

dirPath

(string) location to store the data files

nEps

(int) number of episodes for the simulation

deBug

(bool) boolean, when set to true causes the algorithm to print information to the command line

env

(openAI env) the environment to run the simulations on

epLen

(int) the length of each episode

numIters

(int) the number of iterations of (nEps, epLen) pairs to iterate over with the environment

save_trajectory

(bool) boolean, when set to true saves the entire trajectory information

render_flag

(bool) boolean, when set to true renders the simulations

model

(stable baselines algorithm) an algorithm to run the experiments with

data

(np.array) an array saving the metrics along the sample paths (rewards, time, space)

trajectory_data

(list) a list saving the trajectory information

__init__(env, model, dict)[source]
Parameters
  • env – (openAI env) the environment to run the simulations on

  • model – (stable baseilnes algorithm) an algorithm to run the experiments with

  • dict

    a dictionary containing the arguments to send for the experiment, including:

    • dirPath: (string) location to store the data files

    • nEps: (int) number of episodes for the simulation

    • deBug: (bool) boolean, when set to true causes the algorithm to print information to the command line

    • env: (openAI env) the environment to run the simulations on

    • epLen: (int) the length of each episode

    • numIters: (int) the number of iterations of (nEps, epLen) pairs to iterate over with the environment

    • save_trajectory: (bool) boolean, when set to true saves the entire trajectory information

      TODO: Feature not implemented

    • render: (bool) boolean, when set to true renders the simulations

      TODO: Feature not implemeneted

run()[source]

Runs the simulations between an environment and an algorithm

save_data()[source]

Saves the acquired dataset to the noted location

Returns: dataframe corresponding to the saved data