examples: Fix main default parameter

This commit is contained in:
Corentin Le Molgat
2022-04-14 14:44:13 +02:00
parent ad19407ff6
commit 34e442cd5d
22 changed files with 22 additions and 22 deletions

View File

@@ -1989,7 +1989,7 @@ def solve_bus_driver_scheduling():
bus_driver_scheduling(False, num_drivers)
def main(_):
def main(_=None):
solve_bus_driver_scheduling()

View File

@@ -28,7 +28,7 @@ from ortools.sat.python import visualization
from ortools.sat.python import cp_model
def main(_):
def main(_=None):
"""Solves the gate scheduling problem."""
model = cp_model.CpModel()

View File

@@ -93,7 +93,7 @@ def solve_golomb_ruler(order):
print(f'- total wall time: {solver.WallTime()}ms\n')
def main(_):
def main(_=None):
solve_golomb_ruler(FLAGS.order)

View File

@@ -85,7 +85,7 @@ def solve_golomb_ruler(order, params):
print(f'- wall time: {solver.WallTime()}s\n')
def main(_):
def main(_=None):
solve_golomb_ruler(FLAGS.order, FLAGS.params)

View File

@@ -189,7 +189,7 @@ def solve_hidato(puzzle, index):
print(' - wall time : %f s' % solver.WallTime())
def main(_):
def main(_=None):
for pb in range(1, 7):
solve_hidato(build_puzzle(pb), pb)

View File

@@ -369,7 +369,7 @@ def solve_knapsack(model):
solve_with_rotations(data, max_height, max_width)
def main(_):
def main(_=None):
solve_knapsack(FLAGS.model)

View File

@@ -49,7 +49,7 @@ def RunAssignmentOn4x4Matrix():
'Some input costs are too large and may cause an integer overflow.')
def main(_):
def main(_=None):
RunAssignmentOn4x4Matrix()

View File

@@ -72,7 +72,7 @@ def MinCostFlow():
print('There was an issue with the min cost flow input.')
def main(_):
def main(_=None):
MaxFlow()
MinCostFlow()

View File

@@ -300,7 +300,7 @@ def SolveRcpsp(problem, proto_file, params):
solver.Solve(model)
def main(_):
def main(_=None):
rcpsp_parser = pywraprcpsp.RcpspParser()
rcpsp_parser.ParseFile(FLAGS.input)
SolveRcpsp(rcpsp_parser.Problem(), FLAGS.output_proto, FLAGS.params)

View File

@@ -419,7 +419,7 @@ def solve_shift_scheduling(params, output_proto):
print(' - wall time : %f s' % solver.WallTime())
def main(_):
def main(_=None):
solve_shift_scheduling(FLAGS.params, FLAGS.output_proto)

View File

@@ -736,7 +736,7 @@ def steel_mill_slab_with_mip_column_generation(problem):
print('No solution')
def main(_):
def main(_=None):
if FLAGS.solver == 'sat':
steel_mill_slab(FLAGS.problem, FLAGS.break_symmetries)
elif FLAGS.solver == 'sat_table':