ModelBuilder C# class -> Model, ModelSolver c# class -> Solver to avoir name conflict between the class and the namespace

This commit is contained in:
Laurent Perron
2023-11-05 19:18:48 +01:00
parent 54843e4f9b
commit 5fa6f76cab
9 changed files with 104 additions and 39 deletions

View File

@@ -31,7 +31,7 @@ public class AssignmentMb
// [END data_model]
// [START model]
ModelBuilder model = new ModelBuilder();
Model model = new Model();
// [END model]
// Variables.
@@ -88,7 +88,7 @@ public class AssignmentMb
// [START solver]
// Create the solver with the SCIP backend and check it is supported.
ModelSolver solver = new ModelSolver("SCIP");
Solver solver = new Solver("SCIP");
if (!solver.SolverIsSupported())
return;
// [END solver]

View File

@@ -37,7 +37,7 @@ public class BinPackingMb
// [END program_part1]
// [START model]
ModelBuilder model = new ModelBuilder();
Model model = new Model();
// [END model]
// [START program_part2]
@@ -85,7 +85,7 @@ public class BinPackingMb
// [START solver]
// Create the solver with the SCIP backend and check it is supported.
ModelSolver solver = new ModelSolver("SCIP");
Solver solver = new Solver("SCIP");
if (!solver.SolverIsSupported())
return;
// [END solver]

View File

@@ -24,7 +24,7 @@ public class SimpleMipProgramMb
{
// [START model]
// Create the model builder.
ModelBuilder model = new ModelBuilder();
Model model = new Model();
// [END model]
// [START variables]
@@ -49,7 +49,7 @@ public class SimpleMipProgramMb
// [Start clone]
// Clone the model.
Console.WriteLine("Cloning the model");
ModelBuilder modelCopy = model.Clone();
Model modelCopy = model.Clone();
Variable xCopy = modelCopy.VarFromIndex(x.Index);
Variable yCopy = modelCopy.VarFromIndex(y.Index);
Variable zCopy = modelCopy.NewBoolVar("z");
@@ -67,7 +67,7 @@ public class SimpleMipProgramMb
// [START solver]
// Create the solver with the CP-SAT backend and checks it is supported.
ModelSolver solver = new ModelSolver("sat");
Solver solver = new Solver("sat");
if (!solver.SolverIsSupported())
return;
// [END solver]

View File

@@ -24,7 +24,7 @@ public class SimpleLpProgramMb
{
// [START model]
// Create the model builder.
ModelBuilder model = new ModelBuilder();
Model model = new Model();
// [END model]
// [START variables]
@@ -52,7 +52,7 @@ public class SimpleLpProgramMb
// [START solver]
// Create the model solver with the GLOP backend.
ModelSolver solver = new ModelSolver("GLOP");
Solver solver = new Solver("GLOP");
if (!solver.SolverIsSupported())
{
return;

View File

@@ -24,7 +24,7 @@ public class SimpleMipProgramMb
{
// [START model]
// Create the model builder.
ModelBuilder model = new ModelBuilder();
Model model = new Model();
// [END model]
// [START variables]
@@ -52,7 +52,7 @@ public class SimpleMipProgramMb
// [START solver]
// Create the model solver with the SCIP backend.
ModelSolver solver = new ModelSolver("SCIP");
Solver solver = new Solver("SCIP");
if (!solver.SolverIsSupported())
{
return;