Under each method, its extensions (Q CS XT Z ZZ IB W U): bold and ticked, it exists; struck, it does not. The extensions and what they mean
Examples: 0 come from the library's tests; 11 were composed from each method's signature and run for this page, on a fresh object, for example o1 = new stzStochasticSolver() o1.AddVariable("x", 0, 10) o1.AddScenario("good", "high demand", [ :d = 8 ], 0.6) o1.AddScenario("bad", "low demand", [ :d = 3 ], 0.4) o1.Maximize("x"). 43 methods have none yet. Examples run on 2026-10-04 07:31 inside the library at commit 0e72e2e2c.
Method
Explanation, as the source carries it
init
(no comment in the source: the name reads as a sentence) initno extension
clear
(no comment in the source: the name reads as a sentence) clearno extension
addVariable
Variables Managementno extension
addIntegerVariable
Same as addVariable: Variables Managementno extension
addBinaryVariable
Same as addVariable: Variables Managementno extension
variables
(no comment in the source: the name reads as a sentence) variablescomposed example
o1 = new stzStochasticSolver()
o1.AddVariable("x", 0, 10)
o1.AddScenario("good", "high demand", [ :d = 8 ], 0.6)
o1.AddScenario("bad", "low demand", [ :d = 3 ], 0.4)
o1.Maximize("x")
? @@( o1.variables() )
#--> [ [ [ "name", "x" ], [ "lowerbound", 0 ], [ "upperbound", 10 ], [ "type", "continuous" ] ] ]composed from the signature, run for this page no extension variableNames
(no comment in the source: the name reads as a sentence) variable namesalso written: VarNamescomposed example
o1 = new stzStochasticSolver()
o1.AddVariable("x", 0, 10)
o1.AddScenario("good", "high demand", [ :d = 8 ], 0.6)
o1.AddScenario("bad", "low demand", [ :d = 3 ], 0.4)
o1.Maximize("x")
? @@( o1.variableNames() )
#--> [ "x" ]composed from the signature, run for this page no extension SetVariableNames
(no comment in the source: the name reads as a sentence) set variable namesno extension
addScenario
Scenario Managementno extension
scenarios
(no comment in the source: the name reads as a sentence) scenariosno extension
validateScenarios
(no comment in the source: the name reads as a sentence) validate scenarioscomposed example
o1 = new stzStochasticSolver()
o1.AddVariable("x", 0, 10)
o1.AddScenario("good", "high demand", [ :d = 8 ], 0.6)
o1.AddScenario("bad", "low demand", [ :d = 3 ], 0.4)
o1.Maximize("x")
o1.ValidateScenarios()
? "the probabilities sum to 1"
#--> the probabilities sum to 1composed from the signature, run for this page no extension addConstraint
Constraints Management - Enhanced to support string valuesno extension
addScenarioConstraint
(no comment in the source: the name reads as a sentence) add scenario constraintno extension
addChanceConstraint
(no comment in the source: the name reads as a sentence) add chance constraintno extension
constraints
(no comment in the source: the name reads as a sentence) constraintsno extension
maximize
Objective Functionno extension
minimize
(no comment in the source: the name reads as a sentence) minimizeno extension
objective
(no comment in the source: the name reads as a sentence) objectivecomposed example
o1 = new stzStochasticSolver()
o1.AddVariable("x", 0, 10)
o1.AddScenario("good", "high demand", [ :d = 8 ], 0.6)
o1.AddScenario("bad", "low demand", [ :d = 3 ], 0.4)
o1.Maximize("x")
? o1.objective()
#--> xcomposed from the signature, run for this page no extension objectiveType
(no comment in the source: the name reads as a sentence) objective typecomposed example
o1 = new stzStochasticSolver()
o1.AddVariable("x", 0, 10)
o1.AddScenario("good", "high demand", [ :d = 8 ], 0.6)
o1.AddScenario("bad", "low demand", [ :d = 3 ], 0.4)
o1.Maximize("x")
? o1.objectiveType()
#--> maximizecomposed from the signature, run for this page no extension setSolverType
Solver Configurationno extension
setRobustnessFactor
(no comment in the source: the name reads as a sentence) set robustness factorno extension
setConfidenceLevel
(no comment in the source: the name reads as a sentence) set confidence levelno extension
evaluateConstraintValue
Enhanced Value Evaluation - New method to handle string constraint valuesno extension
evaluateExpression
(no comment in the source: the name reads as a sentence) evaluate expressionno extension
solve
Main Solving Methods
composed example
o1 = new stzStochasticSolver()
o1.AddVariable("x", 0, 10)
o1.AddScenario("good", "high demand", [ :d = 8 ], 0.6)
o1.AddScenario("bad", "low demand", [ :d = 3 ], 0.4)
o1.Maximize("x")
o1.Solve()
? o1.Status()
#--> optimalcomposed from the signature, run for this page no extensionsolveExpectedValue
Expected Value Method
composed example
o1 = new stzStochasticSolver()
o1.AddVariable("x", 0, 10)
o1.AddScenario("good", "high demand", [ :d = 8 ], 0.6)
o1.AddScenario("bad", "low demand", [ :d = 3 ], 0.4)
o1.Maximize("x")
? @@( o1.solveExpectedValue() )
#--> [ [ "x", 0 ] ]composed from the signature, run for this page no extensionsolveRobust
Robust Optimizationno extension
solveChanceConstrained
Chance-Constrained Programmingno extension
solveMonteCarlo
Monte Carlo Simulation
composed example
o1 = new stzStochasticSolver()
o1.AddVariable("x", 0, 10)
o1.AddScenario("good", "high demand", [ :d = 8 ], 0.6)
o1.AddScenario("bad", "low demand", [ :d = 3 ], 0.4)
o1.Maximize("x")
? @@( o1.solveMonteCarlo() )
#--> [ [ "x", 10 ] ]composed from the signature, run for this page no extensionapplyScenarioParameters
Helper Methodsno extension
parseObjectiveCoefficients
(no comment in the source: the name reads as a sentence) parse objective coefficientsno extension
calculateExpectedResourceCost
(no comment in the source: the name reads as a sentence) calculate expected resource costno extension
calculateWorstCaseResourceCost
(no comment in the source: the name reads as a sentence) calculate worst case resource costno extension
calculateChanceResourceCost
(no comment in the source: the name reads as a sentence) calculate chance resource costno extension
calculateExpectedMaxValue
(no comment in the source: the name reads as a sentence) calculate expected max valueno extension
calculateRobustMaxValue
(no comment in the source: the name reads as a sentence) calculate robust max valueno extension
calculateChanceMaxValue
(no comment in the source: the name reads as a sentence) calculate chance max valueno extension
calculateScenarioMaxValue
(no comment in the source: the name reads as a sentence) calculate scenario max valueno extension
getWorstCaseObjective
(no comment in the source: the name reads as a sentence) get worst case objectiveno extension
solveForScenario
(no comment in the source: the name reads as a sentence) solve for scenariono extension
calculateScenarioObjectiveValue
(no comment in the source: the name reads as a sentence) calculate scenario objective valueno extension
getSolutionValue
(no comment in the source: the name reads as a sentence) get solution valueno extension
analyzeScenarios
Analysis Methods
composed example
o1 = new stzStochasticSolver()
o1.AddVariable("x", 0, 10)
o1.AddScenario("good", "high demand", [ :d = 8 ], 0.6)
o1.AddScenario("bad", "low demand", [ :d = 3 ], 0.4)
o1.Maximize("x")
o1.Solve()
? @@( o1.AnalyzeScenarios() )
#--> [ [ [ "scenario", "good" ], [ "probability", 0.6000 ], [ "objectivevalue", 0 ], [ "feasible", 1 ] ], [ [ "scenario", "bad" ], [ "probability", 0.4000 ], [ "objectivevalue", 0 ], [ "feasible", 1 ] ] ]composed from the signature, run for this page no extensioncheckScenarioFeasibility
(no comment in the source: the name reads as a sentence) check scenario feasibilityno extension
expectedObjectiveValue
(no comment in the source: the name reads as a sentence) expected objective valueno extension
solution
Solution Accessno extension
status
(no comment in the source: the name reads as a sentence) statuscomposed example
o1 = new stzStochasticSolver()
o1.AddVariable("x", 0, 10)
o1.AddScenario("good", "high demand", [ :d = 8 ], 0.6)
o1.AddScenario("bad", "low demand", [ :d = 3 ], 0.4)
o1.Maximize("x")
o1.Solve()
? o1.Status()
#--> optimalcomposed from the signature, run for this page no extension iterations
(no comment in the source: the name reads as a sentence) iterationsno extension
solveTime
(no comment in the source: the name reads as a sentence) solve timeno extension
solverType
(no comment in the source: the name reads as a sentence) solver typecomposed example
o1 = new stzStochasticSolver()
o1.AddVariable("x", 0, 10)
o1.AddScenario("good", "high demand", [ :d = 8 ], 0.6)
o1.AddScenario("bad", "low demand", [ :d = 3 ], 0.4)
o1.Maximize("x")
? o1.solverType()
#--> expectedcomposed from the signature, run for this page no extension show
Display and Reportingno extension
exportToCSV
(no comment in the source: the name reads as a sentence) export to csvno extension
exportScenarioAnalysis
(no comment in the source: the name reads as a sentence) export scenario analysisno extension