Changeset 16405 for branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Templates/CompiledLinearProgrammingProblemDefinition.cs
- Timestamp:
- 12/19/18 14:15:49 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Templates/CompiledLinearProgrammingProblemDefinition.cs
r16373 r16405 6 6 using HeuristicLab.Core; 7 7 using HeuristicLab.Data; 8 using HeuristicLab.MathematicalOptimization.LinearProgramming.Problems;9 8 using HeuristicLab.Optimization; 10 using HeuristicLab.Problems.Programmable;11 9 using Variable = Google.OrTools.LinearSolver.Variable; 12 10 … … 22 20 } 23 21 24 public boolBuildModel(Solver solver) {22 public void BuildModel(Solver solver) { 25 23 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable 24 // How to define a model using Google OR-Tools: https://developers.google.com/optimization/introduction/cs 26 25 // Example model taken from https://developers.google.com/optimization/mip/integer_opt 27 26 // Define the decision variables … … 32 31 // Define the objective 33 32 solver.Maximize(x + 10 * y); 34 return true;35 33 } 36 34 37 35 public void Analyze(Solver solver, ResultCollection results) { 38 36 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable 39 // Write or update results given the solution va riables of the decision variables37 // Write or update results given the solution values of the decision variables 40 38 results.AddOrUpdateResult("x", new DoubleValue(x.SolutionValue())); 41 39 results.AddOrUpdateResult("y", new DoubleValue(y.SolutionValue()));
Note: See TracChangeset
for help on using the changeset viewer.