@frontlinesystems/rason-mcp-server 2026.5.1 → 2026.5.3
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 -35
- package/examples/EXAMPLES_REFERENCE.md +128 -128
- package/examples/{optimization → Optimization}/Conic/AirlineHubConic.json +111 -111
- package/examples/{optimization → Optimization}/Conic/AirlineHubConic2.json +108 -108
- package/examples/{optimization → Optimization}/Conic/AirlineHubConic3.json +111 -111
- package/examples/{optimization → Optimization}/Conic/AirlineHubConic4.json +99 -99
- package/examples/{optimization → Optimization}/Conic/AirlineHubConic5.json +101 -101
- package/examples/{optimization → Optimization}/DataBinding/ProductMixCsv.json +81 -81
- package/examples/{optimization → Optimization}/DataBinding/ProductMixCsv4.json +96 -96
- package/examples/{optimization → Optimization}/DataBinding/ProductMixExcel.json +73 -73
- package/examples/{optimization → Optimization}/DataBinding/ProductMixExcel1.json +86 -86
- package/examples/{optimization → Optimization}/DataBinding/ProductMixExcel11.json +108 -108
- package/examples/{optimization → Optimization}/DataBinding/ProductMixExcel2.json +77 -77
- package/examples/{optimization → Optimization}/DataBinding/ProductMixTab.json +89 -89
- package/examples/{optimization → Optimization}/DataBinding/ProductMixTab1.json +73 -73
- package/examples/{optimization → Optimization}/DataBinding/ProductMixTab2.json +77 -77
- package/examples/{optimization → Optimization}/Linear/Inventory.json +199 -199
- package/examples/{optimization → Optimization}/Linear/Matop.json +119 -119
- package/examples/{optimization → Optimization}/Linear/ProductMix.json +97 -97
- package/examples/{optimization → Optimization}/Linear/ProductMix2.json +72 -72
- package/examples/{optimization → Optimization}/Linear/ProductMix3.json +49 -49
- package/examples/{optimization → Optimization}/Linear/ProductMix4.json +56 -56
- package/examples/{optimization → Optimization}/Linear/ProductMixCsv1.json +106 -106
- package/examples/{optimization → Optimization}/Linear/ProductMixCsv2.json +106 -106
- package/examples/{optimization → Optimization}/Linear/ProductMixSQL11.json +82 -82
- package/examples/{optimization → Optimization}/Linear/Rowop.json +126 -126
- package/examples/{optimization → Optimization}/NonLinear/AirlineHub.json +63 -63
- package/examples/{optimization → Optimization}/NonLinear/AirlineHub2.json +47 -47
- package/examples/{optimization → Optimization}/NonLinear/AirlineHub3.json +47 -47
- package/examples/{optimization → Optimization}/NonSmooth/Inventory2.json +159 -159
- package/examples/{optimization → Optimization}/Quadratic/PortfolioOpt.json +55 -55
- package/examples/{optimization → Optimization}/Quadratic/PortfolioOpt2.json +65 -65
- package/examples/{optimization → Optimization}/WithUncertainty/GasCompanyChance.json +78 -78
- package/examples/{optimization → Optimization}/WithUncertainty/GasCompanyRecourse.json +78 -78
- package/examples/{optimization → Optimization}/WithUncertainty/ProjectSelect.json +77 -77
- package/examples/{optimization → Optimization}/WithUncertainty/ProjectSelect2.json +81 -81
- package/examples/{optimization → Optimization}/WithUncertainty/ProjectSelect3.json +84 -84
- package/examples/{optimization → Optimization}/WithUncertainty/ProjectSelect4.json +74 -74
- package/examples/{simulation → Simulation}/CandyStoreSalesUsingSIP.json +147 -147
- package/examples/{simulation → Simulation}/CollegeFundGrowth1.json +423 -423
- package/examples/{simulation → Simulation}/CollegeFundGrowth1SIPModel.json +27 -27
- package/examples/{simulation → Simulation}/CollegeFundGrowth2.json +415 -415
- package/examples/{simulation → Simulation}/CollegeFundGrowthSIP.json +401 -401
- package/examples/{simulation → Simulation}/GBMSimulationModel.json +236 -236
- package/examples/{simulation → Simulation}/YieldManagement(Sim).json +69 -69
- package/examples/{simulation → Simulation}/YieldManagement2(Sim).json +72 -72
- package/examples/calculation/DMNExamples/DMN Box Fun with typeDef result.json +53 -53
- package/examples/calculation/DMNExamples/DMN Context example.json +69 -69
- package/examples/calculation/DMNExamples/DMN DT with typeDef result.json +43 -43
- package/examples/calculation/DMNExamples/FEEL Date Time example.json +28 -28
- package/examples/calculation/DMNExamples/FEEL For iteration example.json +66 -66
- package/examples/calculation/DMNExamples/FEEL For with two indices.json +15 -15
- package/examples/calculation/DMNExamples/FEEL For with typeDef result.json +88 -88
- package/examples/calculation/DMNExamples/FEEL If Then Else example.json +25 -25
- package/examples/calculation/DMNExamples/FEEL List example.json +37 -37
- package/examples/calculation/DMNExamples/FEEL List operator.json +17 -17
- package/examples/calculation/DMNExamples/FEEL List with typeDef collection.json +36 -36
- package/examples/calculation/DMNExamples/FEEL Some or Every example.json +65 -65
- package/examples/calculation/DecisionTables/DT Datasource example.json +52 -52
- package/examples/calculation/DecisionTables/DT Date and Time examples.json +91 -91
- package/examples/calculation/DecisionTables/DT Expression example.json +32 -32
- package/examples/calculation/DecisionTables/DT Hit Policy examples.json +136 -136
- package/examples/calculation/DecisionTables/DT Loan Recommend model.json +81 -81
- package/examples/calculation/DecisionTables/DT Loan Strategy Model and Predictive CSV-XML.json +218 -218
- package/examples/calculation/DecisionTables/DT Loan Strategy model and Datasource.json +286 -286
- package/examples/calculation/DecisionTables/DT Loan Strategy model and Predictive.json +203 -203
- package/examples/calculation/DecisionTables/DT Loan Strategy model by scratch.json +214 -214
- package/examples/calculation/DecisionTables/DT Output Order example.json +39 -39
- package/examples/calculation/DecisionTables/DT Unique example.json +38 -38
- package/examples/calculation/TypeDefinitions/TypeDefCF.json +64 -64
- package/examples/calculation/TypeDefinitions/TypeDefDT.json +57 -57
- package/examples/datamining/AffinityAnalysis/AssociationRules.json +51 -51
- package/examples/datamining/Classification/DecisionTree.json +90 -90
- package/examples/datamining/Classification/DiscriminantAnalysis.json +81 -81
- package/examples/datamining/Classification/Ensembles/Bagging.json +66 -66
- package/examples/datamining/Classification/Ensembles/Boosting.json +67 -67
- package/examples/datamining/Classification/Ensembles/RandomTrees.json +91 -91
- package/examples/datamining/Classification/FindBestModel.json +86 -86
- package/examples/datamining/Classification/LogisticRegression.json +82 -82
- package/examples/datamining/Classification/NaiveBayes.json +78 -78
- package/examples/datamining/Classification/NearestNeighbors.json +84 -84
- package/examples/datamining/Classification/NeuralNetwork.json +92 -92
- package/examples/datamining/Clustering/Hierarchical.json +54 -54
- package/examples/datamining/Clustering/KMeans.json +71 -71
- package/examples/datamining/DataSources/DelimitedFile.json +49 -49
- package/examples/datamining/DataSources/JSONFile.json +49 -49
- package/examples/datamining/DataSources/MSAccessDatabase.json +49 -49
- package/examples/datamining/DataSources/MSExcelTable.json +50 -50
- package/examples/datamining/DataSources/MSSQLDatabase.json +49 -49
- package/examples/datamining/DataSources/ODATATable.json +49 -49
- package/examples/datamining/DataSources/ODBCDatabase.json +49 -49
- package/examples/datamining/FeatureSelection/LinearWrapping.json +53 -53
- package/examples/datamining/FeatureSelection/LogisticWrapping.json +56 -56
- package/examples/datamining/FeatureSelection/Univariate.json +78 -78
- package/examples/datamining/Regression/DecisionTree.json +82 -82
- package/examples/datamining/Regression/Ensembles/Bagging.json +62 -62
- package/examples/datamining/Regression/Ensembles/Boosting.json +62 -62
- package/examples/datamining/Regression/Ensembles/RandomTrees.json +78 -78
- package/examples/datamining/Regression/FindBestModel.json +86 -86
- package/examples/datamining/Regression/LinearRegression.json +124 -124
- package/examples/datamining/Regression/NearestNeighbors.json +77 -77
- package/examples/datamining/Regression/NeuralNetwork.json +82 -82
- package/examples/datamining/Scoring/JSONClassifier.json +62 -62
- package/examples/datamining/Scoring/JSONClassifierNN.json +62 -62
- package/examples/datamining/Scoring/JSONClusterizer.json +37 -37
- package/examples/datamining/Scoring/JSONForecaster.json +49 -49
- package/examples/datamining/Scoring/JSONLinearRegression.json +56 -56
- package/examples/datamining/Scoring/JSONPCA.json +41 -41
- package/examples/datamining/Scoring/JSONRegressor.json +56 -56
- package/examples/datamining/Scoring/JSONTransformer.json +38 -38
- package/examples/datamining/Scoring/PMMLClassifier.json +42 -42
- package/examples/datamining/Scoring/PMMLForecaster.json +43 -43
- package/examples/datamining/Scoring/PMMLRegressor.json +38 -38
- package/examples/datamining/Scoring/PMMLTransformer.json +38 -38
- package/examples/datamining/Simulation/LinearRegressionSimulation.json +117 -117
- package/examples/datamining/Simulation/SyntheticDataGeneration.json +108 -108
- package/examples/datamining/Simulation/pmml-risk-scoring.json +62 -62
- package/examples/datamining/Summarizer/Summarization.json +54 -54
- package/examples/datamining/TextMining/LatentSemanticAnalysis.json +51 -51
- package/examples/datamining/TextMining/TfIdf-FileData.json +65 -65
- package/examples/datamining/TextMining/TfIdf-InlineData.json +55 -55
- package/examples/datamining/TimeSeries/AddHoltWinters.json +79 -79
- package/examples/datamining/TimeSeries/Arima.json +74 -74
- package/examples/datamining/TimeSeries/DoubleExponential.json +65 -65
- package/examples/datamining/TimeSeries/Exponential.json +64 -64
- package/examples/datamining/TimeSeries/LagAnalysis.json +48 -48
- package/examples/datamining/TimeSeries/MovingAverage.json +65 -65
- package/examples/datamining/TimeSeries/MulHoltWinters.json +65 -65
- package/examples/datamining/TimeSeries/NoTrendHoltWinters.json +65 -65
- package/examples/datamining/Transformation/Binning.json +69 -69
- package/examples/datamining/Transformation/CanonicalVariateAnalysis.json +47 -47
- package/examples/datamining/Transformation/CategoryReduction.json +51 -51
- package/examples/datamining/Transformation/Factorization.json +50 -50
- package/examples/datamining/Transformation/MissingDataHandling.json +83 -83
- package/examples/datamining/Transformation/OneHotEncoding-DataInline.json +54 -54
- package/examples/datamining/Transformation/OneHotEncoding-DatainFile.json +48 -48
- package/examples/datamining/Transformation/PartitionTimeSeries.json +48 -48
- package/examples/datamining/Transformation/Partitioning-DF.json +72 -72
- package/examples/datamining/Transformation/Partitioning.json +46 -46
- package/examples/datamining/Transformation/PartitioningWithOversampling-DF.json +65 -65
- package/examples/datamining/Transformation/PartitioningWithOversampling.json +44 -44
- package/examples/datamining/Transformation/PrincipalComponentsAnalysis.json +52 -52
- package/examples/datamining/Transformation/Rescaling.json +67 -67
- package/examples/datamining/Transformation/Sampling.json +43 -43
- package/examples/datamining/Transformation/StratifiedSampling.json +46 -46
- package/examples/flow/SQLServerTransform.json +260 -260
- package/examples/flow/dm-calc-pipeline.json +277 -277
- package/examples/flow/dm-pipeline-simulation.json +113 -113
- package/examples/flow/opt-sim-pipeline.json +159 -159
- package/examples/flow/sim-dm-pipeline.json +106 -106
- package/examples/flow/sim-sim-pipeline.json +136 -136
- package/examples/index.json +4678 -4678
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/DataFiltering/ListwithFilter.json +52 -52
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/Loops/ProductMix5.json +57 -57
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/Loops/compoundWhileStatement.json +35 -35
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/Loops/ifThenElseStatement.json +33 -33
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/Loops/nestedLoop.json +25 -25
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/ParallelArray.json +47 -47
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/indexedArray.json +69 -69
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/nonParallelArray.json +49 -49
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/sumAggregateExample.json +337 -337
- package/examples/rason-features/Arrays_Loops_Tables/ArrayExamples/tsp.json +61 -61
- package/examples/rason-features/BoxIterators/Box_Fun_Loop_Iter_Sim_RASON.json +190 -190
- package/examples/rason-features/BoxIterators/Box_Fun_Loop_Sim_RASON.json +75 -75
- package/examples/rason-features/BoxIterators/Box_Fun_Sim_RASON.json +108 -108
- package/examples/rason-features/BoxIterators/Box_Iter_SIM_RASON.json +68 -68
- package/examples/rason-features/BoxIterators/Box_Iterator_Calc_Loop.json +183 -183
- package/examples/rason-features/BoxIterators/Box_Iterator_with_typeDef_partial.json +79 -79
- package/examples/rason-features/BoxLambdaExamples/BoxFunOptimize.json +154 -154
- package/examples/rason-features/BoxLambdaExamples/BoxFunSimulate.json +118 -118
- package/examples/rason-features/BoxLambdaExamples/LambdaFunOptimize.json +142 -142
- package/examples/rason-features/BoxLambdaExamples/LambdaFunSimulate.json +81 -81
- package/examples/rason-features/ReferenceGuide/RGFirehouseLocation.json +69 -69
- package/examples/rason-features/ReferenceGuide/RGFirehouseLocationConic.json +113 -113
- package/examples/rason-features/ReferenceGuide/RGProductMixCsv1.json +107 -107
- package/examples/rason-features/ReferenceGuide/RGProductMixExcel11.json +117 -117
- package/examples/rason-features/ReferenceGuide/RGProductMixSQL11.json +108 -108
- package/examples/rason-features/UserGuide/UGAirlineHubCSV.json +67 -67
- package/examples/rason-features/UserGuide/UGForecast.json +50 -50
- package/examples/rason-features/UserGuide/UGProductMix1.json +48 -48
- package/examples/rason-features/UserGuide/UGProductMix2.json +48 -48
- package/examples/rason-features/UserGuide/UGProductMixTab1.json +67 -67
- package/examples/rason-features/UserGuide/UGProductMixTab2.json +76 -76
- package/examples/rason-features/UserGuide/UGProductMixTab3.json +66 -66
- package/examples/rason-features/UserGuide/UGProductMixTab4.json +70 -70
- package/examples/rason-features/UserGuide/UGProductMixTab5.json +67 -67
- package/examples/rason-features/UserGuide/UGProjectSelect0.json +91 -91
- package/examples/rason-features/UserGuide/UGProjectSelect1.json +74 -74
- package/examples/rason-features/UserGuide/UGProjectSelect2.json +74 -74
- package/examples/rason-features/UserGuide/UGYieldManagement1.json +61 -61
- package/examples/rason-features/UserGuide/UGYieldManagement2.json +61 -61
- package/examples/rason-features/UserGuide/UGYieldManagement3.json +63 -63
- package/out/index.cjs +1 -1
- package/package.json +3 -2
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
{
|
|
2
|
-
"modelName": "RGProductMixExcel11",
|
|
3
|
-
"modelDescription": "RASON Conic Optimization Example: Example illustrates how to bind to an Excel sheet: In this example, data is imported from an Excel file. To perform the same steps when importing/exporting to an Excel file, you need to specify the cell address containing the dimensions to be imported and/or the cells to which the results should be exported. In this example, the vars_data data source is again importing initial decision variable values and then exporting the final decision variable values to the same Excel workbook. See Data Sources within the RASON Reference Guide for more information. (Click Help tab to download.) ",
|
|
4
|
-
"modelType": "optimization",
|
|
5
|
-
"datasources": {
|
|
6
|
-
"comment": "Imports data from outside datasources.",
|
|
7
|
-
"parts_data": {
|
|
8
|
-
"comment": "Imports the parts data.",
|
|
9
|
-
"type": "excel",
|
|
10
|
-
"connection": "ProductMixExcel.xlsx",
|
|
11
|
-
"selection": "Sheet1!G2:I12",
|
|
12
|
-
"indexCols": [ "parts", "prods" ],
|
|
13
|
-
"valueCols": [ "qty" ],
|
|
14
|
-
"direction": "import"
|
|
15
|
-
},
|
|
16
|
-
"invent_data": {
|
|
17
|
-
"comment": "Imports the inventory data.",
|
|
18
|
-
"type": "excel",
|
|
19
|
-
"connection": "ProductMixExcel.xlsx",
|
|
20
|
-
"selection": "Sheet1!N2:O6",
|
|
21
|
-
"indexCols": [ "parts" ],
|
|
22
|
-
"valueCols": [ "inventory" ],
|
|
23
|
-
"direction": "import"
|
|
24
|
-
},
|
|
25
|
-
"profit_data": {
|
|
26
|
-
"comment": "Imports the profit per unit data.",
|
|
27
|
-
"type": "excel",
|
|
28
|
-
"connection": "ProductMixExcel.xlsx",
|
|
29
|
-
"selection": "Sheet1!K2:L4",
|
|
30
|
-
"indexCols": [ "prods" ],
|
|
31
|
-
"valueCols": [ "profits" ],
|
|
32
|
-
"direction": "import"
|
|
33
|
-
},
|
|
34
|
-
"vars_data": {
|
|
35
|
-
"comment": "The vars_data data source performs a dual function by first importing the decision variable initial values from the Excel file ProductMixExcel.xlsx and then saving the final variable values back to that same file. The first property, type, specifies the type of file where the data is being imported/exported ('Excel'), the second property, connection, specifies the file name within quotes ('ResultVarsInit.txt') and the third property, selection, specifies where the final variable values will be appended ('Sheet1!Q2:R4'). We could pass a defined name here rather than a cell address. The fourth and fifth properties (indexCols and valueCols) are required for importing the initial variable values. The property, indexCols specifies the dimension(s) (or column(s)) to be imported and the property, valueCols, specifies the value column to be imported. Within variables, the x array definition uses the valueCol property to pass the initial variable values and the binding property to 'bind' to the vars_data data source. Since only one output property (finalValue:[]) is present within the x array definition, only the final variable values will be appended to the original cell address, Q2:R4. The last property, 'direction', indicates that the file will be both imported and exported hence the setting 'import/export'. Note: If the 'initials' column heading in Excel is replaced with 'finalValue'. RASON will both read the initial variable values from cells R2:R4 and overwrite these values with the final variable values after the model is solved.",
|
|
36
|
-
"type": "excel",
|
|
37
|
-
"connection": "ProductMixExcel.xlsx",
|
|
38
|
-
"selection": "Sheet1!Q2:R4",
|
|
39
|
-
"indexCols": [ "prods" ],
|
|
40
|
-
"valueCols": [ "initials" ],
|
|
41
|
-
"direction": "import/export"
|
|
42
|
-
},
|
|
43
|
-
"fcns_data": {
|
|
44
|
-
"comment": "The fcns_data datasource exports the final constraint values to the Excel file, ProductMixExcel.xlsx. The first property, type: 'Excel', specifies the type of file where the data is being imported/exported, in this instance an Excel file. The second property, connection, specifies the file name within quotes ('ProductMixExce.xlsx'). The 3rd property, selection: 'Sheet1!U2:U6', gives the location, within the ProductMixExcel.xlsx workbook, where the final constraint values will be saved. Alternatively, we could pass a defined name here. The 4th property, indexCols, indexes the data by the 'prods' column (or dimension). The binding property within the c constraint definition binds the constraint block c to the fcns_data datasource. One output property (finalValue:[]) is included in the c definition. The RASON interpreter will append the final constraint values to the original selection. The last property, 'direction', indicates that the file will be exported. (The default setting for the direction property is 'import'.) For a complete list of results that may be written to a writeable data source, see the constraints section discussion within the RASON Reference Guide.",
|
|
45
|
-
"type": "excel",
|
|
46
|
-
"connection": "ProductMixExcel.xlsx",
|
|
47
|
-
"selection": "Sheet1!U2:U6",
|
|
48
|
-
"indexCols": [ "parts" ],
|
|
49
|
-
"direction": "export"
|
|
50
|
-
},
|
|
51
|
-
"obj_data": {
|
|
52
|
-
"comment": "The obj_data datasource exports the final objective value to ProductMixExcel.xlsx. The first property, type, specifies the file type ('Excel'), the second property, connection, specifies the file name ('ResultObj.txt') and the third property, selection, specifies where the final objective value will be written ('Sheet1!X1'). The binding property within the total objective definition the objective definition to the obj_data data source. Since only the finalValue result property is present within the objective definition, only the final value of the objective function (a single value) will be saved to ProductMixExcel!X2. The last property, 'direction', indicates that the file will be exported. For a complete list of results that may be written to a writeable data source, see the objective section discussion within the RASON Reference Guide.",
|
|
53
|
-
"type": "excel",
|
|
54
|
-
"connection": "ProductMixExcel.xlsx",
|
|
55
|
-
"selection": "Sheet1!X2",
|
|
56
|
-
"direction": "export"
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
"data": {
|
|
60
|
-
"comment": "Binds the datasources to data component.",
|
|
61
|
-
"parts2": {
|
|
62
|
-
"comment": "Binds the values in the qty column in the parts_data datasource to parts2 data component.",
|
|
63
|
-
"binding": "parts_data",
|
|
64
|
-
"valueCol": "qty"
|
|
65
|
-
},
|
|
66
|
-
"invent": {
|
|
67
|
-
"comment": "Binds the values in the inventory column in the invent_data datasource to invent data component.",
|
|
68
|
-
"binding": "invent_data",
|
|
69
|
-
"valueCol": "inventory"
|
|
70
|
-
},
|
|
71
|
-
"profit": {
|
|
72
|
-
"comment": "Binds the values in the profits column in the profit_data datasource to profit data component.",
|
|
73
|
-
"binding": "profit_data",
|
|
74
|
-
"valueCol": "profits"
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
"formulas": {
|
|
78
|
-
"comment": "Use this section to calculate intermediate formulas to be used within the constraints and objective sections.",
|
|
79
|
-
"piv_parts": {
|
|
80
|
-
"comment": "Calculates the amount of parts used to produce all three products.",
|
|
81
|
-
"formula": "PIVOT(parts2, { 'prods' }, { 'parts' })"
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
"variables": {
|
|
85
|
-
"comment": "Decision Variables",
|
|
86
|
-
"x": {
|
|
87
|
-
"comment": "The amount of products to produce, x[1] = TVs, x[2] = Stereos, x[3] = Speakers",
|
|
88
|
-
"dimensions": [ "prods" ],
|
|
89
|
-
"binding": "vars_data",
|
|
90
|
-
"valueCol": "initials",
|
|
91
|
-
"lower": 0,
|
|
92
|
-
"finalValue": [],
|
|
93
|
-
"indexValue": []
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
"constraints": {
|
|
97
|
-
"comment": "Constraints",
|
|
98
|
-
"c": {
|
|
99
|
-
"comment": "Generates 5 constraints that calculate the number of parts used in creating the three products, then sets each constraint equal to the amount of each part in inventory.",
|
|
100
|
-
"dimensions": [ "parts" ],
|
|
101
|
-
"binding": "fcns_data",
|
|
102
|
-
"formula": "MMULT(piv_parts, x) - invent",
|
|
103
|
-
"upper": 0,
|
|
104
|
-
"finalValue": []
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"objective": {
|
|
108
|
-
"comment": "objective function",
|
|
109
|
-
"total": {
|
|
110
|
-
"comment": "Calculates the profit by multiplying the profit per unit of each product by the final variable values.",
|
|
111
|
-
"binding": "obj_data",
|
|
112
|
-
"formula": "sumproduct(x, profit)",
|
|
113
|
-
"type": "maximize",
|
|
114
|
-
"finalValue": []
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"modelName": "RGProductMixExcel11",
|
|
3
|
+
"modelDescription": "RASON Conic Optimization Example: Example illustrates how to bind to an Excel sheet: In this example, data is imported from an Excel file. To perform the same steps when importing/exporting to an Excel file, you need to specify the cell address containing the dimensions to be imported and/or the cells to which the results should be exported. In this example, the vars_data data source is again importing initial decision variable values and then exporting the final decision variable values to the same Excel workbook. See Data Sources within the RASON Reference Guide for more information. (Click Help tab to download.) ",
|
|
4
|
+
"modelType": "optimization",
|
|
5
|
+
"datasources": {
|
|
6
|
+
"comment": "Imports data from outside datasources.",
|
|
7
|
+
"parts_data": {
|
|
8
|
+
"comment": "Imports the parts data.",
|
|
9
|
+
"type": "excel",
|
|
10
|
+
"connection": "ProductMixExcel.xlsx",
|
|
11
|
+
"selection": "Sheet1!G2:I12",
|
|
12
|
+
"indexCols": [ "parts", "prods" ],
|
|
13
|
+
"valueCols": [ "qty" ],
|
|
14
|
+
"direction": "import"
|
|
15
|
+
},
|
|
16
|
+
"invent_data": {
|
|
17
|
+
"comment": "Imports the inventory data.",
|
|
18
|
+
"type": "excel",
|
|
19
|
+
"connection": "ProductMixExcel.xlsx",
|
|
20
|
+
"selection": "Sheet1!N2:O6",
|
|
21
|
+
"indexCols": [ "parts" ],
|
|
22
|
+
"valueCols": [ "inventory" ],
|
|
23
|
+
"direction": "import"
|
|
24
|
+
},
|
|
25
|
+
"profit_data": {
|
|
26
|
+
"comment": "Imports the profit per unit data.",
|
|
27
|
+
"type": "excel",
|
|
28
|
+
"connection": "ProductMixExcel.xlsx",
|
|
29
|
+
"selection": "Sheet1!K2:L4",
|
|
30
|
+
"indexCols": [ "prods" ],
|
|
31
|
+
"valueCols": [ "profits" ],
|
|
32
|
+
"direction": "import"
|
|
33
|
+
},
|
|
34
|
+
"vars_data": {
|
|
35
|
+
"comment": "The vars_data data source performs a dual function by first importing the decision variable initial values from the Excel file ProductMixExcel.xlsx and then saving the final variable values back to that same file. The first property, type, specifies the type of file where the data is being imported/exported ('Excel'), the second property, connection, specifies the file name within quotes ('ResultVarsInit.txt') and the third property, selection, specifies where the final variable values will be appended ('Sheet1!Q2:R4'). We could pass a defined name here rather than a cell address. The fourth and fifth properties (indexCols and valueCols) are required for importing the initial variable values. The property, indexCols specifies the dimension(s) (or column(s)) to be imported and the property, valueCols, specifies the value column to be imported. Within variables, the x array definition uses the valueCol property to pass the initial variable values and the binding property to 'bind' to the vars_data data source. Since only one output property (finalValue:[]) is present within the x array definition, only the final variable values will be appended to the original cell address, Q2:R4. The last property, 'direction', indicates that the file will be both imported and exported hence the setting 'import/export'. Note: If the 'initials' column heading in Excel is replaced with 'finalValue'. RASON will both read the initial variable values from cells R2:R4 and overwrite these values with the final variable values after the model is solved.",
|
|
36
|
+
"type": "excel",
|
|
37
|
+
"connection": "ProductMixExcel.xlsx",
|
|
38
|
+
"selection": "Sheet1!Q2:R4",
|
|
39
|
+
"indexCols": [ "prods" ],
|
|
40
|
+
"valueCols": [ "initials" ],
|
|
41
|
+
"direction": "import/export"
|
|
42
|
+
},
|
|
43
|
+
"fcns_data": {
|
|
44
|
+
"comment": "The fcns_data datasource exports the final constraint values to the Excel file, ProductMixExcel.xlsx. The first property, type: 'Excel', specifies the type of file where the data is being imported/exported, in this instance an Excel file. The second property, connection, specifies the file name within quotes ('ProductMixExce.xlsx'). The 3rd property, selection: 'Sheet1!U2:U6', gives the location, within the ProductMixExcel.xlsx workbook, where the final constraint values will be saved. Alternatively, we could pass a defined name here. The 4th property, indexCols, indexes the data by the 'prods' column (or dimension). The binding property within the c constraint definition binds the constraint block c to the fcns_data datasource. One output property (finalValue:[]) is included in the c definition. The RASON interpreter will append the final constraint values to the original selection. The last property, 'direction', indicates that the file will be exported. (The default setting for the direction property is 'import'.) For a complete list of results that may be written to a writeable data source, see the constraints section discussion within the RASON Reference Guide.",
|
|
45
|
+
"type": "excel",
|
|
46
|
+
"connection": "ProductMixExcel.xlsx",
|
|
47
|
+
"selection": "Sheet1!U2:U6",
|
|
48
|
+
"indexCols": [ "parts" ],
|
|
49
|
+
"direction": "export"
|
|
50
|
+
},
|
|
51
|
+
"obj_data": {
|
|
52
|
+
"comment": "The obj_data datasource exports the final objective value to ProductMixExcel.xlsx. The first property, type, specifies the file type ('Excel'), the second property, connection, specifies the file name ('ResultObj.txt') and the third property, selection, specifies where the final objective value will be written ('Sheet1!X1'). The binding property within the total objective definition the objective definition to the obj_data data source. Since only the finalValue result property is present within the objective definition, only the final value of the objective function (a single value) will be saved to ProductMixExcel!X2. The last property, 'direction', indicates that the file will be exported. For a complete list of results that may be written to a writeable data source, see the objective section discussion within the RASON Reference Guide.",
|
|
53
|
+
"type": "excel",
|
|
54
|
+
"connection": "ProductMixExcel.xlsx",
|
|
55
|
+
"selection": "Sheet1!X2",
|
|
56
|
+
"direction": "export"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"data": {
|
|
60
|
+
"comment": "Binds the datasources to data component.",
|
|
61
|
+
"parts2": {
|
|
62
|
+
"comment": "Binds the values in the qty column in the parts_data datasource to parts2 data component.",
|
|
63
|
+
"binding": "parts_data",
|
|
64
|
+
"valueCol": "qty"
|
|
65
|
+
},
|
|
66
|
+
"invent": {
|
|
67
|
+
"comment": "Binds the values in the inventory column in the invent_data datasource to invent data component.",
|
|
68
|
+
"binding": "invent_data",
|
|
69
|
+
"valueCol": "inventory"
|
|
70
|
+
},
|
|
71
|
+
"profit": {
|
|
72
|
+
"comment": "Binds the values in the profits column in the profit_data datasource to profit data component.",
|
|
73
|
+
"binding": "profit_data",
|
|
74
|
+
"valueCol": "profits"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"formulas": {
|
|
78
|
+
"comment": "Use this section to calculate intermediate formulas to be used within the constraints and objective sections.",
|
|
79
|
+
"piv_parts": {
|
|
80
|
+
"comment": "Calculates the amount of parts used to produce all three products.",
|
|
81
|
+
"formula": "PIVOT(parts2, { 'prods' }, { 'parts' })"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"variables": {
|
|
85
|
+
"comment": "Decision Variables",
|
|
86
|
+
"x": {
|
|
87
|
+
"comment": "The amount of products to produce, x[1] = TVs, x[2] = Stereos, x[3] = Speakers",
|
|
88
|
+
"dimensions": [ "prods" ],
|
|
89
|
+
"binding": "vars_data",
|
|
90
|
+
"valueCol": "initials",
|
|
91
|
+
"lower": 0,
|
|
92
|
+
"finalValue": [],
|
|
93
|
+
"indexValue": []
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"constraints": {
|
|
97
|
+
"comment": "Constraints",
|
|
98
|
+
"c": {
|
|
99
|
+
"comment": "Generates 5 constraints that calculate the number of parts used in creating the three products, then sets each constraint equal to the amount of each part in inventory.",
|
|
100
|
+
"dimensions": [ "parts" ],
|
|
101
|
+
"binding": "fcns_data",
|
|
102
|
+
"formula": "MMULT(piv_parts, x) - invent",
|
|
103
|
+
"upper": 0,
|
|
104
|
+
"finalValue": []
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"objective": {
|
|
108
|
+
"comment": "objective function",
|
|
109
|
+
"total": {
|
|
110
|
+
"comment": "Calculates the profit by multiplying the profit per unit of each product by the final variable values.",
|
|
111
|
+
"binding": "obj_data",
|
|
112
|
+
"formula": "sumproduct(x, profit)",
|
|
113
|
+
"type": "maximize",
|
|
114
|
+
"finalValue": []
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
{
|
|
2
|
-
"modelName": "RGProductMixSQL11",
|
|
3
|
-
"modelDescription": "RASON Conic Optimization Example that uses SQL table binding: This example illustrates how to import and export data from an odbc database, specifically a Microsoft Access database. See the Named Data Connections within the RASON User Guide for more information on how to create a named data connection where you can maintain your data access credentials in a secure Azure 'vault' rather than passing them in the connection property.",
|
|
4
|
-
"modelType": "optimization",
|
|
5
|
-
"datasources": {
|
|
6
|
-
"comment": "Imports data from outside datasources. ValueCols must follow indexCols in selections",
|
|
7
|
-
"parts_data": {
|
|
8
|
-
"comment": "Imports the parts data.",
|
|
9
|
-
"type": "odbc",
|
|
10
|
-
"connection": "Driver={SQL Server};Server=tcp:solver.database.windows.net,1433;Database=Rason;Uid=rasonread;Pwd=Rason1234;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;",
|
|
11
|
-
"selection": "SELECT Parts as parts, Products as prods, Qty as qty FROM Parts ORDER BY ID",
|
|
12
|
-
"indexCols": [ "parts", "prods" ],
|
|
13
|
-
"valueCols": [ "qty" ],
|
|
14
|
-
"direction": "import"
|
|
15
|
-
},
|
|
16
|
-
"invent_data": {
|
|
17
|
-
"comment": "Imports the inventory data.",
|
|
18
|
-
"type": "odbc",
|
|
19
|
-
"connection": "Driver={SQL Server};Server=tcp:solver.database.windows.net,1433;Database=Rason;Uid=rasonread;Pwd=Rason1234;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;",
|
|
20
|
-
"selection": "SELECT Parts as parts, Inventory as inventory FROM Inventory ORDER BY ID",
|
|
21
|
-
"indexCols": [ "parts" ],
|
|
22
|
-
"valueCols": [ "inventory" ],
|
|
23
|
-
"direction": "import"
|
|
24
|
-
},
|
|
25
|
-
"profit_data": {
|
|
26
|
-
"comment": "Imports the profit per unit data.",
|
|
27
|
-
"type": "odbc",
|
|
28
|
-
"connection": "Driver={SQL Server};Server=tcp:solver.database.windows.net,1433;Database=Rason;Uid=rasonread;Pwd=Rason1234;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;",
|
|
29
|
-
"selection": "SELECT Products as prods, Profit as profit FROM Profits ORDER BY ID",
|
|
30
|
-
"indexCols": [ "prods" ],
|
|
31
|
-
"valueCols": [ "profit" ],
|
|
32
|
-
"direction": "import"
|
|
33
|
-
},
|
|
34
|
-
"vars_data": {
|
|
35
|
-
"comment": "The vars_data data source performs a dual function by first importing the decision variable initial values from the Access database and then saving the final variable values back to that same file. The first property, type, specifies the type of file where the data is being imported/exported ('msaccess'), the second property, connection, specifies the file name within quotes ('ProductMixAccess.accdb') and the third property, selection, imports two fields from the Profits table in order by ID ('SELECT Products, Initials FROM Profits ORDER BY ID). The 4th property, indexCols, indexes the data by the prods dimension while the 5th property, valueCols, imports the actual numerical data. The direction property ensures that the initial variable values are imported and the final variable values are exported using direction: 'import/export'. Within variables, the x array definition uses the valueCol property to pass the initial variable values and the binding property to bind to the vars_data data source. The final variable values (requested using the output property finalValues:[] within the x array definition) will be appended to the Profits table.",
|
|
36
|
-
"type": "odbc",
|
|
37
|
-
"connection": "Driver={SQL Server};Server=tcp:solver.database.windows.net,1433;Database=Rason;Uid=rasonread;Pwd=Rason1234;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;",
|
|
38
|
-
"selection": "SELECT Products as prods, Initials as initials FROM Profits ORDER BY ID",
|
|
39
|
-
"indexCols": [ "prods" ],
|
|
40
|
-
"valueCols": [ "initials" ],
|
|
41
|
-
"direction": "import/export"
|
|
42
|
-
},
|
|
43
|
-
"fcns_data": {
|
|
44
|
-
"comment": "The fcns_data datasource, exports the final constraint values to the Access data base file, ProductMixAccess.accdb. The first property, type: 'msaccess', specifies the type of file where the data is being imported/exported. Alternatively, 'access' or 'odbc' could have been passed instead of 'msaccess'. The second property, connection, specifies the file name within quotes ('ProductMixAcess.accdb'). The 3rd property, selection: 'ResultFcns', creates a table within the Access database, where the final constraint values will be saved. The direction property ensures that the file is 'exported'. Within the c constraint definition, the constraint block is bound to the fcns_data data source by the binding property. The output property, finalValue:[], will export the final constraint values to the ResultsFcns table within the file, ProductMixAccess.accdb.",
|
|
45
|
-
"type": "odbc",
|
|
46
|
-
"connection": "Driver={SQL Server};Server=tcp:solver.database.windows.net,1433;Database=Rason;Uid=rasonread;Pwd=Rason1234;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;",
|
|
47
|
-
"selection": "ResultFcns",
|
|
48
|
-
"direction": "export"
|
|
49
|
-
},
|
|
50
|
-
"obj_data": {
|
|
51
|
-
"comment": "The obj_data datasource exports the final objective value to ProductMixAccess.accdb. Again the first property, type, specifies the file type ('msaccess'), the second property, connection, specifies the file name ('ProductMixAccess.accdb') and the third property, selection, specifies the table where the final objective value will be written ('ResultObj'). The direction property ensures that the file is 'exported'. The binding property within the total objective definition 'binds' the objective to the obj_data source. The output property, finalValue:[], exports the final objective function value to the ResultObj table within the file ProductMixAccess.accdb.",
|
|
52
|
-
"type": "odbc",
|
|
53
|
-
"connection": "Driver={SQL Server};Server=tcp:solver.database.windows.net,1433;Database=Rason;Uid=rasonread;Pwd=Rason1234;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;",
|
|
54
|
-
"selection": "ResultObj",
|
|
55
|
-
"direction": "export"
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
"data": {
|
|
59
|
-
"comment": "Binds the datasources to data component.",
|
|
60
|
-
"profit": {
|
|
61
|
-
"comment": "Binds the values in the profits column in the profit_data datasource to profit data component. If valueCol property is missing, RASON assumes the value column is the last column in the table.",
|
|
62
|
-
"binding": "profit_data"
|
|
63
|
-
},
|
|
64
|
-
"invent": {
|
|
65
|
-
"comment": "Binds the values in the inventory column in the invent_data datasource to invent data component.",
|
|
66
|
-
"binding": "invent_data"
|
|
67
|
-
},
|
|
68
|
-
"parts2": {
|
|
69
|
-
"comment": "Binds the values in the qty column in the parts_data datasource to parts2 data component.",
|
|
70
|
-
"binding": "parts_data"
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
"formulas": {
|
|
74
|
-
"comment": "Use this section to calculate intermediate formulas to be used within the constraints and objective sections.",
|
|
75
|
-
"piv_parts": {
|
|
76
|
-
"formula": "PIVOT(parts2, { 'prods' }, { 'parts' })"
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
"variables": {
|
|
80
|
-
"comment": "Decision Variables",
|
|
81
|
-
"x": {
|
|
82
|
-
"comment": "The amount of products to produce, x[1] = TVs, x[2] = Stereos, x[3] = Speakers",
|
|
83
|
-
"dimensions": [ "prods" ],
|
|
84
|
-
"valuecol": "initials",
|
|
85
|
-
"lower": 0,
|
|
86
|
-
"finalValue": []
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
"constraints": {
|
|
90
|
-
"comment": "Constraints",
|
|
91
|
-
"c": {
|
|
92
|
-
"comment": "Generates 5 constraints that calculate the number of parts used in creating the three products, then sets each constraint equal to the amount of each part in inventory.",
|
|
93
|
-
"dimensions": [ "parts" ],
|
|
94
|
-
"formula": "MMULT(piv_parts, x)",
|
|
95
|
-
"upper": "invent",
|
|
96
|
-
"finalValue": []
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
"objective": {
|
|
100
|
-
"comment": "objective function",
|
|
101
|
-
"total": {
|
|
102
|
-
"comment": "Calculates the profit by multiplying the profit per unit of each product by the final variable values.",
|
|
103
|
-
"formula": "sumproduct(x, profit)",
|
|
104
|
-
"type": "maximize",
|
|
105
|
-
"finalValue": []
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"modelName": "RGProductMixSQL11",
|
|
3
|
+
"modelDescription": "RASON Conic Optimization Example that uses SQL table binding: This example illustrates how to import and export data from an odbc database, specifically a Microsoft Access database. See the Named Data Connections within the RASON User Guide for more information on how to create a named data connection where you can maintain your data access credentials in a secure Azure 'vault' rather than passing them in the connection property.",
|
|
4
|
+
"modelType": "optimization",
|
|
5
|
+
"datasources": {
|
|
6
|
+
"comment": "Imports data from outside datasources. ValueCols must follow indexCols in selections",
|
|
7
|
+
"parts_data": {
|
|
8
|
+
"comment": "Imports the parts data.",
|
|
9
|
+
"type": "odbc",
|
|
10
|
+
"connection": "Driver={SQL Server};Server=tcp:solver.database.windows.net,1433;Database=Rason;Uid=rasonread;Pwd=Rason1234;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;",
|
|
11
|
+
"selection": "SELECT Parts as parts, Products as prods, Qty as qty FROM Parts ORDER BY ID",
|
|
12
|
+
"indexCols": [ "parts", "prods" ],
|
|
13
|
+
"valueCols": [ "qty" ],
|
|
14
|
+
"direction": "import"
|
|
15
|
+
},
|
|
16
|
+
"invent_data": {
|
|
17
|
+
"comment": "Imports the inventory data.",
|
|
18
|
+
"type": "odbc",
|
|
19
|
+
"connection": "Driver={SQL Server};Server=tcp:solver.database.windows.net,1433;Database=Rason;Uid=rasonread;Pwd=Rason1234;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;",
|
|
20
|
+
"selection": "SELECT Parts as parts, Inventory as inventory FROM Inventory ORDER BY ID",
|
|
21
|
+
"indexCols": [ "parts" ],
|
|
22
|
+
"valueCols": [ "inventory" ],
|
|
23
|
+
"direction": "import"
|
|
24
|
+
},
|
|
25
|
+
"profit_data": {
|
|
26
|
+
"comment": "Imports the profit per unit data.",
|
|
27
|
+
"type": "odbc",
|
|
28
|
+
"connection": "Driver={SQL Server};Server=tcp:solver.database.windows.net,1433;Database=Rason;Uid=rasonread;Pwd=Rason1234;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;",
|
|
29
|
+
"selection": "SELECT Products as prods, Profit as profit FROM Profits ORDER BY ID",
|
|
30
|
+
"indexCols": [ "prods" ],
|
|
31
|
+
"valueCols": [ "profit" ],
|
|
32
|
+
"direction": "import"
|
|
33
|
+
},
|
|
34
|
+
"vars_data": {
|
|
35
|
+
"comment": "The vars_data data source performs a dual function by first importing the decision variable initial values from the Access database and then saving the final variable values back to that same file. The first property, type, specifies the type of file where the data is being imported/exported ('msaccess'), the second property, connection, specifies the file name within quotes ('ProductMixAccess.accdb') and the third property, selection, imports two fields from the Profits table in order by ID ('SELECT Products, Initials FROM Profits ORDER BY ID). The 4th property, indexCols, indexes the data by the prods dimension while the 5th property, valueCols, imports the actual numerical data. The direction property ensures that the initial variable values are imported and the final variable values are exported using direction: 'import/export'. Within variables, the x array definition uses the valueCol property to pass the initial variable values and the binding property to bind to the vars_data data source. The final variable values (requested using the output property finalValues:[] within the x array definition) will be appended to the Profits table.",
|
|
36
|
+
"type": "odbc",
|
|
37
|
+
"connection": "Driver={SQL Server};Server=tcp:solver.database.windows.net,1433;Database=Rason;Uid=rasonread;Pwd=Rason1234;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;",
|
|
38
|
+
"selection": "SELECT Products as prods, Initials as initials FROM Profits ORDER BY ID",
|
|
39
|
+
"indexCols": [ "prods" ],
|
|
40
|
+
"valueCols": [ "initials" ],
|
|
41
|
+
"direction": "import/export"
|
|
42
|
+
},
|
|
43
|
+
"fcns_data": {
|
|
44
|
+
"comment": "The fcns_data datasource, exports the final constraint values to the Access data base file, ProductMixAccess.accdb. The first property, type: 'msaccess', specifies the type of file where the data is being imported/exported. Alternatively, 'access' or 'odbc' could have been passed instead of 'msaccess'. The second property, connection, specifies the file name within quotes ('ProductMixAcess.accdb'). The 3rd property, selection: 'ResultFcns', creates a table within the Access database, where the final constraint values will be saved. The direction property ensures that the file is 'exported'. Within the c constraint definition, the constraint block is bound to the fcns_data data source by the binding property. The output property, finalValue:[], will export the final constraint values to the ResultsFcns table within the file, ProductMixAccess.accdb.",
|
|
45
|
+
"type": "odbc",
|
|
46
|
+
"connection": "Driver={SQL Server};Server=tcp:solver.database.windows.net,1433;Database=Rason;Uid=rasonread;Pwd=Rason1234;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;",
|
|
47
|
+
"selection": "ResultFcns",
|
|
48
|
+
"direction": "export"
|
|
49
|
+
},
|
|
50
|
+
"obj_data": {
|
|
51
|
+
"comment": "The obj_data datasource exports the final objective value to ProductMixAccess.accdb. Again the first property, type, specifies the file type ('msaccess'), the second property, connection, specifies the file name ('ProductMixAccess.accdb') and the third property, selection, specifies the table where the final objective value will be written ('ResultObj'). The direction property ensures that the file is 'exported'. The binding property within the total objective definition 'binds' the objective to the obj_data source. The output property, finalValue:[], exports the final objective function value to the ResultObj table within the file ProductMixAccess.accdb.",
|
|
52
|
+
"type": "odbc",
|
|
53
|
+
"connection": "Driver={SQL Server};Server=tcp:solver.database.windows.net,1433;Database=Rason;Uid=rasonread;Pwd=Rason1234;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;",
|
|
54
|
+
"selection": "ResultObj",
|
|
55
|
+
"direction": "export"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"data": {
|
|
59
|
+
"comment": "Binds the datasources to data component.",
|
|
60
|
+
"profit": {
|
|
61
|
+
"comment": "Binds the values in the profits column in the profit_data datasource to profit data component. If valueCol property is missing, RASON assumes the value column is the last column in the table.",
|
|
62
|
+
"binding": "profit_data"
|
|
63
|
+
},
|
|
64
|
+
"invent": {
|
|
65
|
+
"comment": "Binds the values in the inventory column in the invent_data datasource to invent data component.",
|
|
66
|
+
"binding": "invent_data"
|
|
67
|
+
},
|
|
68
|
+
"parts2": {
|
|
69
|
+
"comment": "Binds the values in the qty column in the parts_data datasource to parts2 data component.",
|
|
70
|
+
"binding": "parts_data"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"formulas": {
|
|
74
|
+
"comment": "Use this section to calculate intermediate formulas to be used within the constraints and objective sections.",
|
|
75
|
+
"piv_parts": {
|
|
76
|
+
"formula": "PIVOT(parts2, { 'prods' }, { 'parts' })"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"variables": {
|
|
80
|
+
"comment": "Decision Variables",
|
|
81
|
+
"x": {
|
|
82
|
+
"comment": "The amount of products to produce, x[1] = TVs, x[2] = Stereos, x[3] = Speakers",
|
|
83
|
+
"dimensions": [ "prods" ],
|
|
84
|
+
"valuecol": "initials",
|
|
85
|
+
"lower": 0,
|
|
86
|
+
"finalValue": []
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"constraints": {
|
|
90
|
+
"comment": "Constraints",
|
|
91
|
+
"c": {
|
|
92
|
+
"comment": "Generates 5 constraints that calculate the number of parts used in creating the three products, then sets each constraint equal to the amount of each part in inventory.",
|
|
93
|
+
"dimensions": [ "parts" ],
|
|
94
|
+
"formula": "MMULT(piv_parts, x)",
|
|
95
|
+
"upper": "invent",
|
|
96
|
+
"finalValue": []
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"objective": {
|
|
100
|
+
"comment": "objective function",
|
|
101
|
+
"total": {
|
|
102
|
+
"comment": "Calculates the profit by multiplying the profit per unit of each product by the final variable values.",
|
|
103
|
+
"formula": "sumproduct(x, profit)",
|
|
104
|
+
"type": "maximize",
|
|
105
|
+
"finalValue": []
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
{
|
|
2
|
-
"modelName": "UGAirlineHubCSV",
|
|
3
|
-
"modelDescription": "RASON Distance Minimization Nonlinear Optimization Example - This example is used in the Introduction chapter within the RASON User Guide (downloadable from the Help tab) to illustrate RASON's ability to import data from an outside source. Many realistic models use large tables of data, often drawn from multiple data fields or databases. The goal of this example is to find a location of an airline hub serving several regional airports. The location of the hub should be as close to equidistant to each airport served, as possible. In this example the datasources section imports a CSV file containing a list of coordinates for the regional airports. AirlineHubData.csv contains three columns: 'cities', containing the city name, dx and dy, containing the x and y coordinates of each airport. Our list of city coordinates is located in a CSV file, however, our data could also have been located in an ODBC database or an Excel file. Click Help - RASON Subscriptions -- Data Connections to see how to setup a secure data connection in RASON. To download AirlineHubData.csv, click Download RASON example data from the ribbon. To attach the file to the example, click Choose Files (on the Properties pane), browse to the location of the downloaded files, select AirlineHubData.csv and click Open. Then click POST (upload icon on ribbon) to post the model to the RASON Server. Finally, click the down arrow next the Play icon and click Solve to solve the model. The x and y values in the final solution will be the x and y coordinates of the proprosed airline hub.",
|
|
4
|
-
"modelType": "optimization",
|
|
5
|
-
"engineSettings": {
|
|
6
|
-
"comment": "Since this model is nonlinear, the GRG Nonlinear engine is selected as the solving engine.",
|
|
7
|
-
"engine": "GRG Nonlinear"
|
|
8
|
-
},
|
|
9
|
-
"datasources": {
|
|
10
|
-
"comment": "The dataSources section defines a source from which the data values will be imported, in this case a comma-separated-value (CSV) file named AirlineHubData.csv. The data source defines an index column, CITIES, which is used to dimension the array of constraints, c.",
|
|
11
|
-
"city_data": {
|
|
12
|
-
"type": "csv",
|
|
13
|
-
"connection": "AirlineHubData.csv",
|
|
14
|
-
"indexCols": [ "cities" ],
|
|
15
|
-
"valueCols": [ "dx", "dy" ],
|
|
16
|
-
"direction": "import"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"variables": {
|
|
20
|
-
"comment": "This example contains three decision variables x, y and z. The x and y variables will hold the final x and y coordinates of the proposed firehouse location. The third variable, z, will be minimized in the objective function. Since the finalValue property is present, the final value of each variable will be returned in the results.",
|
|
21
|
-
"x": {
|
|
22
|
-
"comment": "The x coordinate of the proposed airport location. Since the finalValue property is present, the final value of the objective function will be returned in the results.",
|
|
23
|
-
"value": 1.0,
|
|
24
|
-
"finalValue": []
|
|
25
|
-
},
|
|
26
|
-
"y": {
|
|
27
|
-
"comment": "The y coordinate of the proposed airport location. Since the finalValue property is present, the final value of the objective function will be returned in the results.",
|
|
28
|
-
"value": 1.0,
|
|
29
|
-
"finalValue": []
|
|
30
|
-
},
|
|
31
|
-
"z": {
|
|
32
|
-
"comment": "The z variable that will be minimized in the objective function. Since the finalValue property is present, the final value of the objective function will be returned in the results.",
|
|
33
|
-
"value": 1.0,
|
|
34
|
-
"finalValue": []
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"data": {
|
|
38
|
-
"comment": "In the data section of the model, we bind the names dx and dy to 1-dimensional arrays from the corresponding value columns dx and dy. This model can be used to solve many different instances of this facility location problem, for a variable number of cities.",
|
|
39
|
-
"dx": {
|
|
40
|
-
"comment": "x coordinates of each city bound to the dx data array.",
|
|
41
|
-
"binding": "city_data",
|
|
42
|
-
"valueCol": "dx"
|
|
43
|
-
},
|
|
44
|
-
"dy": {
|
|
45
|
-
"comment": "y coordinates of each city bound to the dy data array.",
|
|
46
|
-
"binding": "city_data",
|
|
47
|
-
"valueCol": "dy"
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"constraints": {
|
|
51
|
-
"c": {
|
|
52
|
-
"comment": "There will be 1 constraint per city regional airport. The distance formula is used to calculate the distance bewteen the proprosed hub's location and the city regional airport.",
|
|
53
|
-
"dimensions": [ "cities", 1 ],
|
|
54
|
-
"upper": 0,
|
|
55
|
-
"formula": "sqrt((x - dx)^2 + (y - dy)^2) - z"
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
"objective": {
|
|
59
|
-
"comment": "The objective function minimizes the z variable creating a squashing effect that pushes the distances between the proposed airling hub and the distance between each city airport to be as small as possible.",
|
|
60
|
-
"obj": {
|
|
61
|
-
"comment": "Since the finalValue property is present, the final value of the objective function will be returned in the results. Note that the final value for the z variable and the objective will be equal.",
|
|
62
|
-
"type": "minimize",
|
|
63
|
-
"formula": "z",
|
|
64
|
-
"finalValue": []
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"modelName": "UGAirlineHubCSV",
|
|
3
|
+
"modelDescription": "RASON Distance Minimization Nonlinear Optimization Example - This example is used in the Introduction chapter within the RASON User Guide (downloadable from the Help tab) to illustrate RASON's ability to import data from an outside source. Many realistic models use large tables of data, often drawn from multiple data fields or databases. The goal of this example is to find a location of an airline hub serving several regional airports. The location of the hub should be as close to equidistant to each airport served, as possible. In this example the datasources section imports a CSV file containing a list of coordinates for the regional airports. AirlineHubData.csv contains three columns: 'cities', containing the city name, dx and dy, containing the x and y coordinates of each airport. Our list of city coordinates is located in a CSV file, however, our data could also have been located in an ODBC database or an Excel file. Click Help - RASON Subscriptions -- Data Connections to see how to setup a secure data connection in RASON. To download AirlineHubData.csv, click Download RASON example data from the ribbon. To attach the file to the example, click Choose Files (on the Properties pane), browse to the location of the downloaded files, select AirlineHubData.csv and click Open. Then click POST (upload icon on ribbon) to post the model to the RASON Server. Finally, click the down arrow next the Play icon and click Solve to solve the model. The x and y values in the final solution will be the x and y coordinates of the proprosed airline hub.",
|
|
4
|
+
"modelType": "optimization",
|
|
5
|
+
"engineSettings": {
|
|
6
|
+
"comment": "Since this model is nonlinear, the GRG Nonlinear engine is selected as the solving engine.",
|
|
7
|
+
"engine": "GRG Nonlinear"
|
|
8
|
+
},
|
|
9
|
+
"datasources": {
|
|
10
|
+
"comment": "The dataSources section defines a source from which the data values will be imported, in this case a comma-separated-value (CSV) file named AirlineHubData.csv. The data source defines an index column, CITIES, which is used to dimension the array of constraints, c.",
|
|
11
|
+
"city_data": {
|
|
12
|
+
"type": "csv",
|
|
13
|
+
"connection": "AirlineHubData.csv",
|
|
14
|
+
"indexCols": [ "cities" ],
|
|
15
|
+
"valueCols": [ "dx", "dy" ],
|
|
16
|
+
"direction": "import"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"variables": {
|
|
20
|
+
"comment": "This example contains three decision variables x, y and z. The x and y variables will hold the final x and y coordinates of the proposed firehouse location. The third variable, z, will be minimized in the objective function. Since the finalValue property is present, the final value of each variable will be returned in the results.",
|
|
21
|
+
"x": {
|
|
22
|
+
"comment": "The x coordinate of the proposed airport location. Since the finalValue property is present, the final value of the objective function will be returned in the results.",
|
|
23
|
+
"value": 1.0,
|
|
24
|
+
"finalValue": []
|
|
25
|
+
},
|
|
26
|
+
"y": {
|
|
27
|
+
"comment": "The y coordinate of the proposed airport location. Since the finalValue property is present, the final value of the objective function will be returned in the results.",
|
|
28
|
+
"value": 1.0,
|
|
29
|
+
"finalValue": []
|
|
30
|
+
},
|
|
31
|
+
"z": {
|
|
32
|
+
"comment": "The z variable that will be minimized in the objective function. Since the finalValue property is present, the final value of the objective function will be returned in the results.",
|
|
33
|
+
"value": 1.0,
|
|
34
|
+
"finalValue": []
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"data": {
|
|
38
|
+
"comment": "In the data section of the model, we bind the names dx and dy to 1-dimensional arrays from the corresponding value columns dx and dy. This model can be used to solve many different instances of this facility location problem, for a variable number of cities.",
|
|
39
|
+
"dx": {
|
|
40
|
+
"comment": "x coordinates of each city bound to the dx data array.",
|
|
41
|
+
"binding": "city_data",
|
|
42
|
+
"valueCol": "dx"
|
|
43
|
+
},
|
|
44
|
+
"dy": {
|
|
45
|
+
"comment": "y coordinates of each city bound to the dy data array.",
|
|
46
|
+
"binding": "city_data",
|
|
47
|
+
"valueCol": "dy"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"constraints": {
|
|
51
|
+
"c": {
|
|
52
|
+
"comment": "There will be 1 constraint per city regional airport. The distance formula is used to calculate the distance bewteen the proprosed hub's location and the city regional airport.",
|
|
53
|
+
"dimensions": [ "cities", 1 ],
|
|
54
|
+
"upper": 0,
|
|
55
|
+
"formula": "sqrt((x - dx)^2 + (y - dy)^2) - z"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"objective": {
|
|
59
|
+
"comment": "The objective function minimizes the z variable creating a squashing effect that pushes the distances between the proposed airling hub and the distance between each city airport to be as small as possible.",
|
|
60
|
+
"obj": {
|
|
61
|
+
"comment": "Since the finalValue property is present, the final value of the objective function will be returned in the results. Note that the final value for the z variable and the objective will be equal.",
|
|
62
|
+
"type": "minimize",
|
|
63
|
+
"formula": "z",
|
|
64
|
+
"finalValue": []
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|