Created
March 22, 2020 12:53
-
-
Save dboyliao/f62359c4ac0ba244263f9027d037cc27 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ortools.sat.python import cp_model | |
model = cp_model.CpModel() | |
model.NewIntVar # declare a variable of type int | |
model.NewBoolVar # declare a variable of type bool | |
model.NewIntervalVar # declare an inclusive interval [a, b] | |
model.Add # add constraint, such as x < 1 | |
model.AddNoOverlap # add constraint for non overlapping intervals | |
# and more... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment