@@ -7,7 +7,7 @@ optimization problems called _StochOptFormat_, with the file extension
77For convenience, we abbreviate StochOptFormat to _ SOF_ .
88
99StochOptFormat is defined by the [ JSON schema] ( http://JSON-schema.org )
10- [ ` https://odow.github.io/StochOptFormat/versions/sof-0.2 .schema.json ` ] ( https://odow.github.io/StochOptFormat/versions/sof-0.2 .schema.json ) .
10+ [ ` https://odow.github.io/StochOptFormat/versions/sof-0.3 .schema.json ` ] ( https://odow.github.io/StochOptFormat/versions/sof-0.3 .schema.json ) .
1111
1212_ Note: StochOptFormat is in development. If you have suggestions or comments,
1313please [ open an issue] ( https://github.com/odow/StochOptFormat/issues/new ) ._
@@ -247,36 +247,31 @@ Encoded in StochOptFormat, the newsvendor problem becomes:
247247{
248248 "author" : " Oscar Dowson" ,
249249 "name" : " newsvendor" ,
250- "date" : " 2020-07-10 " ,
250+ "date" : " 2023-05-02 " ,
251251 "description" : " A StochOptFormat implementation of the classical two-stage newsvendor problem." ,
252- "version" : {"major" : 0 , "minor" : 2 },
252+ "version" : {"major" : 0 , "minor" : 3 },
253253 "root" : {
254- "state_variables" : {
255- "x" : {"initial_value" : 0.0 }
256- },
254+ "state_variables" : {"x" : 0.0 },
257255 "successors" : {"first_stage" : 1.0 }
258256 },
259257 "nodes" : {
260258 "first_stage" : {
261259 "subproblem" : " first_stage_subproblem" ,
262- "realizations" : [],
263260 "successors" : {"second_stage" : 1.0 }
264261 },
265262 "second_stage" : {
266263 "subproblem" : " second_stage_subproblem" ,
267264 "realizations" : [
268265 {"probability" : 0.4 , "support" : {"d" : 10.0 }},
269266 {"probability" : 0.6 , "support" : {"d" : 14.0 }}
270- ],
271- "successors" : {}
267+ ]
272268 }
273269 },
274270 "subproblems" : {
275271 "first_stage_subproblem" : {
276272 "state_variables" : {
277273 "x" : {"in" : " x_in" , "out" : " x_out" }
278274 },
279- "random_variables" : [],
280275 "subproblem" : {
281276 "version" : {"major" : 1 , "minor" : 2 },
282277 "variables" : [{"name" : " x_in" }, {"name" : " x_out" }],
@@ -341,13 +336,13 @@ Encoded in StochOptFormat, the newsvendor problem becomes:
341336 },
342337 "validation_scenarios" : [
343338 [
344- {"node" : " first_stage" , "support" : {} },
339+ {"node" : " first_stage" },
345340 {"node" : " second_stage" , "support" : {"d" : 10.0 }}
346341 ], [
347- {"node" : " first_stage" , "support" : {} },
342+ {"node" : " first_stage" },
348343 {"node" : " second_stage" , "support" : {"d" : 14.0 }}
349344 ], [
350- {"node" : " first_stage" , "support" : {} },
345+ {"node" : " first_stage" },
351346 {"node" : " second_stage" , "support" : {"d" : 9.0 }}
352347 ]
353348 ]
@@ -383,12 +378,8 @@ After the optional metadata keys, there are four required keys:
383378 - ` state_variables::Object `
384379
385380 An object describing the state variables in the problem. Each key is the
386- unique name of a state variable. The value is an object with one required
387- key:
388-
389- - ` initial_value::Number `
390-
391- The value of the state variable at the root node.
381+ unique name of a state variable. The initial value of the state variable at
382+ the root node.
392383
393384 - ` successors::Object `
394385
@@ -407,7 +398,7 @@ After the optional metadata keys, there are four required keys:
407398 nodes can refer to the same subproblem to reduce redundancy if they share
408399 the same structural form.
409400
410- - ` realizations::List{Object} `
401+ - ` realizations::List{Object} ` (Optional)
411402
412403 A list of objects describing the finite discrete realizations of the
413404 independent random variable in each node. Each object has two required keys:
@@ -423,7 +414,7 @@ After the optional metadata keys, there are four required keys:
423414 ` random_variables ` , and the values are the value of the random variable in
424415 that realization.
425416
426- - ` successors::Object `
417+ - ` successors::Object ` (Optional)
427418
428419 An object in which the keys correspond to nodes and the values correspond to
429420 the probability of transitioning from the current node to the key node.
@@ -449,7 +440,7 @@ After the optional metadata keys, there are four required keys:
449440 The name of the variable representing the outgoing state variable in the
450441 subproblem.
451442
452- - ` random_variables::List{String} `
443+ - ` random_variables::List{String} ` (Optional)
453444
454445 A list of strings describing the name of each random variable in the
455446 subproblem.
@@ -464,13 +455,20 @@ There is also an optional key:
464455
465456 Scenarios to be used to evaluate a policy. ` validation_scenarios ` is a list,
466457 containing one element for each scenario in the test set. Each element is a
467- list of objects. Each object has two required nodes: ` node::String ` and
468- ` support::Object ` . ` node ` is the name of the node to visit, and ` support ` is
469- the realization of the random variable at that node. Note that ` support ` may
470- be an _ out-of-sample_ realization, that is, one which is not contained in the
471- corresponding ` realizations ` field of the node. Testing a policy is a larger
472- topic, so we expand on it in the section
473- [ Problems, policies, and algorithms] ( #problems-policies-and-algorithms ) .
458+ list of objects. Each object has two required fields:
459+
460+ - ` node::String `
461+
462+ The name of the node to visit.
463+
464+ - ` support::Object ` (Optional)
465+
466+ The realization of the random variable at that node. Note that ` support `
467+ may be an _ out-of-sample_ realization, that is, one which is not contained
468+ in the corresponding ` realizations ` field of the node.
469+
470+ Testing a policy is a larger topic, so we expand on it in the next section,
471+ [ Problems, policies, and algorithms] ( #problems-policies-and-algorithms ) .
474472
475473## Problems, policies, and algorithms
476474
0 commit comments