Changeset 16288 for branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Templates/CompiledLinearProgrammingProblemDefinition.cs
- Timestamp:
- 11/08/18 17:10:53 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Templates/CompiledLinearProgrammingProblemDefinition.cs
r16233 r16288 1 using Google.OrTools.LinearSolver; 1 using System; 2 using System.Linq; 3 using System.Collections.Generic; 4 using Google.OrTools.LinearSolver; 5 using HeuristicLab.Common; 6 using HeuristicLab.Core; 2 7 using HeuristicLab.Data; 3 8 using HeuristicLab.MathematicalOptimization.LinearProgramming.Problems; 4 9 using HeuristicLab.Optimization; 5 10 using HeuristicLab.Problems.Programmable; 11 using Variable = Google.OrTools.LinearSolver.Variable; 6 12 7 13 namespace HeuristicLab.MathematicalOptimization.LinearProgramming { … … 10 16 private Variable x; 11 17 private Variable y; 12 18 13 19 public override void Initialize() { 14 20 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable 15 21 // Add additional initialization code e.g. private variables that you need for evaluating 16 22 } 17 23 18 24 public void BuildModel(Solver solver) { 19 25 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable … … 27 33 solver.Maximize(x + 10 * y); 28 34 } 29 35 30 36 public void Analyze(Solver solver, ResultCollection results) { 31 37 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable … … 37 43 //results.AddOrUpdateResult("y", new DoubleValue(solver.LookupVariableOrNull("y").SolutionValue())); 38 44 } 39 45 40 46 // Implement further classes and methods 41 47 } 42 48 } 49
Note: See TracChangeset
for help on using the changeset viewer.