Changeset 16373 for branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Templates
- Timestamp:
- 12/12/18 14:23:45 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Templates/CompiledLinearProgrammingProblemDefinition.cs
r16288 r16373 16 16 private Variable x; 17 17 private Variable y; 18 18 19 19 public override void Initialize() { 20 20 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable 21 21 // Add additional initialization code e.g. private variables that you need for evaluating 22 22 } 23 24 public voidBuildModel(Solver solver) {23 24 public bool BuildModel(Solver solver) { 25 25 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable 26 26 // Example model taken from https://developers.google.com/optimization/mip/integer_opt … … 32 32 // Define the objective 33 33 solver.Maximize(x + 10 * y); 34 return true; 34 35 } 35 36 36 37 public void Analyze(Solver solver, ResultCollection results) { 37 38 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable … … 43 44 //results.AddOrUpdateResult("y", new DoubleValue(solver.LookupVariableOrNull("y").SolutionValue())); 44 45 } 45 46 46 47 // Implement further classes and methods 47 48 }
Note: See TracChangeset
for help on using the changeset viewer.