Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration

All runtime parameters for cobre run are controlled by config.json in the case directory. This page documents every section and field.


Minimal Config

{
  "version": "2.0.0",
  "training": {
    "forward_passes": 50,
    "stopping_rules": [{ "type": "iteration_limit", "limit": 100 }]
  }
}

All other sections are optional with defaults documented below.


training

Controls the SDDP training phase.

Mandatory Fields

FieldTypeDescription
forward_passesintegerNumber of scenario trajectories per iteration. Larger values reduce variance in each iteration’s cut but increase cost per iteration.
stopping_rulesarrayAt least one stopping rule (see below). The rule set must contain at least one iteration_limit rule.

Optional Fields

FieldTypeDefaultDescription
enabledbooleantrueSet to false to skip training and proceed directly to simulation (requires a pre-trained policy).
seedinteger42Random seed for reproducible scenario generation.
stopping_mode"any" or "all""any"How multiple stopping rules combine: "any" stops when the first rule is satisfied; "all" requires all rules to be satisfied simultaneously.

Stopping Rules

Each entry in stopping_rules is a JSON object with a "type" discriminator.

iteration_limit

Stop after a fixed number of training iterations.

{ "type": "iteration_limit", "limit": 200 }
FieldTypeDescription
limitintegerMaximum number of SDDP iterations to run.

time_limit

Stop after a wall-clock time budget is exhausted.

{ "type": "time_limit", "seconds": 3600.0 }
FieldTypeDescription
secondsfloatMaximum training time in seconds.

bound_stalling

Stop when the relative improvement in the lower bound falls below a threshold.

{ "type": "bound_stalling", "iterations": 20, "tolerance": 0.0001 }
FieldTypeDescription
iterationsintegerWindow size: the number of past iterations over which to compute the relative improvement.
tolerancefloatRelative improvement threshold. Training stops when the improvement over the window is below this value.

stopping_mode

When multiple stopping rules are listed, stopping_mode controls how they combine:

  • "any" (default): stop when any one rule is satisfied.
  • "all": stop only when every rule is satisfied simultaneously.
{
  "training": {
    "forward_passes": 50,
    "stopping_mode": "all",
    "stopping_rules": [
      { "type": "iteration_limit", "limit": 500 },
      { "type": "bound_stalling", "iterations": 20, "tolerance": 0.0001 }
    ]
  }
}

simulation

Controls the optional post-training simulation phase.

FieldTypeDefaultDescription
enabledbooleanfalseEnable the simulation phase after training.
num_scenariosinteger2000Number of independent Monte Carlo simulation scenarios to evaluate.
policy_type"outer""outer"Policy representation for simulation. "outer" uses the cut pool (Benders cuts).

When simulation.enabled is false or num_scenarios is 0, the simulation phase is skipped regardless of the --skip-simulation flag.

Example:

{
  "simulation": {
    "enabled": true,
    "num_scenarios": 1000
  }
}

policy

Controls policy persistence (checkpoint saving and warm-start loading).

FieldTypeDefaultDescription
pathstring"./policy"Directory where policy data (cuts, states) is stored.
mode"fresh", "warm_start", or "resume""fresh"Initialization mode. "fresh" starts from scratch; "warm_start" loads cuts from a previous run; "resume" continues an interrupted run.
validate_compatibilitybooleantrueWhen loading a policy, verify that entity counts, stage counts, and cut dimensions match the current system.

exports

Controls which outputs are written to the results directory.

FieldTypeDefaultDescription
trainingbooleantrueWrite training convergence data (Parquet).
cutsbooleantrueWrite the cut pool (FlatBuffers).
statesbooleantrueWrite visited state vectors (Parquet).
verticesbooleantrueWrite inner approximation vertices when applicable (Parquet).
simulationbooleantrueWrite per-entity simulation results (Parquet).
forward_detailbooleanfalseWrite per-scenario forward-pass detail (large; disabled by default).
backward_detailbooleanfalseWrite per-scenario backward-pass detail (large; disabled by default).
compression"zstd", "lz4", or "none"nullOutput Parquet compression algorithm. null uses the crate default (zstd).

Full Example

{
  "$schema": "https://cobre.dev/schemas/v2/config.schema.json",
  "version": "2.0.0",
  "training": {
    "seed": 42,
    "forward_passes": 50,
    "stopping_rules": [
      { "type": "iteration_limit", "limit": 200 },
      { "type": "bound_stalling", "iterations": 20, "tolerance": 0.0001 }
    ],
    "stopping_mode": "any"
  },
  "simulation": {
    "enabled": true,
    "num_scenarios": 2000
  },
  "policy": {
    "path": "./policy",
    "mode": "fresh"
  },
  "exports": {
    "training": true,
    "cuts": true,
    "states": true,
    "simulation": true,
    "compression": "zstd"
  }
}

See Also