Apply yapf on examples/python/*.py
This commit is contained in:
@@ -39,9 +39,8 @@ class SolutionPrinter(cp_model.CpSolverSolutionCallback):
|
||||
print('Solution %i: ', self.__solution_count)
|
||||
print(' min vendors:', self.__min_vendors)
|
||||
for i in range(self.__num_vendors):
|
||||
print(
|
||||
' - vendor %i: ' % i, self.__possible_schedules[self.Value(
|
||||
self.__selected_schedules[i])])
|
||||
print(' - vendor %i: ' % i, self.__possible_schedules[self.Value(
|
||||
self.__selected_schedules[i])])
|
||||
print()
|
||||
|
||||
for j in range(self.__num_hours):
|
||||
@@ -73,12 +72,12 @@ def main():
|
||||
# Last columns are :
|
||||
# index_of_the_schedule, sum of worked hours (per work type).
|
||||
# The index is useful for branching.
|
||||
possible_schedules = [[1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 8],
|
||||
[1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 4],
|
||||
[0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 2, 5],
|
||||
[0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 3, 4],
|
||||
[1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 4, 3],
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0]]
|
||||
possible_schedules = [[1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0,
|
||||
8], [1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1,
|
||||
4], [0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 2,
|
||||
5], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 3, 4],
|
||||
[1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 4,
|
||||
3], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0]]
|
||||
|
||||
num_possible_schedules = len(possible_schedules)
|
||||
selected_schedules = []
|
||||
@@ -137,8 +136,8 @@ def main():
|
||||
print(' - conflicts : %i' % solver.NumConflicts())
|
||||
print(' - branches : %i' % solver.NumBranches())
|
||||
print(' - wall time : %f s' % solver.WallTime())
|
||||
print(' - number of solutions found: %i' %
|
||||
solution_printer.solution_count())
|
||||
print(
|
||||
' - number of solutions found: %i' % solution_printer.solution_count())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user