oneRunWithDump#

statrl.experiments.onerun.oneRunWithDump(env, learner, interact, timeHorizon, root_folder)[source]#

Run one replicate and pickle its score series to disk.

The unit of work handed to joblib by multicoreRuns(). Results travel back through the filesystem rather than through the return value, because returning full score series from every worker would serialize nbReplicates x timeHorizon floats through the process pool.

Parameters:
  • env (object) – Environment for this replicate; already a private deep copy.

  • learner (object) – Agent for this replicate; already a private deep copy.

  • interact (Interaction) – The interaction loop of the setting.

  • timeHorizon (int) – Number of rounds to play.

  • root_folder (str) – Directory the dump is written to. Must end with a separator, and must already exist.

Returns:

Path of the pickle written, of the form {root_folder}aux_{env}_scores_{agent}_{horizon}_{timestamp}. The aux_ prefix is what clear_auxiliaryfiles() deletes once the statistics have been computed.

Return type:

str

Raises:

AssertionError – If the interaction returned fewer or more than timeHorizon scores.