@frontlinesystems/rason-mcp-server 2026.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +35 -0
- package/README.md +282 -0
- package/examples/EXAMPLES_REFERENCE.md +128 -0
- package/examples/Optimization/Conic/AirlineHubConic.json +112 -0
- package/examples/Optimization/Conic/AirlineHubConic2.json +109 -0
- package/examples/Optimization/Conic/AirlineHubConic3.json +112 -0
- package/examples/Optimization/Conic/AirlineHubConic4.json +100 -0
- package/examples/Optimization/Conic/AirlineHubConic5.json +102 -0
- package/examples/Optimization/DataBinding/ProductMixCsv.json +82 -0
- package/examples/Optimization/DataBinding/ProductMixCsv4.json +96 -0
- package/examples/Optimization/DataBinding/ProductMixExcel.json +74 -0
- package/examples/Optimization/DataBinding/ProductMixExcel1.json +87 -0
- package/examples/Optimization/DataBinding/ProductMixExcel11.json +109 -0
- package/examples/Optimization/DataBinding/ProductMixExcel2.json +78 -0
- package/examples/Optimization/DataBinding/ProductMixTab.json +90 -0
- package/examples/Optimization/DataBinding/ProductMixTab1.json +74 -0
- package/examples/Optimization/DataBinding/ProductMixTab2.json +78 -0
- package/examples/Optimization/Linear/Inventory.json +200 -0
- package/examples/Optimization/Linear/Matop.json +120 -0
- package/examples/Optimization/Linear/ProductMix.json +98 -0
- package/examples/Optimization/Linear/ProductMix2.json +73 -0
- package/examples/Optimization/Linear/ProductMix3.json +50 -0
- package/examples/Optimization/Linear/ProductMix4.json +57 -0
- package/examples/Optimization/Linear/ProductMixCsv1.json +106 -0
- package/examples/Optimization/Linear/ProductMixCsv2.json +106 -0
- package/examples/Optimization/Linear/ProductMixSQL11.json +82 -0
- package/examples/Optimization/Linear/Rowop.json +127 -0
- package/examples/Optimization/NonLinear/AirlineHub.json +64 -0
- package/examples/Optimization/NonLinear/AirlineHub2.json +48 -0
- package/examples/Optimization/NonLinear/AirlineHub3.json +48 -0
- package/examples/Optimization/NonSmooth/Inventory2.json +160 -0
- package/examples/Optimization/Quadratic/PortfolioOpt.json +56 -0
- package/examples/Optimization/Quadratic/PortfolioOpt2.json +66 -0
- package/examples/Optimization/WithUncertainty/GasCompanyChance.json +79 -0
- package/examples/Optimization/WithUncertainty/GasCompanyRecourse.json +79 -0
- package/examples/Optimization/WithUncertainty/ProjectSelect.json +78 -0
- package/examples/Optimization/WithUncertainty/ProjectSelect2.json +82 -0
- package/examples/Optimization/WithUncertainty/ProjectSelect3.json +85 -0
- package/examples/Optimization/WithUncertainty/ProjectSelect4.json +75 -0
- package/examples/Simulation/CandyStoreSalesUsingSIP.json +148 -0
- package/examples/Simulation/CollegeFundGrowth1.json +424 -0
- package/examples/Simulation/CollegeFundGrowth1SIPModel.json +28 -0
- package/examples/Simulation/CollegeFundGrowth2.json +416 -0
- package/examples/Simulation/CollegeFundGrowthSIP.json +402 -0
- package/examples/Simulation/GBMSimulationModel.json +237 -0
- package/examples/Simulation/YieldManagement(Sim).json +70 -0
- package/examples/Simulation/YieldManagement2(Sim).json +73 -0
- package/examples/calculation/DMNExamples/DMN Box Fun with typeDef result.json +54 -0
- package/examples/calculation/DMNExamples/DMN Context example.json +69 -0
- package/examples/calculation/DMNExamples/DMN DT with typeDef result.json +43 -0
- package/examples/calculation/DMNExamples/FEEL Date Time example.json +28 -0
- package/examples/calculation/DMNExamples/FEEL For iteration example.json +66 -0
- package/examples/calculation/DMNExamples/FEEL For with two indices.json +16 -0
- package/examples/calculation/DMNExamples/FEEL For with typeDef result.json +88 -0
- package/examples/calculation/DMNExamples/FEEL If Then Else example.json +26 -0
- package/examples/calculation/DMNExamples/FEEL List example.json +38 -0
- package/examples/calculation/DMNExamples/FEEL List operator.json +17 -0
- package/examples/calculation/DMNExamples/FEEL List with typeDef collection.json +37 -0
- package/examples/calculation/DMNExamples/FEEL Some or Every example.json +66 -0
- package/examples/calculation/DecisionTables/DT Datasource example.json +53 -0
- package/examples/calculation/DecisionTables/DT Date and Time examples.json +92 -0
- package/examples/calculation/DecisionTables/DT Expression example.json +32 -0
- package/examples/calculation/DecisionTables/DT Hit Policy examples.json +137 -0
- package/examples/calculation/DecisionTables/DT Loan Recommend model.json +82 -0
- package/examples/calculation/DecisionTables/DT Loan Strategy Model and Predictive CSV-XML.json +219 -0
- package/examples/calculation/DecisionTables/DT Loan Strategy model and Datasource.json +286 -0
- package/examples/calculation/DecisionTables/DT Loan Strategy model and Predictive.json +204 -0
- package/examples/calculation/DecisionTables/DT Loan Strategy model by scratch.json +214 -0
- package/examples/calculation/DecisionTables/DT Output Order example.json +40 -0
- package/examples/calculation/DecisionTables/DT Unique example.json +39 -0
- package/examples/calculation/TypeDefinitions/TypeDefCF.json +65 -0
- package/examples/calculation/TypeDefinitions/TypeDefDT.json +58 -0
- package/examples/datamining/AffinityAnalysis/AssociationRules.json +52 -0
- package/examples/datamining/Classification/DecisionTree.json +91 -0
- package/examples/datamining/Classification/DiscriminantAnalysis.json +82 -0
- package/examples/datamining/Classification/Ensembles/Bagging.json +67 -0
- package/examples/datamining/Classification/Ensembles/Boosting.json +68 -0
- package/examples/datamining/Classification/Ensembles/RandomTrees.json +92 -0
- package/examples/datamining/Classification/FindBestModel.json +87 -0
- package/examples/datamining/Classification/LogisticRegression.json +83 -0
- package/examples/datamining/Classification/NaiveBayes.json +79 -0
- package/examples/datamining/Classification/NearestNeighbors.json +85 -0
- package/examples/datamining/Classification/NeuralNetwork.json +93 -0
- package/examples/datamining/Clustering/Hierarchical.json +55 -0
- package/examples/datamining/Clustering/KMeans.json +72 -0
- package/examples/datamining/DataSources/DelimitedFile.json +50 -0
- package/examples/datamining/DataSources/JSONFile.json +50 -0
- package/examples/datamining/DataSources/MSAccessDatabase.json +50 -0
- package/examples/datamining/DataSources/MSExcelTable.json +51 -0
- package/examples/datamining/DataSources/MSSQLDatabase.json +50 -0
- package/examples/datamining/DataSources/ODATATable.json +50 -0
- package/examples/datamining/DataSources/ODBCDatabase.json +50 -0
- package/examples/datamining/FeatureSelection/LinearWrapping.json +54 -0
- package/examples/datamining/FeatureSelection/LogisticWrapping.json +57 -0
- package/examples/datamining/FeatureSelection/Univariate.json +79 -0
- package/examples/datamining/Regression/DecisionTree.json +82 -0
- package/examples/datamining/Regression/Ensembles/Bagging.json +63 -0
- package/examples/datamining/Regression/Ensembles/Boosting.json +63 -0
- package/examples/datamining/Regression/Ensembles/RandomTrees.json +79 -0
- package/examples/datamining/Regression/FindBestModel.json +87 -0
- package/examples/datamining/Regression/LinearRegression.json +125 -0
- package/examples/datamining/Regression/NearestNeighbors.json +78 -0
- package/examples/datamining/Regression/NeuralNetwork.json +83 -0
- package/examples/datamining/Scoring/JSONClassifier.json +63 -0
- package/examples/datamining/Scoring/JSONClassifierNN.json +63 -0
- package/examples/datamining/Scoring/JSONClusterizer.json +38 -0
- package/examples/datamining/Scoring/JSONForecaster.json +50 -0
- package/examples/datamining/Scoring/JSONLinearRegression.json +57 -0
- package/examples/datamining/Scoring/JSONPCA.json +42 -0
- package/examples/datamining/Scoring/JSONRegressor.json +57 -0
- package/examples/datamining/Scoring/JSONTransformer.json +39 -0
- package/examples/datamining/Scoring/PMMLClassifier.json +43 -0
- package/examples/datamining/Scoring/PMMLForecaster.json +44 -0
- package/examples/datamining/Scoring/PMMLRegressor.json +39 -0
- package/examples/datamining/Scoring/PMMLTransformer.json +39 -0
- package/examples/datamining/Simulation/LinearRegressionSimulation.json +118 -0
- package/examples/datamining/Simulation/SyntheticDataGeneration.json +109 -0
- package/examples/datamining/Simulation/pmml-risk-scoring.json +63 -0
- package/examples/datamining/Summarizer/Summarization.json +55 -0
- package/examples/datamining/TextMining/LatentSemanticAnalysis.json +52 -0
- package/examples/datamining/TextMining/TfIdf-FileData.json +66 -0
- package/examples/datamining/TextMining/TfIdf-InlineData.json +56 -0
- package/examples/datamining/TimeSeries/AddHoltWinters.json +80 -0
- package/examples/datamining/TimeSeries/Arima.json +75 -0
- package/examples/datamining/TimeSeries/DoubleExponential.json +66 -0
- package/examples/datamining/TimeSeries/Exponential.json +65 -0
- package/examples/datamining/TimeSeries/LagAnalysis.json +49 -0
- package/examples/datamining/TimeSeries/MovingAverage.json +66 -0
- package/examples/datamining/TimeSeries/MulHoltWinters.json +66 -0
- package/examples/datamining/TimeSeries/NoTrendHoltWinters.json +66 -0
- package/examples/datamining/Transformation/Binning.json +70 -0
- package/examples/datamining/Transformation/CanonicalVariateAnalysis.json +48 -0
- package/examples/datamining/Transformation/CategoryReduction.json +52 -0
- package/examples/datamining/Transformation/Factorization.json +51 -0
- package/examples/datamining/Transformation/MissingDataHandling.json +84 -0
- package/examples/datamining/Transformation/OneHotEncoding-DataInline.json +55 -0
- package/examples/datamining/Transformation/OneHotEncoding-DatainFile.json +49 -0
- package/examples/datamining/Transformation/PartitionTimeSeries.json +49 -0
- package/examples/datamining/Transformation/Partitioning-DF.json +73 -0
- package/examples/datamining/Transformation/Partitioning.json +47 -0
- package/examples/datamining/Transformation/PartitioningWithOversampling-DF.json +66 -0
- package/examples/datamining/Transformation/PartitioningWithOversampling.json +45 -0
- package/examples/datamining/Transformation/PrincipalComponentsAnalysis.json +53 -0
- package/examples/datamining/Transformation/Rescaling.json +68 -0
- package/examples/datamining/Transformation/Sampling.json +44 -0
- package/examples/datamining/Transformation/StratifiedSampling.json +47 -0
- package/examples/flow/SQLServerTransform.json +261 -0
- package/examples/flow/dm-calc-pipeline.json +278 -0
- package/examples/flow/dm-pipeline-simulation.json +114 -0
- package/examples/flow/opt-sim-pipeline.json +160 -0
- package/examples/flow/sim-dm-pipeline.json +107 -0
- package/examples/flow/sim-sim-pipeline.json +137 -0
- package/examples/index.json +4679 -0
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/DataFiltering/ListwithFilter.json +53 -0
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/Loops/ProductMix5.json +58 -0
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/Loops/compoundWhileStatement.json +36 -0
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/Loops/ifThenElseStatement.json +34 -0
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/Loops/nestedLoop.json +26 -0
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/ParallelArray.json +48 -0
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/indexedArray.json +70 -0
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/nonParallelArray.json +50 -0
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/sumAggregateExample.json +338 -0
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/tsp.json +62 -0
- package/examples/rason-features/BoxIterators/Box_Fun_Loop_Iter_Sim_RASON.json +191 -0
- package/examples/rason-features/BoxIterators/Box_Fun_Loop_Sim_RASON.json +76 -0
- package/examples/rason-features/BoxIterators/Box_Fun_Sim_RASON.json +109 -0
- package/examples/rason-features/BoxIterators/Box_Iter_SIM_RASON.json +69 -0
- package/examples/rason-features/BoxIterators/Box_Iterator_Calc_Loop.json +183 -0
- package/examples/rason-features/BoxIterators/Box_Iterator_with_typeDef_partial.json +79 -0
- package/examples/rason-features/BoxLambdaExamples/BoxFunOptimize.json +155 -0
- package/examples/rason-features/BoxLambdaExamples/BoxFunSimulate.json +119 -0
- package/examples/rason-features/BoxLambdaExamples/LambdaFunOptimize.json +143 -0
- package/examples/rason-features/BoxLambdaExamples/LambdaFunSimulate.json +82 -0
- package/examples/rason-features/ReferenceGuide/RGFirehouseLocation.json +69 -0
- package/examples/rason-features/ReferenceGuide/RGFirehouseLocationConic.json +114 -0
- package/examples/rason-features/ReferenceGuide/RGProductMixCsv1.json +108 -0
- package/examples/rason-features/ReferenceGuide/RGProductMixExcel11.json +117 -0
- package/examples/rason-features/ReferenceGuide/RGProductMixSQL11.json +108 -0
- package/examples/rason-features/UserGuide/UGAirlineHubCSV.json +67 -0
- package/examples/rason-features/UserGuide/UGForecast.json +51 -0
- package/examples/rason-features/UserGuide/UGProductMix1.json +49 -0
- package/examples/rason-features/UserGuide/UGProductMix2.json +49 -0
- package/examples/rason-features/UserGuide/UGProductMixTab1.json +68 -0
- package/examples/rason-features/UserGuide/UGProductMixTab2.json +77 -0
- package/examples/rason-features/UserGuide/UGProductMixTab3.json +67 -0
- package/examples/rason-features/UserGuide/UGProductMixTab4.json +71 -0
- package/examples/rason-features/UserGuide/UGProductMixTab5.json +68 -0
- package/examples/rason-features/UserGuide/UGProjectSelect0.json +92 -0
- package/examples/rason-features/UserGuide/UGProjectSelect1.json +75 -0
- package/examples/rason-features/UserGuide/UGProjectSelect2.json +75 -0
- package/examples/rason-features/UserGuide/UGYieldManagement1.json +62 -0
- package/examples/rason-features/UserGuide/UGYieldManagement2.json +62 -0
- package/examples/rason-features/UserGuide/UGYieldManagement3.json +64 -0
- package/out/index.cjs +361 -0
- package/package.json +76 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
{
|
|
2
|
+
"modelName": "Inventory2Example",
|
|
3
|
+
"modelDescription": "Inventory2 Nonsmooth RASON Optimization Example: This example uses the same model as used in the Inventory example (under Examples -- Optimization -- Linear Optimizations) without the use of automatic transformation. Recall that this example minimizes the inventory ordering and holding costs while ensuring there is enough inventory on hand to meet demand over a number of time periods, as well as with maintaining minimum inventory levels for each product. As a result the nonsmooth engine, the Optquest Engine, will be used to solve the model. Note that nonsmooth models are much harder to solve and typically result in a slower solve time. Set transformationNonSmooth to True, below, to automatically transform the model into a linear model with a faster solve time.",
|
|
4
|
+
"modelType": "optimization",
|
|
5
|
+
"modelSettings": {
|
|
6
|
+
"comment": "Set transformationNonSmooth to True to automatically transform the model into a linear model with a faster solve time.",
|
|
7
|
+
"transformNonSmooth": false
|
|
8
|
+
},
|
|
9
|
+
"variables": {
|
|
10
|
+
"comment": "In the original model, Inventory.json, all 9 variables were created separately. In this example, three variable blocks are created, x, y and z, representing the amount of product to be purchased in each time period. Note that each variable is specified to be an integer with an upper bound of 500 and a lower bound of 0. Since the keyword finalValue is present, all variable final values will be returned in the result. ",
|
|
11
|
+
"x": {
|
|
12
|
+
"comment": "xi = the amount of product 1 to purchase in time period i = 1,2,3. Variables have been given a lower bound of 0 and an upper bound of 500. The final variable value will appear in the result due to the property, 'finalValue'.",
|
|
13
|
+
"dimensions": [ 3 ],
|
|
14
|
+
"type": "int",
|
|
15
|
+
"upper": 500,
|
|
16
|
+
"lower": 0,
|
|
17
|
+
"finalValue": []
|
|
18
|
+
},
|
|
19
|
+
"y": {
|
|
20
|
+
"comment": "yi = the amount of product 2 to purchase in time period i = 1,2,3. Variables have been given a lower bound of 0 and an upper bound of 500. The final variable value will appear in the result due to the property, 'finalValue'.",
|
|
21
|
+
"dimensions": [ 3 ],
|
|
22
|
+
"type": "int",
|
|
23
|
+
"upper": 500,
|
|
24
|
+
"lower": [ 0, 0, 0 ],
|
|
25
|
+
"finalValue": []
|
|
26
|
+
},
|
|
27
|
+
"z": {
|
|
28
|
+
"comment": "zi = the amount of product 3 to purchase in time period i = 1,2,3. Variables have been given a lower bound of 0 and an upper bound of 500. The final variable value will appear in the result due to the property, 'finalValue'.",
|
|
29
|
+
"dimensions": [ 3 ],
|
|
30
|
+
"type": "int",
|
|
31
|
+
"upper": 500,
|
|
32
|
+
"lower": 0,
|
|
33
|
+
"finalValue": []
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"formulas": {
|
|
37
|
+
"comment": "Formulas calculating Inventory for each product in each time period. Initial Inventory for all products in period 1 is 0. Calculate inventory using the following formula: Initial inventory + production in period 1 - demand in period 1 + production in period 2 - demand in period 2 + production in period 3 - demand in period 3.",
|
|
38
|
+
"ix1": {
|
|
39
|
+
"comment": "Inventory for product 1 after period 1. 0 = no demand for product 1 in period 1.",
|
|
40
|
+
"formula": "x[1]-0"
|
|
41
|
+
},
|
|
42
|
+
"iy1": {
|
|
43
|
+
"comment": "Inventory for product 2 after period 1. 50 = demand for product 2 in period 1.",
|
|
44
|
+
"formula": "y[1] - 50"
|
|
45
|
+
},
|
|
46
|
+
"iz1": {
|
|
47
|
+
"comment": "Inventory for product 3 after period 1. 0 = no demand for product 3 in period 1.",
|
|
48
|
+
"formula": "z[1] - 0"
|
|
49
|
+
},
|
|
50
|
+
"ix2": {
|
|
51
|
+
"comment": "Inventory for product 1 after period 2. 20 = demand for product 1 in period 2.",
|
|
52
|
+
"formula": "ix1 + x[2] - 20"
|
|
53
|
+
},
|
|
54
|
+
"iy2": {
|
|
55
|
+
"comment": "Inventory for product 2 after period 2. 0 = no demand for product 1 in period 2.",
|
|
56
|
+
"formula": "iy1 + y[2] - 0"
|
|
57
|
+
},
|
|
58
|
+
"iz2": {
|
|
59
|
+
"comment": "Inventory for product 3 after period 2. 100 = demand for product 1 in period 2.",
|
|
60
|
+
"formula": "iz1 + z[2] - 100"
|
|
61
|
+
},
|
|
62
|
+
"ix3": {
|
|
63
|
+
"comment": "Inventory for product 1 after period 3. 0 = no demand for product 1 in period 3.",
|
|
64
|
+
"formula": "ix2 + x[3] - 0"
|
|
65
|
+
},
|
|
66
|
+
"iy3": {
|
|
67
|
+
"comment": "Inventory for product 2 after period 3. 50 = demand for product 1 in period 3.",
|
|
68
|
+
"formula": "iy2 + y[3] - 50"
|
|
69
|
+
},
|
|
70
|
+
"iz3": {
|
|
71
|
+
"comment": "Inventory for product 3 after period 3. 0 = no demand for product 1 in period 3.",
|
|
72
|
+
"formula": "iz2 + z[3] - 0"
|
|
73
|
+
},
|
|
74
|
+
"px": {
|
|
75
|
+
"comment": "If x1, x2 or x3 are nonzero, px[i] = 1. This indicates if any product was purchased (1) or not (0)",
|
|
76
|
+
"dimensions": [ 3 ],
|
|
77
|
+
"formula": "if(x > 0, 1, 0)"
|
|
78
|
+
},
|
|
79
|
+
"py": {
|
|
80
|
+
"comment": "If y1, y2 or y3 are nonzero, py[i] = 1. This indicates if any product was purchased (1) or not (0)",
|
|
81
|
+
"dimensions": [ 3 ],
|
|
82
|
+
"formula": "if(y > 0, 1, 0)"
|
|
83
|
+
},
|
|
84
|
+
"pz": {
|
|
85
|
+
"comment": "If z1, z2 or z3 are nonzero, pz[i] = 1. This indicates if any product was purchased (1) or not (0)",
|
|
86
|
+
"dimensions": [ 3 ],
|
|
87
|
+
"formula": "if(z > 0, 1, 0)"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"constraints": {
|
|
91
|
+
"c1": {
|
|
92
|
+
"comment": "Ending inventory for product 1 in period 1.",
|
|
93
|
+
"formula": "ix1",
|
|
94
|
+
"lower": 0,
|
|
95
|
+
"finalValue": []
|
|
96
|
+
},
|
|
97
|
+
"c2": {
|
|
98
|
+
"comment": "Ending inventory for product 2 in period 1.",
|
|
99
|
+
"formula": "iy1",
|
|
100
|
+
"lower": 0,
|
|
101
|
+
"finalValue": []
|
|
102
|
+
},
|
|
103
|
+
"c3": {
|
|
104
|
+
"comment": "Ending inventory for product 3 in period 1.",
|
|
105
|
+
"formula": "iz1",
|
|
106
|
+
"lower": 0,
|
|
107
|
+
"finalValue": []
|
|
108
|
+
},
|
|
109
|
+
"c4": {
|
|
110
|
+
"comment": "Ending inventory for product 1 in period 2.",
|
|
111
|
+
"formula": "ix2",
|
|
112
|
+
"lower": 0,
|
|
113
|
+
"finalValue": []
|
|
114
|
+
},
|
|
115
|
+
"c5": {
|
|
116
|
+
"comment": "Ending inventory for product 2 in period 2.",
|
|
117
|
+
"formula": "iy2",
|
|
118
|
+
"lower": 20,
|
|
119
|
+
"finalValue": []
|
|
120
|
+
},
|
|
121
|
+
"c6": {
|
|
122
|
+
"comment": "Ending inventory for product 3 in period 2.",
|
|
123
|
+
"formula": "iz2",
|
|
124
|
+
"lower": 0,
|
|
125
|
+
"finalValue": []
|
|
126
|
+
},
|
|
127
|
+
"c7": {
|
|
128
|
+
"comment": "Ending inventory for product 1 in period 3.",
|
|
129
|
+
"formula": "ix3",
|
|
130
|
+
"lower": 50,
|
|
131
|
+
"finalValue": []
|
|
132
|
+
},
|
|
133
|
+
"c8": {
|
|
134
|
+
"comment": "Ending inventory for product 2 in period 3.",
|
|
135
|
+
"formula": "iy3",
|
|
136
|
+
"lower": 20,
|
|
137
|
+
"finalValue": []
|
|
138
|
+
},
|
|
139
|
+
"c9": {
|
|
140
|
+
"comment": "Ending inventory for product 3 in period 3.",
|
|
141
|
+
"formula": "iz3",
|
|
142
|
+
"lower": 100,
|
|
143
|
+
"finalValue": []
|
|
144
|
+
},
|
|
145
|
+
"c10": {
|
|
146
|
+
"comment": "Creates 3 constraints: Maximum purchased products in periods 1,2,3 must not exceed 150.",
|
|
147
|
+
"dimensions": [ 3 ],
|
|
148
|
+
"formula": "x + y + z",
|
|
149
|
+
"upper": 150,
|
|
150
|
+
"finalValue": []
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"objective": {
|
|
154
|
+
"comment": "objective function minimizes the ordering cost per time period p1 - 500, p2 - 400 and p3 - 300 plus the holding cost per product (10) held over in inventory. ",
|
|
155
|
+
"name": "obj",
|
|
156
|
+
"type": "minimize",
|
|
157
|
+
"finalValue": [],
|
|
158
|
+
"formula": "500*sum(px) + 400*sum(py) + 300*sum(pz) + 10*(ix1+ix2+ix3+iy1+iy2+iy3+iz1+iz2+iz3)"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"modelName": "PortfolioOptExample",
|
|
3
|
+
"modelDescription": "Quadratic (QP) RASON example: This model finds the optimal allocation of funds to stocks that minimizes the portfolio risk, measured by portfolio Variance (a quadratic function), computed via a custom QUADPRODUCT function. This quadratic programming (QP) model can be solved with the GRG Nonlinear Solver, or more efficiently with the LP/Quadratic Solver or the SOCP Barrier Solver.",
|
|
4
|
+
"modelType": "optimization",
|
|
5
|
+
"variables": {
|
|
6
|
+
"comment": "The variables in the x array are the percentage allocations of the funds to invest in each stock. All variables must have a lower bound of 0 (lower: 0) to ensure no stocks are allocated a negative amount.",
|
|
7
|
+
"x": {
|
|
8
|
+
"comment": "x[i] = the amt to be invested in each stock.",
|
|
9
|
+
"value": [ 0.2, 0.2, 0.2, 0.2, 0.2 ],
|
|
10
|
+
"lower": 0,
|
|
11
|
+
"finalValue": []
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"data": {
|
|
15
|
+
"comment": "The data section (optional) can be used to setup constant arrays or generate formulas to be utilized in the constraints and objective.",
|
|
16
|
+
"lin_term": {
|
|
17
|
+
"comment": "The QUADPRODUCT function in the objective computes the portfolio variance, which is defined by RASON Decision Services. This function can be used to compute any 'quadratic form' such as xTQx + cx. In this example, the elements of the matrix 'cov' are the covariances of returns or pairs of stocks, and the elements of the vector lin_term, which are all zero. You could instead compute the portfolio variance using a series of Excel formulas using multiplication and addition, but it is more convenient to use the QUADPRODUCT function.",
|
|
18
|
+
"value": [ 0, 0, 0, 0, 0 ]
|
|
19
|
+
},
|
|
20
|
+
"stock": {
|
|
21
|
+
"comment": "This array holds the expected returns for the 5 stocks.",
|
|
22
|
+
"value": [ 0.07, 0.08, 0.095, 0.065, 0.14 ]
|
|
23
|
+
},
|
|
24
|
+
"cov": {
|
|
25
|
+
"comment": "This matrix holds the covariances between all 5 stocks.",
|
|
26
|
+
"value": [
|
|
27
|
+
[ 0.025, 0.001, 0.01, -0.005, 0.01 ],
|
|
28
|
+
[ 0.001, 0.04, -0.001, 0.012, -0.0085 ],
|
|
29
|
+
[ 0.01, -0.001, 0.012, 0.0065, 0.0075 ],
|
|
30
|
+
[ -0.005, 0.012, 0.0065, 0.08, 0.01 ],
|
|
31
|
+
[ 0.01, -0.0085, 0.0075, 0.01, 0.07 ]
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"constraints": {
|
|
36
|
+
"comment": "There are 3 constraints in this portfolio optimization model.",
|
|
37
|
+
"total": {
|
|
38
|
+
"comment": "This constraint ensures that the total amount of funds is invested by ensuring that the sum of the variables is equal to 1.",
|
|
39
|
+
"formula": "sum(x)",
|
|
40
|
+
"equal": 1
|
|
41
|
+
},
|
|
42
|
+
"return": {
|
|
43
|
+
"comment": "This constraint takes the sumproduct between the variable x array and the expected stock returns and ensures that the total return is greater than 9.5%.",
|
|
44
|
+
"formula": "sumproduct(x, stock)",
|
|
45
|
+
"lower": 0.095
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"objective": {
|
|
49
|
+
"variance": {
|
|
50
|
+
"comment": "The objective minimizes the variance of the portfolio given the QUADPRODUCT function. See the comment in the data section for more information on this function.",
|
|
51
|
+
"type": "minimize",
|
|
52
|
+
"formula": "quadproduct(x, lin_term, cov)",
|
|
53
|
+
"finalValue": []
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"modelName": "PortfolioOpt2Example",
|
|
3
|
+
"modelDescription": "RASON Portfolio Opt 2 Example with Multiple Optimizations. This is similar to the original PortfolioOpt, a portfolio optimization model, but here we run 2 optimizations, using a different minimum variance value for each solve, using the optimization parameter PsiOptParam. PsiOptParam varies the Desired Return from 9.5% to 10% by setting the number of optimizations to 2 in modelSettings. PsiOptParam is introduced in the Parameters section and then called in the 'return' constraint. In the first optimization, the minimum variance = 9.5% and 10% in the 2nd optimization. The result will contain the final variable and objective function values for each optimization.",
|
|
4
|
+
"modelType": "optimization",
|
|
5
|
+
"modelSettings": {
|
|
6
|
+
"comment": "Set the number of optimizations for the optimization parameter, PsiOptParam, in this section.",
|
|
7
|
+
"numOptimizations": 2
|
|
8
|
+
},
|
|
9
|
+
"variables": {
|
|
10
|
+
"comment": "The variables section remains unchanged from the original Portfolio example. There are still 5 decision variables, all with a lower bound of 0. The final variable values for each optimization will be included in the result since 'finalValue' is present.",
|
|
11
|
+
"x": {
|
|
12
|
+
"comment": "x[i] = the amt to be invested in each stock.",
|
|
13
|
+
"value": [ 0.2, 0.2, 0.2, 0.2, 0.2 ],
|
|
14
|
+
"lower": 0,
|
|
15
|
+
"finalValue": []
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"parameters": {
|
|
19
|
+
"comment": "Since numOptimizations is set to 2 within 'modelSettings', PsiOptParam will vary the 'desired' parameter by 9.5% in the first optimization and 10% in the 2nd optimization. For more information on this function, see https://www.solver.com/risk-solver-help/psi-function-help/optimization/PsiOptParam",
|
|
20
|
+
"desired": {
|
|
21
|
+
"formula": "PsiOptParam(0.095, 0.1)",
|
|
22
|
+
"finalValue": []
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"data": {
|
|
26
|
+
"lin_term": {
|
|
27
|
+
"comment": "The QUADPRODUCT function in the objective computes the portfolio variance, which is defined by RASON Decision Services. This function can be used to compute any 'quadratic form' such as xTQx + cx. In this example, the elements of the matrix 'cov' are the covariances of returns or pairs of stocks, and the elements of the vector lin_term, which are all zero. You could instead compute the portfolio variance using a series of Excel formulas using multiplication and addition, but it is more convenient to use the QUADPRODUCT function.",
|
|
28
|
+
"value": [ 0, 0, 0, 0, 0 ]
|
|
29
|
+
},
|
|
30
|
+
"stock": {
|
|
31
|
+
"comment": "This array holds the expected returns for the 5 stocks.",
|
|
32
|
+
"value": [ 0.07, 0.08, 0.095, 0.065, 0.14 ]
|
|
33
|
+
},
|
|
34
|
+
"cov": {
|
|
35
|
+
"comment": "This matrix holds the covariances between all 5 stocks.",
|
|
36
|
+
"value": [
|
|
37
|
+
[ 0.025, 0.001, 0.01, -0.005, 0.01 ],
|
|
38
|
+
[ 0.001, 0.04, -0.001, 0.012, -0.0085 ],
|
|
39
|
+
[ 0.01, -0.001, 0.012, 0.0065, 0.0075 ],
|
|
40
|
+
[ -0.005, 0.012, 0.0065, 0.08, 0.01 ],
|
|
41
|
+
[ 0.01, -0.0085, 0.0075, 0.01, 0.07 ]
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"constraints": {
|
|
46
|
+
"comment": "There are still 3 constraints in this portfolio optimization model.",
|
|
47
|
+
"total": {
|
|
48
|
+
"comment": "This constraint ensures that the total amount of funds is invested by ensuring that the sum of the variables is equal to 1.",
|
|
49
|
+
"formula": "sum(x)",
|
|
50
|
+
"equal": 1
|
|
51
|
+
},
|
|
52
|
+
"return": {
|
|
53
|
+
"comment": "This constraint takes the sumproduct between the variable x array and the expected stock returns and ensures that the actual return is greater than the desired return. In the 1st optimization, desired = 9.5% and 10% in the 2nd optimization.",
|
|
54
|
+
"formula": "sumproduct(x, stock) - desired",
|
|
55
|
+
"lower": 0
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"objective": {
|
|
59
|
+
"variance": {
|
|
60
|
+
"comment": "The objective minimizes the variance of the portfolio given the QUADPRODUCT function. See the comment in the data section for more information on this function. Both objectives will be listed by Optimization Index in the results.",
|
|
61
|
+
"type": "minimize",
|
|
62
|
+
"formula": "quadproduct(x, lin_term, cov)",
|
|
63
|
+
"finalValue": []
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"modelName": "GasCompanyChanceExample",
|
|
3
|
+
"modelDescription": "RASON example model using chance constraints: A gas company buys gas and then sells it to its consumers. The consumer demand this year is expected to be 100 units and price is $5 per unit. Next year's gas price and demand will depend on the weather. In the 2nd year, the weather could be either very cold or warm. If the weather is very cold, demand will be 180 with price of $7.50. If the weather is warm, demand will be 100 with a price of $5.00. Demand and price are perfectly correlated since both depend on the weather. To capture this, we use the Beta distribution for the uncertain variable, D5, in the calculation of both the demand and the price in year 2. The gas company can buy gas this year at the current price of $5/unit and store it for use next year. If gas is stored, there will be an associated holding or storage cost of $1/unit per year. How much gas should the company purchase this year (before next year's demand is known) and next year (after next year's demand is known)? This example models this problem with a chance constraint, assuming that all three decisions are 'here and now'.",
|
|
4
|
+
"modelType": "optimization",
|
|
5
|
+
"modelSettings": {
|
|
6
|
+
"comment": "Use 'transformStochastic' to determine whether RASON Decision Services will attempt to transform your optimization model with uncertainty into a conventional optimization model without uncertainty: either the Deterministic Equivalent model, (using transformStochastic: deterministicEquivalent as used in stochastic linear programming), or a Robust Counterpart model (using transformStochastic: robustCounterpart as used in robust optimization). In both cases, the result of a successful transformation is a conventional linear programming model, but with considerably more decision variables and constraints than the original model. Generally, the Robust Counterpart model is much smaller than the Deterministic Equivalent model, but the solution of this model may be only an approximate (and conservative) solution of the original problem. The option 'chanceConstraintNorm:D', has an effect only if the Solve Uncertain Models option is set to Stochastic Transformation, and the Stochastic Transformation option is set to either Robust Counterpart or Automatic (and the Automatic method selects the Robust Counterpart form). It determines the norm (distance measure) used to constrain the size of uncertainty sets in the Robust Counterpart model. Select from the L1 Norm, L2 Norm, L-Inf Norm, or D Norm (the default). The D norm is equivalent to the intersection of the L1 norm and L-Inf (infinity) norm. If you choose the L2 norm, the Robust Counterpart model will be a SOCP (second order cone programming) model, which requires an SOCP or smooth nonlinear solver (such as the Platform's SOCP Barrier Solver or GRG Nonlinear Solver). If you choose the L1, L-Inf or D norm, the Robust Counterpart model will be an LP (linear programming) model, that can be solved efficiently with an LP, QP, or SOCP Solver. For more information, on this option, see https://www.solver.com/robust-decision-making. The option, numTrials, sets the number of trials to 100.",
|
|
7
|
+
"transformStochastic": "robustCounterpart",
|
|
8
|
+
"chanceConstraintNorm": "D",
|
|
9
|
+
"numTrials": 100
|
|
10
|
+
},
|
|
11
|
+
"variables": {
|
|
12
|
+
"comment": "These are the decision variables in the model. There are 3.",
|
|
13
|
+
"d14:d15": {
|
|
14
|
+
"comment": "D14 = Amt of gas to purchase and resell in yr 1, D15 = Amt of gas to buy and store in yr 1. Both variables have a lower bound of 0.",
|
|
15
|
+
"lower": 0,
|
|
16
|
+
"finalValue": []
|
|
17
|
+
},
|
|
18
|
+
"d18": {
|
|
19
|
+
"comment": "D18 = Amt of gas to buy and resell in yr 2.",
|
|
20
|
+
"lower": 0,
|
|
21
|
+
"finalValue": []
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"uncertainVariables": {
|
|
25
|
+
"comment": "This section holds the uncertain variables, or the uncertainty, in the model.",
|
|
26
|
+
"d5": {
|
|
27
|
+
"comment": "This uncertain variable models the perfect correlation of demand and price since both depend on the weather. For more information on the PsiBeta distribution, see https://www.solver.com/risk-solver-help/psi-function-help/simulation/distributions/psibeta",
|
|
28
|
+
"formula": "PsiBeta(2, 3.25)"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"formulas": {
|
|
32
|
+
"c4": {
|
|
33
|
+
"comment": "Gas price in yr 1",
|
|
34
|
+
"value": 5
|
|
35
|
+
},
|
|
36
|
+
"c5": {
|
|
37
|
+
"comment": "Models gas price in year 2. The minimum price is $5. The incremental price of $2.50 depends on the weather, modeled by the uncertain variable.",
|
|
38
|
+
"formula": "5 + 2.5*d5"
|
|
39
|
+
},
|
|
40
|
+
"c6": {
|
|
41
|
+
"comment": "Storage cost per unit per year.",
|
|
42
|
+
"value": 1
|
|
43
|
+
},
|
|
44
|
+
"c7": {
|
|
45
|
+
"comment": "Demand in year 1.",
|
|
46
|
+
"value": 100
|
|
47
|
+
},
|
|
48
|
+
"c8": {
|
|
49
|
+
"comment": "Models demand in yr 2. The minimum demand is 100. The incremental demand of 80 depends on the weather, modeled by the uncertain variable.",
|
|
50
|
+
"formula": "100 + 80*d5"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"constraints": {
|
|
54
|
+
"comment": "Two constraints: 1st ensures that the demand in yr 1 is met, the 2nd is a chance constraint that ensures that the demand in yr 2 is met 95% of the time. For more information on chance constraints, see Defining Your Stochastic Optimization model on the Help tab.",
|
|
55
|
+
"c22": {
|
|
56
|
+
"comment": "Ensures Demand is met in Year 1",
|
|
57
|
+
"formula": "d14 - c7",
|
|
58
|
+
"lower": 0,
|
|
59
|
+
"upper": 0
|
|
60
|
+
},
|
|
61
|
+
"c23": {
|
|
62
|
+
"comment": "Chance constraint: Ensures that the demand in Year 2 is met 95% of the time.",
|
|
63
|
+
"formula": "d15 + d18 - c8",
|
|
64
|
+
"lower": 0,
|
|
65
|
+
"chanceType": "VaR",
|
|
66
|
+
"chanceProbability": 0.95
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"objective": {
|
|
70
|
+
"comment": "The objective is to minimize the total expected cost.",
|
|
71
|
+
"c25": {
|
|
72
|
+
"comment": "Since this model contains uncertainty, the objective must minimize the expected value of the objective or MIN: Mean(C25)",
|
|
73
|
+
"formula": "(d14*c4) + (c5*d18) + (d15*(c4+c6))",
|
|
74
|
+
"type": "min",
|
|
75
|
+
"chanceType": "ExpVal",
|
|
76
|
+
"finalValue": []
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"modelName": "GasCompanyRecourseExample",
|
|
3
|
+
"modelDescription": "RASON example model with recourse variables: A gas company buys gas and then sells it to its consumers. The consumer demand this year is expected to be 100 units and price is $5 per unit. Next year's gas price and demand will depend on the weather: If Cold, Price = $7.50 with demand = 180, if Warm: Price = $5.00 with demand = 100. Demand and price are perfectly correlated since both depend on the weather. To capture this, we use the Beta distribution to calculate both the demand and the price in year 2. The gas company can buy gas this year at the current price of $5/unit and store it for use next year. If gas is stored for next year, there will be an associated holding or storage cost of $1/unit per year. How much gas should the company purchase this year (before next year's demand is known) and next year (after next year's demand is known)? This example models this problem with a 'wait and see' recourse variable. See GasCompanyChance to see this same model formulated with just a chance constraint.",
|
|
4
|
+
"modelType": "optimization",
|
|
5
|
+
"modelSettings": {
|
|
6
|
+
"comment": "Use 'transformStochastic' to determine whether RASON Decision Services will attempt to transform your optimization model with uncertainty into a conventional optimization model without uncertainty: either the Deterministic Equivalent model (using transformStochastic: deterministicEquivalent as used in stochastic linear programming), or a Robust Counterpart model (transformStochastic: robustCounterpart as used in robust optimization). In both cases, the result of a successful transformation is a conventional linear programming model, but with considerably more decision variables and constraints than the original model. Generally, the Robust Counterpart model is much smaller than the Deterministic Equivalent model, but the solution of this model may be only an approximate (and conservative) solution of the original problem. The option numTrials sets the number of trials in the simulation to 90.",
|
|
7
|
+
"transformStochastic": "deterministicEquivalent",
|
|
8
|
+
"numTrials": 90
|
|
9
|
+
},
|
|
10
|
+
"variables": {
|
|
11
|
+
"comment": "There are two normal or 'here and now' decisions and 1 recourse decision variable.",
|
|
12
|
+
"d14:d15": {
|
|
13
|
+
"comment": "D14 = Amt of gas bought in yr 1 to be used in yr 1, D15 = Amt of gas purchased in year 1 for use in year 2. Both have lower bounds of 0.",
|
|
14
|
+
"lower": 0,
|
|
15
|
+
"finalValue": []
|
|
16
|
+
},
|
|
17
|
+
"d18": {
|
|
18
|
+
"comment": "D18 is a recourse variable and denotes the amount of gas to purchase and use in year 2. There will be 90 different solutions for this variable, one for each trial.",
|
|
19
|
+
"lower": 0,
|
|
20
|
+
"recourse": true,
|
|
21
|
+
"finalValue": []
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"uncertainVariables": {
|
|
25
|
+
"comment": "This section holds the uncertain variables, or the uncertainty, in the model.",
|
|
26
|
+
"d5": {
|
|
27
|
+
"comment": "This uncertain variable models the perfect correlation of demand and price since both depend on the weather. For more information on the PsiBeta distribution, see https://www.solver.com/risk-solver-help/psi-function-help/simulation/distributions/psibeta",
|
|
28
|
+
"formula": "PsiBeta(2, 3.25)"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"data": {
|
|
32
|
+
"comment": "Use the 'data' section to setup constant data.",
|
|
33
|
+
"c4": {
|
|
34
|
+
"comment": "Gas price in yr 1",
|
|
35
|
+
"value": 5
|
|
36
|
+
},
|
|
37
|
+
"c6": {
|
|
38
|
+
"comment": "Storage cost per unit per year.",
|
|
39
|
+
"value": 1
|
|
40
|
+
},
|
|
41
|
+
"c7": {
|
|
42
|
+
"comment": "Demand in year 1.",
|
|
43
|
+
"value": 100
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"formulas": {
|
|
47
|
+
"comment": "Use the 'formulas' section to calculate intermediary formulas for use in the constraints and objective.",
|
|
48
|
+
"c5": {
|
|
49
|
+
"comment": "Models gas price in year 2. The minimum price is $5. The incremental price of $2.50 depends on the weather, modeled by the uncertain variable.",
|
|
50
|
+
"formula": "5 + 2.5*d5"
|
|
51
|
+
},
|
|
52
|
+
"c8": {
|
|
53
|
+
"comment": "Models demand in yr 2. The minimum demand is 100. The incremental demand of 80 depends on the weather, modeled by the uncertain variable.",
|
|
54
|
+
"formula": "100 + 80*d5"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"constraints": {
|
|
58
|
+
"comment": "Two constraints: 1st ensures that the demand in yr 1 is met, the 2nd is a chance constraint that ensures that the demand in yr 2 is met 95% of the time.",
|
|
59
|
+
"c22": {
|
|
60
|
+
"comment":"Ensures that demand is met in year 1.",
|
|
61
|
+
"formula": "d14",
|
|
62
|
+
"equal": "c7"
|
|
63
|
+
},
|
|
64
|
+
"c23": {
|
|
65
|
+
"comment": "Ensures that the demand in year 2 is met 95% of the time.",
|
|
66
|
+
"formula": "d15 + d18 - c8",
|
|
67
|
+
"lower": 0
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"objective": {
|
|
71
|
+
"c25": {
|
|
72
|
+
"comment": "The expected value of the total cost is being minimized in the objective. Since this formula depends on the recourse variable (D18) and thus has 90 values (numtrials = 90), we must reduce this quantity to 1. To do so, we minimize the expected total cost.",
|
|
73
|
+
"formula": "(d14*c4) + (c5*d18) + d15*(c4+c6)",
|
|
74
|
+
"type": "min",
|
|
75
|
+
"chanceType": "ExpVal",
|
|
76
|
+
"finalValue": []
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"modelName": "ProjectSelectExample",
|
|
3
|
+
"modelDescription": "RASON Simulation Optimization Example with Excel ranges as array names: A company is considering eight different investment projects for the coming year. Each project's expected cash flow can be modeled as a PsiTriangular distribution with Minimum, Likely, and Maximum parameters. There is a 90% chance that each project chosen will be successful. The Initial Investment for each project can be found in F1:F8 block within 'formulas', below. Select the investments that will maximize the Expected Total Cash Flow while keeping within the $1.5M budget.",
|
|
4
|
+
"modelType": "optimization",
|
|
5
|
+
"modelSettings": {
|
|
6
|
+
"simulationOptimization": true,
|
|
7
|
+
"numTrials": 100,
|
|
8
|
+
"randomSeed": 1
|
|
9
|
+
},
|
|
10
|
+
"engineSettings": {
|
|
11
|
+
"comment": "Set the engine to be used to solve the model here. Since this model solves with simulation optimization, the Evolutionary engine is selected.",
|
|
12
|
+
"engine": "Evolutionary"
|
|
13
|
+
},
|
|
14
|
+
"variables": {
|
|
15
|
+
"comment": "This example contains 8 decision variables. These variables are binary variables, or 0/1 variables, which represent the decision to accept or reject the project. Final values of the variables will be included in the result since the keyword finalValue is present.",
|
|
16
|
+
"x1:x8": {
|
|
17
|
+
"type": "binary",
|
|
18
|
+
"finalValue": []
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"uncertainVariables": {
|
|
22
|
+
"comment": "There are also 16 uncertain variables. This means that each uncertain variable will have 100 (numtrials) values. The first 8 uncertain variables, c1:c8, model the expected cash flow for each of the 8 projects using the PsiTriangular distribution. For more information on this distribution, see https://www.solver.com/risk-solver-help/psi-function-help/simulation/distributions/psiTriangular. The next 8 uncertain variables model the project's success using the binomial distribution. For more information on this distribution, see https://www.solver.com/risk-solver-help/psi-function-help/simulation/distributions/psiBinomial.",
|
|
23
|
+
"c1": {
|
|
24
|
+
"formula": "PsiTriangular(400000, 500000, 900000)"
|
|
25
|
+
},
|
|
26
|
+
"c2": {
|
|
27
|
+
"formula": "PsiTriangular(500000, 750000, 1250000)"
|
|
28
|
+
},
|
|
29
|
+
"c3": {
|
|
30
|
+
"formula": "PsiTriangular(500000, 1000000,1500000)"
|
|
31
|
+
},
|
|
32
|
+
"c4": {
|
|
33
|
+
"formula": "PsiTriangular(400000, 600000, 900000)"
|
|
34
|
+
},
|
|
35
|
+
"c5": {
|
|
36
|
+
"formula": "PsiTriangular(250000, 500000, 750000)"
|
|
37
|
+
},
|
|
38
|
+
"c6": {
|
|
39
|
+
"formula": "PsiTriangular(300000, 500000, 600000)"
|
|
40
|
+
},
|
|
41
|
+
"c7": {
|
|
42
|
+
"formula": "PsiTriangular(200000, 450000, 700000)"
|
|
43
|
+
},
|
|
44
|
+
"c8": {
|
|
45
|
+
"formula": "PsiTriangular(400000, 500000, 700000)"
|
|
46
|
+
},
|
|
47
|
+
"d1:d8": {
|
|
48
|
+
"comment": "Note that this set of uncertain variables are setup using the array, D1:D8.",
|
|
49
|
+
"formula": "PsiBinomial(1, 0.9)"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"formulas": {
|
|
53
|
+
"comment": "Use this optional section to setup constant arrays and calculate intermediary formulas that will be used in the constraints and objective.",
|
|
54
|
+
"f1:f8": {
|
|
55
|
+
"comment": "This array contains the initial investment for each project.",
|
|
56
|
+
"value": [ 325000, 450000, 550000, 300000, 150000, 250000, 150000, 325000 ]
|
|
57
|
+
},
|
|
58
|
+
"cash": {
|
|
59
|
+
"comment": "This array calculates the sumproduct of the expected cash flow for each project minus the initial investment, and the decision variables, to calculate the total net cash flow.",
|
|
60
|
+
"formula": "sumproduct(c1:c8 * d1:d8 - f1:f8, x1:x8)"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"constraints": {
|
|
64
|
+
"comment": "This model uses 1 constraint to ensure that the total investment does not exceed the budget of $1.5M.",
|
|
65
|
+
"invest": {
|
|
66
|
+
"formula": "sumproduct(f1:f8, x1:x8)",
|
|
67
|
+
"upper": 1500000
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"objective": {
|
|
71
|
+
"comment": "Maximizes the expected total cash flow. Notice that the objective is maximizing PsiMean(cash), reducing the uncertainty in the model from 100 values to 1. The objective could have also been set to maximize the Expected value of the objective as done in GasCompanyRecourse.",
|
|
72
|
+
"total": {
|
|
73
|
+
"type": "maximize",
|
|
74
|
+
"formula": "PsiMean(cash)",
|
|
75
|
+
"finalValue": []
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"modelName": "ProjectSelect2Example",
|
|
3
|
+
"modelDescription": "RASON Simulation Optimization Example with typical array names (i.e. no Excel range names): A company is considering eight different investment projects for the coming year. Each project's expected cash flow can be modeled as a PsiTriangular distribution with Minimum, Likely, and Maximum parameters. There is a 90% chance that each project chosen will be successful. The Initial Investment for each project can be found in the F block within 'formulas', below. Select the investments that will maximize the Expected Total Cash Flow while keeping within the $1.5M budget.",
|
|
4
|
+
"modelType": "optimization",
|
|
5
|
+
"modelSettings": {
|
|
6
|
+
"comment": "This example uses simulation optimization to solve the model. See 'Solving with Simulation Optimization' on the Help tab for more information. The option 'numTrials' sets the number of simulation trials to 100. Use 'randomSeed' to set a seed for the random number generator used in the Monte Carlo simulation process. Enter a positive integer value for this option; this value will then be used to 'seed' the random number generator each time you click Solve.",
|
|
7
|
+
"simulationOptimization": true,
|
|
8
|
+
"numTrials": 100,
|
|
9
|
+
"randomSeed": 1
|
|
10
|
+
},
|
|
11
|
+
"engineSettings": {
|
|
12
|
+
"comment": "Set the engine to be used to solve the model here. Since this model solves with simulation optimization, the Evolutionary engine is selected.",
|
|
13
|
+
"engine": "Evolutionary"
|
|
14
|
+
},
|
|
15
|
+
"variables": {
|
|
16
|
+
"x": {
|
|
17
|
+
"comment": "This example contains 8 decision variables. These variables are binary variables, or 0/1 variables, which represent the decision to accept or reject the project. Final values of the variables will be included in the result since the keyword finalValue is present. The 'dimensions' property explicitly specifies the number of dimensions as 8.",
|
|
18
|
+
"dimensions": [ 8 ],
|
|
19
|
+
"type": "binary",
|
|
20
|
+
"finalValue": []
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"uncertainVariables": {
|
|
24
|
+
"comment": "There are also 16 uncertain variables. This means that each uncertain variable will have 100 (numtrials) values. The first 8 uncertain variables, c1:c8, model the expected cash flow for each of the 8 projects using the PsiTriangular distribution. For more information on this distribution, see https://www.solver.com/risk-solver-help/psi-function-help/simulation/distributions/psiTriangular. The next 8 uncertain variables, d, model the project's success using the binomial distribution. For more information on this distribution, see https://www.solver.com/risk-solver-help/psi-function-help/simulation/distributions/psiBinomial.",
|
|
25
|
+
|
|
26
|
+
"c1": {
|
|
27
|
+
"formula": "PsiTriangular(400000, 500000, 900000)"
|
|
28
|
+
},
|
|
29
|
+
"c2": {
|
|
30
|
+
"formula": "PsiTriangular(500000, 750000, 1250000)"
|
|
31
|
+
},
|
|
32
|
+
"c3": {
|
|
33
|
+
"formula": "PsiTriangular(500000, 1000000,1500000)"
|
|
34
|
+
},
|
|
35
|
+
"c4": {
|
|
36
|
+
"formula": "PsiTriangular(400000, 600000, 900000)"
|
|
37
|
+
},
|
|
38
|
+
"c5": {
|
|
39
|
+
"formula": "PsiTriangular(250000, 500000, 750000)"
|
|
40
|
+
},
|
|
41
|
+
"c6": {
|
|
42
|
+
"formula": "PsiTriangular(300000, 500000, 600000)"
|
|
43
|
+
},
|
|
44
|
+
"c7": {
|
|
45
|
+
"formula": "PsiTriangular(200000, 450000, 700000)"
|
|
46
|
+
},
|
|
47
|
+
"c8": {
|
|
48
|
+
"formula": "PsiTriangular(400000, 500000, 700000)"
|
|
49
|
+
},
|
|
50
|
+
"d": {
|
|
51
|
+
"comment": "Note that this set of uncertain variables are setup using one array, the d array.",
|
|
52
|
+
"dimensions": [ 8 ],
|
|
53
|
+
"formula": "PsiBinomial(1, 0.9)"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"formulas": {
|
|
57
|
+
"comment": "Use this optional section to setup constant arrays and calculate intermediary formulas that will be used in the constraints and objective.",
|
|
58
|
+
"f": {
|
|
59
|
+
"comment": "This array contains the initial investment for each project.",
|
|
60
|
+
"value": [ 325000, 450000, 550000, 300000, 150000, 250000, 150000, 325000 ]
|
|
61
|
+
},
|
|
62
|
+
"cash": {
|
|
63
|
+
"comment": "This array calculates the sumproduct of the expected cash flow for each project minus the initial investment, and the decision variables, to calculate the total net cash flow.",
|
|
64
|
+
"formula": "sumproduct((c1:c8) * d - f, x)"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"constraints": {
|
|
68
|
+
"comment": "This model uses 1 constraint to ensure that the total investment does not exceed the budget of $1.5M.",
|
|
69
|
+
"invest": {
|
|
70
|
+
"formula": "sumproduct(f, x)",
|
|
71
|
+
"upper": 1500000
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"objective": {
|
|
75
|
+
"comment": "Maximizes the expected total cash flow. Notice that the objective is maximizing PsiMean(cash), reducing the uncertainty in the model from 100 values to 1. The objective could have also been set to maximize the Expected value of the objective as done in GasCompanyRecourse.",
|
|
76
|
+
"total": {
|
|
77
|
+
"type": "maximize",
|
|
78
|
+
"formula": "PsiMean(cash)",
|
|
79
|
+
"finalValue": []
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|