examples: Fix main default parameter
This commit is contained in:
@@ -1989,7 +1989,7 @@ def solve_bus_driver_scheduling():
|
||||
bus_driver_scheduling(False, num_drivers)
|
||||
|
||||
|
||||
def main(_):
|
||||
def main(_=None):
|
||||
solve_bus_driver_scheduling()
|
||||
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ def RunAssignmentOn4x4Matrix():
|
||||
'Some input costs are too large and may cause an integer overflow.')
|
||||
|
||||
|
||||
def main(_):
|
||||
def main(_=None):
|
||||
RunAssignmentOn4x4Matrix()
|
||||
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ def MinCostFlow():
|
||||
print('There was an issue with the min cost flow input.')
|
||||
|
||||
|
||||
def main(_):
|
||||
def main(_=None):
|
||||
MaxFlow()
|
||||
MinCostFlow()
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user