mwg API
    Preparing search index...

    Function runSeededEpisode

    • Plays one whole run with the AI choosing, from a named seed: the same seed and the same choose make the same decisions, so a run is comparable between builds, policies and machines. choose must be deterministic for that to hold - the deterministic argmax of a NeuralPolicy, a heuristic's fixed candidate order - and receives the env's full roster, returning one action per agent. Unlike runRollouts, the chooser is not a NeuralModel: a heuristic policy, a trained model behind NeuralPolicy.selectAction, or any function a benchmark can name works the same way. The env's own maxSteps is the truncation bound.

      Type Parameters

      • State
      • Command
      • Event

      Parameters

      Returns SeededRun

      import { TrainingEnvironment, runSeededEpisode } from '@datamoc/mwg/simulation';
      declare const env: TrainingEnvironment<{ x: number }, number, never>;
      const run = runSeededEpisode(env, (observations) => [0], { seed: 7 });
      console.log(run.steps, run.terminated);