add C# samples to the SAT md doc
This commit is contained in:
@@ -21,15 +21,15 @@ from ortools.sat.python import cp_model
|
||||
def MinimalCpSat():
|
||||
# Creates the model.
|
||||
model = cp_model.CpModel()
|
||||
# Creates the variables.
|
||||
# Creates the variables.
|
||||
num_vals = 3
|
||||
x = model.NewIntVar(0, num_vals - 1, "x")
|
||||
y = model.NewIntVar(0, num_vals - 1, "y")
|
||||
z = model.NewIntVar(0, num_vals - 1, "z")
|
||||
# Create the constraints.
|
||||
# Creates the constraints.
|
||||
model.Add(x != y)
|
||||
|
||||
# Create a solver and solve.
|
||||
# Creates a solver and solves the model.
|
||||
solver = cp_model.CpSolver()
|
||||
status = solver.Solve(model)
|
||||
|
||||
@@ -59,7 +59,7 @@ class VarArraySolutionPrinter(cp_model.CpSolverSolutionCallback):
|
||||
def MinimalCpSatAllSolutions():
|
||||
# Creates the model.
|
||||
model = cp_model.CpModel()
|
||||
# Creates the variables.
|
||||
# Creates the variables.
|
||||
num_vals = 3
|
||||
x = model.NewIntVar(0, num_vals - 1, "x")
|
||||
y = model.NewIntVar(0, num_vals - 1, "y")
|
||||
|
||||
Reference in New Issue
Block a user