This is the code described in the book, along with generators ofrandom instances and test drivers.
First, there is aMakefile
that tests every model in the book. Thereader should run amake
before making any change to the code toverify that everything is working.
The only change that may berequired is to change the value of thePYTHONPATH
variable toindicate where is located Google's or-tools. This variable is set onthe first line of theMakefile
.
For each section of the book, the structure is identical. Consider,for instance the chapterStaffing. The code in the book can be foundin the filestaffing.py
; in the same file a generator of problem isincluded. And in the filetest_staffing.py
there is a driver thatgenerates a problem and solves it. The reader can use this as an exampleon how to use the models.