{
 "schema_version": 1,
 "model": "Vanderbei sailing problem as an undiscounted stochastic shortest-path MDP",
 "lake": {
  "n": 21,
  "start": [
   10,
   2
  ],
  "mark": [
   10,
   18
  ]
 },
 "leg_time_minutes": {
  "into the wind": null,
  "close-hauled": 4.0,
  "beam reach": 3.0,
  "broad reach": 2.0,
  "dead downwind": 1.0
 },
 "diagonal_factor": "sqrt(2)",
 "tack_delay_minutes": 3.0,
 "start_wind": "N",
 "scenarios": {
  "steady": {
   "label": "Steady wind from the north",
   "wind_matrix": [
    [
     1.0,
     0.0,
     0.0,
     0.0,
     0.0,
     0.0,
     0.0,
     0.0
    ],
    [
     0.0,
     1.0,
     0.0,
     0.0,
     0.0,
     0.0,
     0.0,
     0.0
    ],
    [
     0.0,
     0.0,
     1.0,
     0.0,
     0.0,
     0.0,
     0.0,
     0.0
    ],
    [
     0.0,
     0.0,
     0.0,
     1.0,
     0.0,
     0.0,
     0.0,
     0.0
    ],
    [
     0.0,
     0.0,
     0.0,
     0.0,
     1.0,
     0.0,
     0.0,
     0.0
    ],
    [
     0.0,
     0.0,
     0.0,
     0.0,
     0.0,
     1.0,
     0.0,
     0.0
    ],
    [
     0.0,
     0.0,
     0.0,
     0.0,
     0.0,
     0.0,
     1.0,
     0.0
    ],
    [
     0.0,
     0.0,
     0.0,
     0.0,
     0.0,
     0.0,
     0.0,
     1.0
    ]
   ],
   "optimal_minutes": 93.5097,
   "optimal_start_tack": "port",
   "certainty_equivalent_minutes": 93.5097,
   "layline_minutes": 93.5097,
   "value_iteration_sweeps": 39,
   "value_iteration_final_residual": 0.0,
   "policy_iteration_evaluations": 11,
   "policy_iteration_improvements": 10,
   "policy_iteration_errors": [
    14.911688245431392,
    6.627416997969529,
    3.000000000000007,
    3.000000000000007,
    3.000000000000007,
    3.000000000000007,
    3.000000000000007,
    3.000000000000007,
    3.000000000000007,
    3.0,
    2.842170943040401e-14
   ],
   "monte_carlo_races": 4000,
   "monte_carlo_mean_optimal": 93.51,
   "monte_carlo_mean_layline": 93.51,
   "share_races_optimal_faster": 0.0,
   "share_races_tied": 1.0,
   "max_legs_optimal_any_wind": 28,
   "first_sweep_with_error_below_1_minute": 37
  },
  "oscillating": {
   "label": "Oscillating breeze (teaching values)",
   "wind_matrix": [
    [
     0.8,
     0.1,
     0.0,
     0.0,
     0.0,
     0.0,
     0.0,
     0.1
    ],
    [
     0.2,
     0.7,
     0.1,
     0.0,
     0.0,
     0.0,
     0.0,
     0.0
    ],
    [
     0.0,
     0.2,
     0.7,
     0.1,
     0.0,
     0.0,
     0.0,
     0.0
    ],
    [
     0.0,
     0.0,
     0.2,
     0.7,
     0.1,
     0.0,
     0.0,
     0.0
    ],
    [
     0.0,
     0.0,
     0.0,
     0.15,
     0.7,
     0.15,
     0.0,
     0.0
    ],
    [
     0.0,
     0.0,
     0.0,
     0.0,
     0.1,
     0.7,
     0.2,
     0.0
    ],
    [
     0.0,
     0.0,
     0.0,
     0.0,
     0.0,
     0.1,
     0.7,
     0.2
    ],
    [
     0.2,
     0.0,
     0.0,
     0.0,
     0.0,
     0.0,
     0.1,
     0.7
    ]
   ],
   "optimal_minutes": 84.0828,
   "optimal_start_tack": "port",
   "certainty_equivalent_minutes": 85.5833,
   "layline_minutes": 86.5891,
   "value_iteration_sweeps": 42,
   "value_iteration_final_residual": 0.0,
   "policy_iteration_evaluations": 7,
   "policy_iteration_improvements": 6,
   "policy_iteration_errors": [
    14.43644514539669,
    4.523058069360111,
    1.5043493446381966,
    0.9506449694030294,
    0.01735037438973208,
    0.0005666556050485383,
    0.0
   ],
   "monte_carlo_races": 4000,
   "monte_carlo_mean_optimal": 84.202,
   "monte_carlo_mean_layline": 86.564,
   "share_races_optimal_faster": 0.6162,
   "share_races_tied": 0.0825,
   "max_legs_optimal_any_wind": 33,
   "first_sweep_with_error_below_1_minute": 37,
   "lifted_tack_share_after_shift": 1.0,
   "lifted_tack_states": 900
  },
  "shifty": {
   "label": "Shifty breeze (mdp-engine matrix)",
   "wind_matrix": [
    [
     0.4,
     0.3,
     0.0,
     0.0,
     0.0,
     0.0,
     0.0,
     0.3
    ],
    [
     0.4,
     0.3,
     0.3,
     0.0,
     0.0,
     0.0,
     0.0,
     0.0
    ],
    [
     0.0,
     0.4,
     0.3,
     0.3,
     0.0,
     0.0,
     0.0,
     0.0
    ],
    [
     0.0,
     0.0,
     0.4,
     0.3,
     0.3,
     0.0,
     0.0,
     0.0
    ],
    [
     0.0,
     0.0,
     0.0,
     0.4,
     0.2,
     0.4,
     0.0,
     0.0
    ],
    [
     0.0,
     0.0,
     0.0,
     0.0,
     0.3,
     0.3,
     0.4,
     0.0
    ],
    [
     0.0,
     0.0,
     0.0,
     0.0,
     0.0,
     0.3,
     0.3,
     0.4
    ],
    [
     0.4,
     0.0,
     0.0,
     0.0,
     0.0,
     0.0,
     0.3,
     0.3
    ]
   ],
   "optimal_minutes": 72.4475,
   "optimal_start_tack": "starboard",
   "certainty_equivalent_minutes": 74.3227,
   "layline_minutes": 75.1914,
   "value_iteration_sweeps": 45,
   "value_iteration_final_residual": 0.0,
   "policy_iteration_evaluations": 6,
   "policy_iteration_improvements": 5,
   "policy_iteration_errors": [
    12.541386075275234,
    3.8982608561020697,
    1.3559270470363458,
    0.24317062878564144,
    0.06768273975121986,
    0.0
   ],
   "monte_carlo_races": 4000,
   "monte_carlo_mean_optimal": 72.29,
   "monte_carlo_mean_layline": 74.898,
   "share_races_optimal_faster": 0.6877,
   "share_races_tied": 0.0,
   "max_legs_optimal_any_wind": 31,
   "first_sweep_with_error_below_1_minute": 41,
   "lifted_tack_share_after_shift": 0.9333,
   "lifted_tack_states": 900
  }
 },
 "featured_tack_states_by_row": {
  "port_NW": [
   [],
   [],
   [],
   [],
   [],
   [],
   [],
   [],
   [],
   [],
   [],
   [],
   [],
   [],
   [
    19,
    20
   ],
   [
    18,
    19,
    20
   ],
   [
    16,
    17,
    18,
    19,
    20
   ],
   [
    15,
    16,
    17,
    18,
    19,
    20
   ]
  ],
  "starboard_NW": [
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10
   ]
  ],
  "port_N": [
   [
    17,
    18,
    19,
    20
   ],
   [
    17,
    18,
    19,
    20
   ],
   [
    17,
    18,
    19,
    20
   ],
   [
    16,
    17,
    18,
    19,
    20
   ],
   [
    16,
    17,
    18,
    19,
    20
   ],
   [
    16,
    17,
    18,
    19,
    20
   ],
   [
    16,
    17,
    18,
    19,
    20
   ],
   [
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ]
  ],
  "starboard_N": [
   [
    0,
    1,
    2,
    3
   ],
   [
    0,
    1,
    2,
    3
   ],
   [
    0,
    1,
    2,
    3
   ],
   [
    0,
    1,
    2,
    3,
    4
   ],
   [
    0,
    1,
    2,
    3,
    4
   ],
   [
    0,
    1,
    2,
    3,
    4
   ],
   [
    0,
    1,
    2,
    3,
    4
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9
   ]
  ],
  "port_NE": [
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ],
   [
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
   ]
  ],
  "starboard_NE": [
   [],
   [],
   [],
   [],
   [],
   [],
   [],
   [],
   [],
   [],
   [],
   [],
   [],
   [],
   [
    0,
    1
   ],
   [
    0,
    1,
    2
   ],
   [
    0,
    1,
    2,
    3,
    4
   ],
   [
    0,
    1,
    2,
    3,
    4,
    5
   ]
  ]
 }
}
