diff --git a/examples/python/3_jugs_mip.py b/examples/python/3_jugs_mip.py index 4843d78fbd..33c3747f9e 100644 --- a/examples/python/3_jugs_mip.py +++ b/examples/python/3_jugs_mip.py @@ -28,7 +28,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp def main(sol = 'GLPK'): diff --git a/examples/python/3_jugs_regular.py b/examples/python/3_jugs_regular.py index ab90a560b3..a296b42854 100644 --- a/examples/python/3_jugs_regular.py +++ b/examples/python/3_jugs_regular.py @@ -47,7 +47,7 @@ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp from collections import defaultdict # diff --git a/examples/python/a_round_of_golf.py b/examples/python/a_round_of_golf.py index 51c1945d10..a7f55f54f2 100644 --- a/examples/python/a_round_of_golf.py +++ b/examples/python/a_round_of_golf.py @@ -64,7 +64,7 @@ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/all_interval.py b/examples/python/all_interval.py index f4d989fb65..232be66ab6 100644 --- a/examples/python/all_interval.py +++ b/examples/python/all_interval.py @@ -51,7 +51,7 @@ """ import string, sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(n=12): diff --git a/examples/python/alldifferent_except_0.py b/examples/python/alldifferent_except_0.py index f3dadc6430..27ce71d451 100644 --- a/examples/python/alldifferent_except_0.py +++ b/examples/python/alldifferent_except_0.py @@ -51,7 +51,7 @@ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # # Decomposition of alldifferent_except_0 diff --git a/examples/python/alphametic.py b/examples/python/alphametic.py index 897909dd15..f12aaf3de2 100644 --- a/examples/python/alphametic.py +++ b/examples/python/alphametic.py @@ -45,7 +45,7 @@ """ import sys, string, re -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(problem_str="SEND+MORE=MONEY", base=10): diff --git a/examples/python/assignment.py b/examples/python/assignment.py index e0621908f3..e46ae0077c 100644 --- a/examples/python/assignment.py +++ b/examples/python/assignment.py @@ -31,7 +31,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(cost, rows, cols): diff --git a/examples/python/assignment6_mip.py b/examples/python/assignment6_mip.py index 3c5cd1a796..0a0fbcfd98 100644 --- a/examples/python/assignment6_mip.py +++ b/examples/python/assignment6_mip.py @@ -40,7 +40,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp def main(sol = 'GLPK'): diff --git a/examples/python/bacp.py b/examples/python/bacp.py index a28060fb64..290af0ffe2 100644 --- a/examples/python/bacp.py +++ b/examples/python/bacp.py @@ -14,7 +14,7 @@ from google.apputils import app import gflags -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp FLAGS = gflags.FLAGS diff --git a/examples/python/blending.py b/examples/python/blending.py index 5e1b4e73a5..28c351e873 100644 --- a/examples/python/blending.py +++ b/examples/python/blending.py @@ -22,7 +22,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp def main(sol = 'GLPK'): diff --git a/examples/python/broken_weights.py b/examples/python/broken_weights.py index 14d684b864..814b8dfd6e 100644 --- a/examples/python/broken_weights.py +++ b/examples/python/broken_weights.py @@ -49,7 +49,7 @@ import sys import string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(m=40, n=4): diff --git a/examples/python/bus_schedule.py b/examples/python/bus_schedule.py index d581396b92..434603a043 100644 --- a/examples/python/bus_schedule.py +++ b/examples/python/bus_schedule.py @@ -36,7 +36,7 @@ import sys import string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp diff --git a/examples/python/car.py b/examples/python/car.py index 3441b897d7..49606580b6 100644 --- a/examples/python/car.py +++ b/examples/python/car.py @@ -32,7 +32,7 @@ import sys import string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(num_sol=3): diff --git a/examples/python/circuit.py b/examples/python/circuit.py index 541fd6c009..b34d03308c 100644 --- a/examples/python/circuit.py +++ b/examples/python/circuit.py @@ -43,7 +43,7 @@ import sys import string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # # circuit(x) diff --git a/examples/python/coins3.py b/examples/python/coins3.py index e6617e8597..6e59e0af3c 100644 --- a/examples/python/coins3.py +++ b/examples/python/coins3.py @@ -37,7 +37,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys, string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/coins_grid.py b/examples/python/coins_grid.py index b4225a950d..a97b925c18 100644 --- a/examples/python/coins_grid.py +++ b/examples/python/coins_grid.py @@ -53,7 +53,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(unused_argv): # Create the solver. diff --git a/examples/python/coins_grid_mip.py b/examples/python/coins_grid_mip.py index b5c976bedd..fc93882bf7 100644 --- a/examples/python/coins_grid_mip.py +++ b/examples/python/coins_grid_mip.py @@ -40,7 +40,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp def main(unused_argv): diff --git a/examples/python/coloring_ip.py b/examples/python/coloring_ip.py index 58bc0c46ac..abb365d309 100644 --- a/examples/python/coloring_ip.py +++ b/examples/python/coloring_ip.py @@ -38,7 +38,7 @@ """ import sys -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp def main(sol = 'GLPK'): diff --git a/examples/python/combinatorial_auction2.py b/examples/python/combinatorial_auction2.py index b604983890..003e73adb6 100644 --- a/examples/python/combinatorial_auction2.py +++ b/examples/python/combinatorial_auction2.py @@ -32,7 +32,7 @@ """ import sys,string from collections import * -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/contiguity_regular.py b/examples/python/contiguity_regular.py index 0226aad785..8959cb76cb 100644 --- a/examples/python/contiguity_regular.py +++ b/examples/python/contiguity_regular.py @@ -40,7 +40,7 @@ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # # Global constraint regular diff --git a/examples/python/costas_array.py b/examples/python/costas_array.py index a2c0638e51..62f62f0bc6 100644 --- a/examples/python/costas_array.py +++ b/examples/python/costas_array.py @@ -62,7 +62,7 @@ import sys import string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(n=6): diff --git a/examples/python/covering_opl.py b/examples/python/covering_opl.py index cfdae599e0..00dabb5cc6 100644 --- a/examples/python/covering_opl.py +++ b/examples/python/covering_opl.py @@ -59,7 +59,7 @@ import sys import string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/crew.py b/examples/python/crew.py index 3a13a7ffc5..10e3632c6e 100644 --- a/examples/python/crew.py +++ b/examples/python/crew.py @@ -38,7 +38,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys, string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(sols=1): diff --git a/examples/python/crossword2.py b/examples/python/crossword2.py index 79431c4b58..5084123d01 100644 --- a/examples/python/crossword2.py +++ b/examples/python/crossword2.py @@ -57,7 +57,7 @@ """ from google.apputils import app -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(_): diff --git a/examples/python/crypta.py b/examples/python/crypta.py index b8adbfa755..521f515437 100644 --- a/examples/python/crypta.py +++ b/examples/python/crypta.py @@ -44,7 +44,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/crypto.py b/examples/python/crypto.py index 12d87917ad..d1db3a3ee8 100644 --- a/examples/python/crypto.py +++ b/examples/python/crypto.py @@ -43,7 +43,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/curious_set_of_integers.py b/examples/python/curious_set_of_integers.py index 2e29ccd117..437ecae274 100644 --- a/examples/python/curious_set_of_integers.py +++ b/examples/python/curious_set_of_integers.py @@ -59,7 +59,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def decreasing(solver, x): diff --git a/examples/python/debruijn_binary.py b/examples/python/debruijn_binary.py index fa95c7b209..628be85558 100644 --- a/examples/python/debruijn_binary.py +++ b/examples/python/debruijn_binary.py @@ -40,7 +40,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys, string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # converts a number (s) <-> an array of numbers (t) in the specific base. def toNum(solver, t, s, base): diff --git a/examples/python/diet1.py b/examples/python/diet1.py index 178a52dfc4..eea88c5add 100644 --- a/examples/python/diet1.py +++ b/examples/python/diet1.py @@ -44,7 +44,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp diff --git a/examples/python/diet1_b.py b/examples/python/diet1_b.py index 5ed57734df..250ed7e5cf 100644 --- a/examples/python/diet1_b.py +++ b/examples/python/diet1_b.py @@ -46,7 +46,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp diff --git a/examples/python/diet1_mip.py b/examples/python/diet1_mip.py index 9de64b3cfd..1d937d93dc 100644 --- a/examples/python/diet1_mip.py +++ b/examples/python/diet1_mip.py @@ -36,7 +36,7 @@ """ import sys -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp def main(sol = 'GLPK'): diff --git a/examples/python/discrete_tomography.py b/examples/python/discrete_tomography.py index 984f16b750..1b769745e2 100644 --- a/examples/python/discrete_tomography.py +++ b/examples/python/discrete_tomography.py @@ -54,7 +54,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(row_sums="", col_sums=""): diff --git a/examples/python/divisible_by_9_through_1.py b/examples/python/divisible_by_9_through_1.py index 0c53a89e62..f39326fc1a 100644 --- a/examples/python/divisible_by_9_through_1.py +++ b/examples/python/divisible_by_9_through_1.py @@ -53,7 +53,7 @@ """ import string, sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # # Decomposition of modulo constraint diff --git a/examples/python/dudeney.py b/examples/python/dudeney.py index b705e67aea..a20ca3429d 100644 --- a/examples/python/dudeney.py +++ b/examples/python/dudeney.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def dudeney(n): solver = pywrapcp.Solver('Dudeney') diff --git a/examples/python/einav_puzzle.py b/examples/python/einav_puzzle.py index 0fad820430..3569ee7b89 100644 --- a/examples/python/einav_puzzle.py +++ b/examples/python/einav_puzzle.py @@ -63,7 +63,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/einav_puzzle2.py b/examples/python/einav_puzzle2.py index c5e8d58647..213daed261 100644 --- a/examples/python/einav_puzzle2.py +++ b/examples/python/einav_puzzle2.py @@ -64,7 +64,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/eq10.py b/examples/python/eq10.py index 24167f8dc6..dbf22f5b41 100644 --- a/examples/python/eq10.py +++ b/examples/python/eq10.py @@ -27,7 +27,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/eq20.py b/examples/python/eq20.py index 1e027991c8..40055d2cae 100644 --- a/examples/python/eq20.py +++ b/examples/python/eq20.py @@ -27,7 +27,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/fill_a_pix.py b/examples/python/fill_a_pix.py index 47e347e458..d85a46759f 100644 --- a/examples/python/fill_a_pix.py +++ b/examples/python/fill_a_pix.py @@ -50,7 +50,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # Puzzle 1 from diff --git a/examples/python/furniture_moving.py b/examples/python/furniture_moving.py index 6a87354940..7c5d9a9971 100644 --- a/examples/python/furniture_moving.py +++ b/examples/python/furniture_moving.py @@ -36,7 +36,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys, string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # diff --git a/examples/python/futoshiki.py b/examples/python/futoshiki.py index 787e0abd66..7c52ee0c27 100644 --- a/examples/python/futoshiki.py +++ b/examples/python/futoshiki.py @@ -45,7 +45,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(values, lt): diff --git a/examples/python/game_theory_taha.py b/examples/python/game_theory_taha.py index e5d6f3cae6..6bad7b050e 100644 --- a/examples/python/game_theory_taha.py +++ b/examples/python/game_theory_taha.py @@ -25,7 +25,7 @@ """ import sys -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp def main(sol = 'GLPK'): diff --git a/examples/python/golomb8.py b/examples/python/golomb8.py index 881bd5c39c..690d1fbcc9 100644 --- a/examples/python/golomb8.py +++ b/examples/python/golomb8.py @@ -26,7 +26,7 @@ of the rule. from google.apputils import app import gflags -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp FLAGS = gflags.FLAGS diff --git a/examples/python/grocery.py b/examples/python/grocery.py index 3020bb5997..db6e02210f 100644 --- a/examples/python/grocery.py +++ b/examples/python/grocery.py @@ -39,7 +39,7 @@ import sys import string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/hidato.py b/examples/python/hidato.py index 260284f523..4189768c6e 100644 --- a/examples/python/hidato.py +++ b/examples/python/hidato.py @@ -41,7 +41,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/hidato_table.py b/examples/python/hidato_table.py index 52405e43e6..0356230c5a 100644 --- a/examples/python/hidato_table.py +++ b/examples/python/hidato_table.py @@ -26,7 +26,7 @@ """ from google.apputils import app -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def BuildPairs(rows, cols): diff --git a/examples/python/integer_programming.py b/examples/python/integer_programming.py index 897a513eaa..b9c2312251 100644 --- a/examples/python/integer_programming.py +++ b/examples/python/integer_programming.py @@ -17,7 +17,7 @@ from google.apputils import app -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp def RunIntegerExampleNaturalLanguageAPI(optimization_problem_type): diff --git a/examples/python/jobshop_ft06.py b/examples/python/jobshop_ft06.py index 720a7b1d2a..664cde18af 100644 --- a/examples/python/jobshop_ft06.py +++ b/examples/python/jobshop_ft06.py @@ -27,7 +27,7 @@ jobs. This is called the makespan. from google.apputils import app import gflags -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp FLAGS = gflags.FLAGS diff --git a/examples/python/just_forgotten.py b/examples/python/just_forgotten.py index 6e65a1adc8..b63ef4d169 100644 --- a/examples/python/just_forgotten.py +++ b/examples/python/just_forgotten.py @@ -45,7 +45,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/kakuro.py b/examples/python/kakuro.py index edf7565057..c7e2b5217a 100644 --- a/examples/python/kakuro.py +++ b/examples/python/kakuro.py @@ -57,7 +57,7 @@ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # # Ensure that the sum of the segments diff --git a/examples/python/kenken2.py b/examples/python/kenken2.py index f3e0f7732f..b8bc462ea6 100644 --- a/examples/python/kenken2.py +++ b/examples/python/kenken2.py @@ -58,7 +58,7 @@ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # # Ensure that the sum of the segments diff --git a/examples/python/killer_sudoku.py b/examples/python/killer_sudoku.py index 1bf4fe1f6f..29789b3704 100644 --- a/examples/python/killer_sudoku.py +++ b/examples/python/killer_sudoku.py @@ -69,7 +69,7 @@ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # # Ensure that the sum of the segments diff --git a/examples/python/knapsack.py b/examples/python/knapsack.py index 0e6e61f985..43137da0aa 100644 --- a/examples/python/knapsack.py +++ b/examples/python/knapsack.py @@ -18,7 +18,7 @@ from google.apputils import app import gflags -from algorithms import pywrapknapsack_solver +from ortools.algorithms import pywrapknapsack_solver FLAGS = gflags.FLAGS diff --git a/examples/python/knapsack_cp.py b/examples/python/knapsack_cp.py index f8fb1a7af6..abe690feb4 100644 --- a/examples/python/knapsack_cp.py +++ b/examples/python/knapsack_cp.py @@ -22,7 +22,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def knapsack(solver, values, weights, n): z = solver.IntVar(0, 10000) diff --git a/examples/python/knapsack_mip.py b/examples/python/knapsack_mip.py index 69320c177c..1b0263b712 100644 --- a/examples/python/knapsack_mip.py +++ b/examples/python/knapsack_mip.py @@ -22,7 +22,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp def main(sol = 'GLPK'): diff --git a/examples/python/labeled_dice.py b/examples/python/labeled_dice.py index dc6addb7f3..55caad4c2b 100644 --- a/examples/python/labeled_dice.py +++ b/examples/python/labeled_dice.py @@ -47,7 +47,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/langford.py b/examples/python/langford.py index 1e9f8899d2..be649d8fd8 100644 --- a/examples/python/langford.py +++ b/examples/python/langford.py @@ -47,7 +47,7 @@ import sys import string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(k=8, num_sol=0): diff --git a/examples/python/least_diff.py b/examples/python/least_diff.py index 1fbf504941..874e88506e 100644 --- a/examples/python/least_diff.py +++ b/examples/python/least_diff.py @@ -37,7 +37,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_cp_solver/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(unused_argv): # Create the solver. diff --git a/examples/python/least_square.py b/examples/python/least_square.py index 82386a0f5b..ed09ed4821 100644 --- a/examples/python/least_square.py +++ b/examples/python/least_square.py @@ -26,7 +26,7 @@ """ import sys -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp def main(sol = 'GLPK'): diff --git a/examples/python/lectures.py b/examples/python/lectures.py index 2f21852d9c..dc1150b54f 100644 --- a/examples/python/lectures.py +++ b/examples/python/lectures.py @@ -45,7 +45,7 @@ """ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/linear_assignment_api.py b/examples/python/linear_assignment_api.py index 349c51e55c..5db4c6ab10 100644 --- a/examples/python/linear_assignment_api.py +++ b/examples/python/linear_assignment_api.py @@ -21,7 +21,7 @@ from google.apputils import app -from graph import pywrapgraph +from ortools.graph import pywrapgraph def RunAssignmentOn4x4Matrix(): diff --git a/examples/python/linear_programming.py b/examples/python/linear_programming.py index 7c080a7339..f6c3c0dcb1 100644 --- a/examples/python/linear_programming.py +++ b/examples/python/linear_programming.py @@ -16,7 +16,7 @@ from google.apputils import app -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp def RunLinearExampleNaturalLanguageAPI(optimization_problem_type): diff --git a/examples/python/magic_sequence_distribute.py b/examples/python/magic_sequence_distribute.py index 0673e4d701..77b27a6c5c 100644 --- a/examples/python/magic_sequence_distribute.py +++ b/examples/python/magic_sequence_distribute.py @@ -24,7 +24,7 @@ distribute(). from google.apputils import app import gflags -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp FLAGS = gflags.FLAGS diff --git a/examples/python/magic_square.py b/examples/python/magic_square.py index 2c0f57a3d0..2e6c964701 100644 --- a/examples/python/magic_square.py +++ b/examples/python/magic_square.py @@ -22,7 +22,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import string, sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(n=4): diff --git a/examples/python/magic_square_and_cards.py b/examples/python/magic_square_and_cards.py index eeb3be87a3..a36746341a 100644 --- a/examples/python/magic_square_and_cards.py +++ b/examples/python/magic_square_and_cards.py @@ -28,7 +28,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import string, sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(n=3): diff --git a/examples/python/magic_square_mip.py b/examples/python/magic_square_mip.py index 13dcf42f8b..8b08683fe2 100644 --- a/examples/python/magic_square_mip.py +++ b/examples/python/magic_square_mip.py @@ -42,7 +42,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp # # main(n, use_output_matrix) diff --git a/examples/python/map.py b/examples/python/map.py index 43045d56c7..b444852667 100644 --- a/examples/python/map.py +++ b/examples/python/map.py @@ -33,7 +33,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/marathon2.py b/examples/python/marathon2.py index 3c94ba0216..9eb0a6dfaa 100644 --- a/examples/python/marathon2.py +++ b/examples/python/marathon2.py @@ -48,7 +48,7 @@ """ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/max_flow_taha.py b/examples/python/max_flow_taha.py index 7803406930..2440646503 100644 --- a/examples/python/max_flow_taha.py +++ b/examples/python/max_flow_taha.py @@ -28,7 +28,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/max_flow_winston1.py b/examples/python/max_flow_winston1.py index 6e7c4bf2c5..54da7735a1 100644 --- a/examples/python/max_flow_winston1.py +++ b/examples/python/max_flow_winston1.py @@ -28,7 +28,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/minesweeper.py b/examples/python/minesweeper.py index 8d2bb23237..3570c5ae04 100644 --- a/examples/python/minesweeper.py +++ b/examples/python/minesweeper.py @@ -63,7 +63,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp default_r = 8 default_c = 8 diff --git a/examples/python/mr_smith.py b/examples/python/mr_smith.py index 4abebdd8ba..3fe6548272 100644 --- a/examples/python/mr_smith.py +++ b/examples/python/mr_smith.py @@ -48,7 +48,7 @@ """ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/nonogram_default_search.py b/examples/python/nonogram_default_search.py index 363b814323..3e59007f02 100644 --- a/examples/python/nonogram_default_search.py +++ b/examples/python/nonogram_default_search.py @@ -43,7 +43,7 @@ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # diff --git a/examples/python/nonogram_regular.py b/examples/python/nonogram_regular.py index bf63e32fd3..1dc2353ac5 100644 --- a/examples/python/nonogram_regular.py +++ b/examples/python/nonogram_regular.py @@ -67,7 +67,7 @@ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # diff --git a/examples/python/nonogram_table.py b/examples/python/nonogram_table.py index 2adda7997f..ca2381ac16 100644 --- a/examples/python/nonogram_table.py +++ b/examples/python/nonogram_table.py @@ -67,7 +67,7 @@ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # diff --git a/examples/python/nonogram_table2.py b/examples/python/nonogram_table2.py index 9395cb43a4..1db3495898 100644 --- a/examples/python/nonogram_table2.py +++ b/examples/python/nonogram_table2.py @@ -67,7 +67,7 @@ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # diff --git a/examples/python/nontransitive_dice.py b/examples/python/nontransitive_dice.py index 930f690035..d80dee380b 100644 --- a/examples/python/nontransitive_dice.py +++ b/examples/python/nontransitive_dice.py @@ -68,7 +68,7 @@ """ import sys import string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(m=3, n=6, minimize_val=0): diff --git a/examples/python/nqueens.py b/examples/python/nqueens.py index 84c69dd32e..fe93a961a0 100644 --- a/examples/python/nqueens.py +++ b/examples/python/nqueens.py @@ -22,7 +22,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(n=8): diff --git a/examples/python/nqueens2.py b/examples/python/nqueens2.py index 6c2dc39067..fd9a665ee7 100644 --- a/examples/python/nqueens2.py +++ b/examples/python/nqueens2.py @@ -25,7 +25,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys, string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(n=8): diff --git a/examples/python/nqueens3.py b/examples/python/nqueens3.py index 7b0c3282a1..ab5411f34e 100644 --- a/examples/python/nqueens3.py +++ b/examples/python/nqueens3.py @@ -27,7 +27,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys, string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(n=8, num_sol=0, print_sol=1): diff --git a/examples/python/nurse_rostering.py b/examples/python/nurse_rostering.py index 9203e9c00b..477e029783 100644 --- a/examples/python/nurse_rostering.py +++ b/examples/python/nurse_rostering.py @@ -29,7 +29,7 @@ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp from collections import defaultdict # diff --git a/examples/python/olympic.py b/examples/python/olympic.py index fec4027ade..f54decebcf 100644 --- a/examples/python/olympic.py +++ b/examples/python/olympic.py @@ -57,7 +57,7 @@ """ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def minus(solver, x, y, z): solver.Add(z == abs(x - y)) diff --git a/examples/python/organize_day.py b/examples/python/organize_day.py index 72521f2a99..e716256801 100644 --- a/examples/python/organize_day.py +++ b/examples/python/organize_day.py @@ -33,7 +33,7 @@ """ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # # No overlapping of tasks s1 and s2 diff --git a/examples/python/p_median.py b/examples/python/p_median.py index 89f275f9f2..11eb81b22a 100644 --- a/examples/python/p_median.py +++ b/examples/python/p_median.py @@ -35,7 +35,7 @@ """ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/pandigital_numbers.py b/examples/python/pandigital_numbers.py index f9918439ca..0c29d46e84 100644 --- a/examples/python/pandigital_numbers.py +++ b/examples/python/pandigital_numbers.py @@ -63,7 +63,7 @@ import string, sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # # converts a number (s) <-> an array of integers (t) in the specific base. diff --git a/examples/python/photo_problem.py b/examples/python/photo_problem.py index 67e4c64692..8c20598c72 100644 --- a/examples/python/photo_problem.py +++ b/examples/python/photo_problem.py @@ -49,7 +49,7 @@ import sys import string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(show_all_max=0): diff --git a/examples/python/place_number_puzzle.py b/examples/python/place_number_puzzle.py index 6350b06876..af5652fccc 100644 --- a/examples/python/place_number_puzzle.py +++ b/examples/python/place_number_puzzle.py @@ -42,7 +42,7 @@ import sys import string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/post_office_problem2.py b/examples/python/post_office_problem2.py index f443f39ac8..5824c2a62d 100644 --- a/examples/python/post_office_problem2.py +++ b/examples/python/post_office_problem2.py @@ -54,7 +54,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/production.py b/examples/python/production.py index 91e72d22c1..69964ff4a9 100644 --- a/examples/python/production.py +++ b/examples/python/production.py @@ -17,16 +17,16 @@ Production planning problem in Google or-tools. From the OPL model production.mod. - + This model was created by Hakan Kjellerstrand (hakank@bonetmail.com) Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp def main(sol = 'GLPK'): - + # Create the solver. # using GLPK @@ -65,7 +65,7 @@ def main(sol = 'GLPK'): inside = [solver.NumVar(0, 10000, 'inside[%i]' % p ) for p in range(num_products)] outside = [solver.NumVar(0, 10000, 'outside[%i]' % p ) - for p in range(num_products)] + for p in range(num_products)] # to minimize z = solver.Sum([inside_cost[p] * inside[p] + outside_cost[p] * outside[p] @@ -93,7 +93,7 @@ def main(sol = 'GLPK'): print 'outside:', outside[p].SolutionValue(), ' (ReducedCost:', outside[p].ReducedCost(), ')' print - + if __name__ == '__main__': sol = 'GLPK' @@ -102,5 +102,5 @@ if __name__ == '__main__': if sol != 'GLPK' and sol != 'CBC': print 'Solver must be either GLPK or CBC' sys.exit(1) - + main(sol) diff --git a/examples/python/pyflow_example.py b/examples/python/pyflow_example.py index 7d7f738af4..c44bfcd5a8 100644 --- a/examples/python/pyflow_example.py +++ b/examples/python/pyflow_example.py @@ -16,7 +16,7 @@ from google.apputils import app -from graph import pywrapgraph +from ortools.graph import pywrapgraph def MaxFlow(): diff --git a/examples/python/quasigroup_completion.py b/examples/python/quasigroup_completion.py index 9846bc2ec7..fb497350a1 100644 --- a/examples/python/quasigroup_completion.py +++ b/examples/python/quasigroup_completion.py @@ -51,7 +51,7 @@ """ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp default_n = 5 X = 0 diff --git a/examples/python/rabbit_pheasant.py b/examples/python/rabbit_pheasant.py index 79d71e55bf..c1300d9ba2 100644 --- a/examples/python/rabbit_pheasant.py +++ b/examples/python/rabbit_pheasant.py @@ -23,7 +23,7 @@ flavors of constraint programming interfaces. -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/regular.py b/examples/python/regular.py index d198eb1d2d..5612ab5162 100644 --- a/examples/python/regular.py +++ b/examples/python/regular.py @@ -38,7 +38,7 @@ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # diff --git a/examples/python/regular_table.py b/examples/python/regular_table.py index ca9d8499f8..122b555d7f 100644 --- a/examples/python/regular_table.py +++ b/examples/python/regular_table.py @@ -38,7 +38,7 @@ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # diff --git a/examples/python/regular_table2.py b/examples/python/regular_table2.py index 3a00c3c8cb..78c228cd94 100644 --- a/examples/python/regular_table2.py +++ b/examples/python/regular_table2.py @@ -38,7 +38,7 @@ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # diff --git a/examples/python/rogo2.py b/examples/python/rogo2.py index fdd8884350..fbf99051a9 100644 --- a/examples/python/rogo2.py +++ b/examples/python/rogo2.py @@ -46,7 +46,7 @@ """ import sys, string, re -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(problem, rows, cols, max_steps): diff --git a/examples/python/safe_cracking.py b/examples/python/safe_cracking.py index aec9243f62..a071438d08 100644 --- a/examples/python/safe_cracking.py +++ b/examples/python/safe_cracking.py @@ -45,7 +45,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/scheduling_speakers.py b/examples/python/scheduling_speakers.py index 1460212e96..faf3dd1902 100644 --- a/examples/python/scheduling_speakers.py +++ b/examples/python/scheduling_speakers.py @@ -29,7 +29,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/secret_santa.py b/examples/python/secret_santa.py index 69c38707b7..377e1b6268 100644 --- a/examples/python/secret_santa.py +++ b/examples/python/secret_santa.py @@ -60,7 +60,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/secret_santa2.py b/examples/python/secret_santa2.py index c3f01d996d..334b7cf270 100644 --- a/examples/python/secret_santa2.py +++ b/examples/python/secret_santa2.py @@ -62,7 +62,7 @@ """ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(singe=0): diff --git a/examples/python/send_more_money_any_base.py b/examples/python/send_more_money_any_base.py index 6c5a7a31af..2ba0bd4b79 100644 --- a/examples/python/send_more_money_any_base.py +++ b/examples/python/send_more_money_any_base.py @@ -44,7 +44,7 @@ import sys import string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(base=10): diff --git a/examples/python/send_most_money.py b/examples/python/send_most_money.py index df6ebf022a..43a7d3e1ec 100644 --- a/examples/python/send_most_money.py +++ b/examples/python/send_most_money.py @@ -39,7 +39,7 @@ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(MONEY=0): diff --git a/examples/python/sendmore.py b/examples/python/sendmore.py index 4afef52c8b..8dff4c9272 100644 --- a/examples/python/sendmore.py +++ b/examples/python/sendmore.py @@ -23,7 +23,7 @@ Each letter corresponds to one figure and all letters have different values. from google.apputils import app import gflags -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp FLAGS = gflags.FLAGS diff --git a/examples/python/seseman.py b/examples/python/seseman.py index 29bd4693ed..47f95d44bd 100644 --- a/examples/python/seseman.py +++ b/examples/python/seseman.py @@ -54,7 +54,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(unused_argv): # Create the solver. diff --git a/examples/python/seseman_b.py b/examples/python/seseman_b.py index 61edb20c1a..21f923f68d 100644 --- a/examples/python/seseman_b.py +++ b/examples/python/seseman_b.py @@ -56,7 +56,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(unused_argv): # Create the solver. diff --git a/examples/python/set_covering.py b/examples/python/set_covering.py index fcb9a5149a..d9d8d2f6c9 100644 --- a/examples/python/set_covering.py +++ b/examples/python/set_covering.py @@ -31,7 +31,7 @@ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(unused_argv): diff --git a/examples/python/set_covering2.py b/examples/python/set_covering2.py index acf1c4b2a5..2830d3ba6d 100644 --- a/examples/python/set_covering2.py +++ b/examples/python/set_covering2.py @@ -33,7 +33,7 @@ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(unused_argv): diff --git a/examples/python/set_covering3.py b/examples/python/set_covering3.py index edded4a1a9..ffe0423b0a 100644 --- a/examples/python/set_covering3.py +++ b/examples/python/set_covering3.py @@ -46,7 +46,7 @@ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(unused_argv): diff --git a/examples/python/set_covering4.py b/examples/python/set_covering4.py index a0db053629..909c5c8a7c 100644 --- a/examples/python/set_covering4.py +++ b/examples/python/set_covering4.py @@ -66,7 +66,7 @@ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(set_partition=1): diff --git a/examples/python/set_covering_deployment.py b/examples/python/set_covering_deployment.py index 12664f3c3f..0896a1ab40 100644 --- a/examples/python/set_covering_deployment.py +++ b/examples/python/set_covering_deployment.py @@ -39,7 +39,7 @@ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/set_covering_skiena.py b/examples/python/set_covering_skiena.py index 944b85f5b2..5723f77316 100644 --- a/examples/python/set_covering_skiena.py +++ b/examples/python/set_covering_skiena.py @@ -39,7 +39,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/set_partition.py b/examples/python/set_partition.py index 0e41ec8ff2..3e4db7fb29 100644 --- a/examples/python/set_partition.py +++ b/examples/python/set_partition.py @@ -47,7 +47,7 @@ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # diff --git a/examples/python/sicherman_dice.py b/examples/python/sicherman_dice.py index c86ea5b7af..c4fd893d9b 100644 --- a/examples/python/sicherman_dice.py +++ b/examples/python/sicherman_dice.py @@ -59,7 +59,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/simple_meeting.py b/examples/python/simple_meeting.py index 55e3c9b540..ff9134c935 100644 --- a/examples/python/simple_meeting.py +++ b/examples/python/simple_meeting.py @@ -30,7 +30,7 @@ in the meeting and a maximum of non mandatory people are also in the meeting. from google.apputils import app import gflags -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp FLAGS = gflags.FLAGS diff --git a/examples/python/ski_assignment.py b/examples/python/ski_assignment.py index 4627580ccc..9d55201ad2 100644 --- a/examples/python/ski_assignment.py +++ b/examples/python/ski_assignment.py @@ -50,7 +50,7 @@ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/stable_marriage.py b/examples/python/stable_marriage.py index ce09426eb8..eaaf51e8c0 100644 --- a/examples/python/stable_marriage.py +++ b/examples/python/stable_marriage.py @@ -40,7 +40,7 @@ import string, sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(ranks, problem_name): diff --git a/examples/python/steel.py b/examples/python/steel.py index a7a048866c..6c068804b8 100644 --- a/examples/python/steel.py +++ b/examples/python/steel.py @@ -14,7 +14,7 @@ from google.apputils import app import gflags -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp FLAGS = gflags.FLAGS diff --git a/examples/python/steel_lns.py b/examples/python/steel_lns.py index 0f13eb728b..7b6bba3367 100644 --- a/examples/python/steel_lns.py +++ b/examples/python/steel_lns.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp from google.apputils import app import gflags import random diff --git a/examples/python/stigler.py b/examples/python/stigler.py index 0aab66a729..655624ae65 100644 --- a/examples/python/stigler.py +++ b/examples/python/stigler.py @@ -118,7 +118,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp def main(sol = 'GLPK'): diff --git a/examples/python/strimko2.py b/examples/python/strimko2.py index 2f958cadec..c4ec4c8911 100644 --- a/examples/python/strimko2.py +++ b/examples/python/strimko2.py @@ -46,7 +46,7 @@ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(streams="", placed=""): diff --git a/examples/python/subset_sum.py b/examples/python/subset_sum.py index ce67f7c348..28a976535d 100644 --- a/examples/python/subset_sum.py +++ b/examples/python/subset_sum.py @@ -39,7 +39,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import string, sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def subset_sum(solver, values, total): diff --git a/examples/python/sudoku.py b/examples/python/sudoku.py index 3fcd61f59d..08ef25a81a 100644 --- a/examples/python/sudoku.py +++ b/examples/python/sudoku.py @@ -18,7 +18,7 @@ from google.apputils import app import gflags -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp FLAGS = gflags.FLAGS diff --git a/examples/python/survo_puzzle.py b/examples/python/survo_puzzle.py index 249523b77a..3543441857 100644 --- a/examples/python/survo_puzzle.py +++ b/examples/python/survo_puzzle.py @@ -60,7 +60,7 @@ """ import sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(r=0, c=0, rowsums=[], colsums=[], game=[]): diff --git a/examples/python/toNum.py b/examples/python/toNum.py index 56c6e3c9ca..19562a7038 100644 --- a/examples/python/toNum.py +++ b/examples/python/toNum.py @@ -26,7 +26,7 @@ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp # # converts a number (s) <-> an array of integers (t) in the specific base. diff --git a/examples/python/traffic_lights.py b/examples/python/traffic_lights.py index d8c6cdca9d..c876fe2ec7 100644 --- a/examples/python/traffic_lights.py +++ b/examples/python/traffic_lights.py @@ -63,7 +63,7 @@ import string, sys -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(base=10, start=1, len1=1, len2=4): diff --git a/examples/python/tsp.py b/examples/python/tsp.py index 344f73546d..f9134bb179 100644 --- a/examples/python/tsp.py +++ b/examples/python/tsp.py @@ -30,7 +30,7 @@ import random from google.apputils import app import gflags -from constraint_solver import pywraprouting +from ortools.constraint_solver import pywraprouting FLAGS = gflags.FLAGS diff --git a/examples/python/volsay.py b/examples/python/volsay.py index 9190296289..e123c0ceff 100644 --- a/examples/python/volsay.py +++ b/examples/python/volsay.py @@ -22,10 +22,10 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp def main(unused_argv): - + # Create the solver. # using GLPK @@ -65,6 +65,6 @@ def main(unused_argv): print 'objective = ', solver.ObjectiveValue() print 'Gas = ', Gas.SolutionValue(), 'ReducedCost =', Gas.ReducedCost() print 'Chloride:', Chloride.SolutionValue(), 'ReducedCost =', Chloride.ReducedCost() - + if __name__ == '__main__': main('Volsay') diff --git a/examples/python/volsay2.py b/examples/python/volsay2.py index 04e7f93f7d..90303ca55a 100644 --- a/examples/python/volsay2.py +++ b/examples/python/volsay2.py @@ -23,10 +23,10 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp def main(unused_argv): - + # Create the solver. # using GLPK @@ -42,7 +42,7 @@ def main(unused_argv): num_products = 2 Gas = 0 Chloride = 1 - + products = ['Gas', 'Chloride'] # declare variables @@ -71,6 +71,6 @@ def main(unused_argv): for i in range(num_products): print products[i], '=', production[i].SolutionValue(), print 'ReducedCost = ', production[i].ReducedCost() - + if __name__ == '__main__': main('Volsay') diff --git a/examples/python/volsay3.py b/examples/python/volsay3.py index 68a300ad43..51686e8737 100644 --- a/examples/python/volsay3.py +++ b/examples/python/volsay3.py @@ -23,7 +23,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ -from linear_solver import pywraplp +from ortools.linear_solver import pywraplp def main(unused_argv): diff --git a/examples/python/who_killed_agatha.py b/examples/python/who_killed_agatha.py index 4003b896e3..1c8b85c3b2 100644 --- a/examples/python/who_killed_agatha.py +++ b/examples/python/who_killed_agatha.py @@ -60,7 +60,7 @@ """ from collections import defaultdict -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def var_matrix_array(solver, rows, cols, lb, ub, name): x = [] diff --git a/examples/python/word_square.py b/examples/python/word_square.py index 366eabb8a3..9035570f4c 100644 --- a/examples/python/word_square.py +++ b/examples/python/word_square.py @@ -38,7 +38,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys, string, re -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(words, word_len, num_answers=20): diff --git a/examples/python/xkcd.py b/examples/python/xkcd.py index c566940872..5755bebbe0 100644 --- a/examples/python/xkcd.py +++ b/examples/python/xkcd.py @@ -36,7 +36,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_cp_solver/ """ -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(): diff --git a/examples/python/young_tableaux.py b/examples/python/young_tableaux.py index 579f057c39..36f77ea11b 100644 --- a/examples/python/young_tableaux.py +++ b/examples/python/young_tableaux.py @@ -60,7 +60,7 @@ Also see my other Google CP Solver models: http://www.hakank.org/google_or_tools/ """ import sys,string -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp def main(n = 5): diff --git a/examples/python/zebra.py b/examples/python/zebra.py index c3beade8c2..e61a7ad187 100644 --- a/examples/python/zebra.py +++ b/examples/python/zebra.py @@ -38,7 +38,7 @@ Who owns a zebra and who drinks water? from google.apputils import app import gflags -from constraint_solver import pywrapcp +from ortools.constraint_solver import pywrapcp FLAGS = gflags.FLAGS diff --git a/makefiles/Makefile.python.mk b/makefiles/Makefile.python.mk index eb48de6dc1..2c532aacc3 100644 --- a/makefiles/Makefile.python.mk +++ b/makefiles/Makefile.python.mk @@ -5,6 +5,18 @@ python: pycp pyalgorithms pygraph pylp # Clean target clean_python: + -$(DEL) $(GEN_DIR)$Sortools$Salgorithms$S*python_wrap* + -$(DEL) $(GEN_DIR)$Sortools$Sconstraint_solver$S*python_wrap* + -$(DEL) $(GEN_DIR)$Sortools$Sgraph$S*python_wrap* + -$(DEL) $(GEN_DIR)$Sortools$Slinear_solver$S*python_wrap* + -$(DEL) $(GEN_DIR)$Sortools$Salgorithms$S*.py + -$(DEL) $(GEN_DIR)$Sortools$Sconstraint_solver$S*.py + -$(DEL) $(GEN_DIR)$Sortools$Sgraph$S*.py + -$(DEL) $(GEN_DIR)$Sortools$Slinear_solver$S*.py + -$(DEL) $(GEN_DIR)$Sortools$Salgorithms$S*.pyc + -$(DEL) $(GEN_DIR)$Sortools$Sconstraint_solver$S*.pyc + -$(DEL) $(GEN_DIR)$Sortools$Sgraph$S*.pyc + -$(DEL) $(GEN_DIR)$Sortools$Slinear_solver$S*.pyc -$(DEL) $(GEN_DIR)$Salgorithms$S*python_wrap* -$(DEL) $(GEN_DIR)$Sconstraint_solver$S*python_wrap* -$(DEL) $(GEN_DIR)$Sgraph$S*python_wrap* @@ -21,89 +33,89 @@ clean_python: -$(DEL) $(OBJ_DIR)$S*python_wrap.$O # pywrapknapsack_solver -pyalgorithms: $(LIB_DIR)/_pywrapknapsack_solver.$(DYNAMIC_SWIG_LIB_SUFFIX) $(GEN_DIR)/algorithms/pywrapknapsack_solver.py +pyalgorithms: $(LIB_DIR)/_pywrapknapsack_solver.$(DYNAMIC_SWIG_LIB_SUFFIX) $(GEN_DIR)/ortools/algorithms/pywrapknapsack_solver.py -$(GEN_DIR)/algorithms/pywrapknapsack_solver.py: $(SRC_DIR)/algorithms/knapsack_solver.swig $(SRC_DIR)/algorithms/knapsack_solver.h $(SRC_DIR)/base/base.swig $(SRC_DIR)/util/data.swig - $(SWIG_BINARY) -I$(INC_DIR) -c++ -python -o $(GEN_DIR)$Salgorithms$Sknapsack_solver_python_wrap.cc -module pywrapknapsack_solver $(SRC_DIR)/algorithms$Sknapsack_solver.swig +$(GEN_DIR)/ortools/algorithms/pywrapknapsack_solver.py: $(SRC_DIR)/algorithms/knapsack_solver.swig $(SRC_DIR)/algorithms/knapsack_solver.h $(SRC_DIR)/base/base.swig $(SRC_DIR)/util/data.swig + $(SWIG_BINARY) -I$(INC_DIR) -c++ -python -o $(GEN_DIR)$Sortools$Salgorithms$Sknapsack_solver_python_wrap.cc -module pywrapknapsack_solver $(SRC_DIR)/algorithms$Sknapsack_solver.swig -$(GEN_DIR)/algorithms/knapsack_solver_python_wrap.cc: $(GEN_DIR)/algorithms/pywrapknapsack_solver.py +$(GEN_DIR)/ortools/algorithms/knapsack_solver_python_wrap.cc: $(GEN_DIR)/ortools/algorithms/pywrapknapsack_solver.py -$(OBJ_DIR)/knapsack_solver_python_wrap.$O: $(GEN_DIR)/algorithms/knapsack_solver_python_wrap.cc - $(CCC) $(CFLAGS) $(PYTHON_INC) -c $(GEN_DIR)$Salgorithms$Sknapsack_solver_python_wrap.cc $(OBJ_OUT)$(OBJ_DIR)$Sknapsack_solver_python_wrap.$O +$(OBJ_DIR)/knapsack_solver_python_wrap.$O: $(GEN_DIR)/ortools/algorithms/knapsack_solver_python_wrap.cc + $(CCC) $(CFLAGS) $(PYTHON_INC) -c $(GEN_DIR)$Sortools$Salgorithms$Sknapsack_solver_python_wrap.cc $(OBJ_OUT)$(OBJ_DIR)$Sknapsack_solver_python_wrap.$O $(LIB_DIR)/_pywrapknapsack_solver.$(DYNAMIC_SWIG_LIB_SUFFIX): $(OBJ_DIR)/knapsack_solver_python_wrap.$O $(STATIC_ALGORITHMS_LIBS) $(STATIC_LP_LIBS) $(STATIC_BASE_LIBS) $(DYNAMIC_LD) $(LDOUT)$(LIB_DIR)$S_pywrapknapsack_solver.$(DYNAMIC_SWIG_LIB_SUFFIX) $(OBJ_DIR)$Sknapsack_solver_python_wrap.$O $(STATIC_ALGORITHMS_LNK) $(STATIC_LD_FLAGS) $(PYTHON_LNK) ifeq "$(SYSTEM)" "win" - copy $(LIB_DIR)\\_pywrapknapsack_solver.dll $(GEN_DIR)\\algorithms\\_pywrapknapsack_solver.pyd + copy $(LIB_DIR)\\_pywrapknapsack_solver.dll $(PY_GEN_DIR)\\algorithms\\_pywrapknapsack_solver.pyd endif # pywrapgraph -pygraph: $(LIB_DIR)/_pywrapgraph.$(DYNAMIC_SWIG_LIB_SUFFIX) $(GEN_DIR)/graph/pywrapgraph.py +pygraph: $(LIB_DIR)/_pywrapgraph.$(DYNAMIC_SWIG_LIB_SUFFIX) $(GEN_DIR)/ortools/graph/pywrapgraph.py -$(GEN_DIR)/graph/pywrapgraph.py: $(SRC_DIR)/graph/graph.swig $(SRC_DIR)/graph/min_cost_flow.h $(SRC_DIR)/graph/max_flow.h $(SRC_DIR)/graph/ebert_graph.h $(SRC_DIR)/base/base.swig - $(SWIG_BINARY) -I$(INC_DIR) -c++ -python -o $(GEN_DIR)$Sgraph$Spywrapgraph_python_wrap.cc -module pywrapgraph $(SRC_DIR)/graph$Sgraph.swig +$(GEN_DIR)/ortools/graph/pywrapgraph.py: $(SRC_DIR)/graph/graph.swig $(SRC_DIR)/graph/min_cost_flow.h $(SRC_DIR)/graph/max_flow.h $(SRC_DIR)/graph/ebert_graph.h $(SRC_DIR)/base/base.swig + $(SWIG_BINARY) -I$(INC_DIR) -c++ -python -o $(GEN_DIR)$Sortools$Sgraph$Spywrapgraph_python_wrap.cc -module pywrapgraph $(SRC_DIR)/graph$Sgraph.swig -$(GEN_DIR)/graph/pywrapgraph_python_wrap.cc: $(GEN_DIR)/graph/pywrapgraph.py +$(GEN_DIR)/ortools/graph/pywrapgraph_python_wrap.cc: $(GEN_DIR)/ortools/graph/pywrapgraph.py -$(OBJ_DIR)/pywrapgraph_python_wrap.$O: $(GEN_DIR)/graph/pywrapgraph_python_wrap.cc - $(CCC) $(CFLAGS) $(PYTHON_INC) -c $(GEN_DIR)/graph/pywrapgraph_python_wrap.cc $(OBJ_OUT)$(OBJ_DIR)$Spywrapgraph_python_wrap.$O +$(OBJ_DIR)/pywrapgraph_python_wrap.$O: $(GEN_DIR)/ortools/graph/pywrapgraph_python_wrap.cc + $(CCC) $(CFLAGS) $(PYTHON_INC) -c $(GEN_DIR)/ortools/graph/pywrapgraph_python_wrap.cc $(OBJ_OUT)$(OBJ_DIR)$Spywrapgraph_python_wrap.$O $(LIB_DIR)/_pywrapgraph.$(DYNAMIC_SWIG_LIB_SUFFIX): $(OBJ_DIR)/pywrapgraph_python_wrap.$O $(STATIC_GRAPH_DEPS) $(DYNAMIC_LD) $(LDOUT)$(LIB_DIR)$S_pywrapgraph.$(DYNAMIC_SWIG_LIB_SUFFIX) $(OBJ_DIR)$Spywrapgraph_python_wrap.$O $(STATIC_GRAPH_LNK) $(STATIC_LD_FLAGS) $(PYTHON_LNK) ifeq "$(SYSTEM)" "win" - copy $(LIB_DIR)\\_pywrapgraph.dll $(GEN_DIR)\\graph\\_pywrapgraph.pyd + copy $(LIB_DIR)\\_pywrapgraph.dll $(PY_GEN_DIR)\\graph\\_pywrapgraph.pyd endif # pywrapcp -pycp: $(LIB_DIR)/_pywrapcp.$(DYNAMIC_SWIG_LIB_SUFFIX) $(GEN_DIR)/constraint_solver/pywrapcp.py $(LIB_DIR)/_pywraprouting.$(DYNAMIC_SWIG_LIB_SUFFIX) $(GEN_DIR)/constraint_solver/pywraprouting.py +pycp: $(LIB_DIR)/_pywrapcp.$(DYNAMIC_SWIG_LIB_SUFFIX) $(GEN_DIR)/ortools/constraint_solver/pywrapcp.py $(LIB_DIR)/_pywraprouting.$(DYNAMIC_SWIG_LIB_SUFFIX) $(GEN_DIR)/ortools/constraint_solver/pywraprouting.py -$(GEN_DIR)/constraint_solver/pywrapcp.py: $(SRC_DIR)/constraint_solver/constraint_solver.swig $(SRC_DIR)/constraint_solver/constraint_solver.h $(SRC_DIR)/constraint_solver/constraint_solveri.h $(SRC_DIR)/base/base.swig - $(SWIG_BINARY) -I$(INC_DIR) -c++ -python -o $(GEN_DIR)$Sconstraint_solver$Sconstraint_solver_python_wrap.cc -module pywrapcp $(SRC_DIR)/constraint_solver$Sconstraint_solver.swig +$(GEN_DIR)/ortools/constraint_solver/pywrapcp.py: $(SRC_DIR)/constraint_solver/constraint_solver.swig $(SRC_DIR)/constraint_solver/constraint_solver.h $(SRC_DIR)/constraint_solver/constraint_solveri.h $(SRC_DIR)/base/base.swig + $(SWIG_BINARY) -I$(INC_DIR) -c++ -python -o $(GEN_DIR)$Sortools$Sconstraint_solver$Sconstraint_solver_python_wrap.cc -module pywrapcp $(SRC_DIR)/constraint_solver$Sconstraint_solver.swig -$(GEN_DIR)/constraint_solver/constraint_solver_python_wrap.cc: $(GEN_DIR)/constraint_solver/pywrapcp.py +$(GEN_DIR)/ortools/constraint_solver/constraint_solver_python_wrap.cc: $(GEN_DIR)/ortools/constraint_solver/pywrapcp.py -$(OBJ_DIR)/constraint_solver_python_wrap.$O: $(GEN_DIR)/constraint_solver/constraint_solver_python_wrap.cc - $(CCC) $(CFLAGS) $(PYTHON_INC) -c $(GEN_DIR)$Sconstraint_solver$Sconstraint_solver_python_wrap.cc $(OBJ_OUT)$(OBJ_DIR)$Sconstraint_solver_python_wrap.$O +$(OBJ_DIR)/constraint_solver_python_wrap.$O: $(GEN_DIR)/ortools/constraint_solver/constraint_solver_python_wrap.cc + $(CCC) $(CFLAGS) $(PYTHON_INC) -c $(GEN_DIR)$Sortools$Sconstraint_solver$Sconstraint_solver_python_wrap.cc $(OBJ_OUT)$(OBJ_DIR)$Sconstraint_solver_python_wrap.$O $(LIB_DIR)/_pywrapcp.$(DYNAMIC_SWIG_LIB_SUFFIX): $(OBJ_DIR)/constraint_solver_python_wrap.$O $(STATIC_CP_DEPS) $(DYNAMIC_LD) $(LDOUT)$(LIB_DIR)$S_pywrapcp.$(DYNAMIC_SWIG_LIB_SUFFIX) $(OBJ_DIR)$Sconstraint_solver_python_wrap.$O $(STATIC_CP_LNK) $(STATIC_LD_FLAGS) $(PYTHON_LNK) ifeq "$(SYSTEM)" "win" - copy $(LIB_DIR)\\_pywrapcp.dll $(GEN_DIR)\\constraint_solver\\_pywrapcp.pyd + copy $(LIB_DIR)\\_pywrapcp.dll $(PY_GEN_DIR)\\constraint_solver\\_pywrapcp.pyd endif # pywraprouting -$(GEN_DIR)/constraint_solver/pywraprouting.py: $(SRC_DIR)/constraint_solver/routing.swig $(SRC_DIR)/constraint_solver/constraint_solver.h $(SRC_DIR)/constraint_solver/constraint_solveri.h $(SRC_DIR)/constraint_solver/routing.h $(SRC_DIR)/base/base.swig - $(SWIG_BINARY) -I$(INC_DIR) -c++ -python -o $(GEN_DIR)$Sconstraint_solver$Srouting_python_wrap.cc -module pywraprouting $(SRC_DIR)/constraint_solver$Srouting.swig +$(GEN_DIR)/ortools/constraint_solver/pywraprouting.py: $(SRC_DIR)/constraint_solver/routing.swig $(SRC_DIR)/constraint_solver/constraint_solver.h $(SRC_DIR)/constraint_solver/constraint_solveri.h $(SRC_DIR)/constraint_solver/routing.h $(SRC_DIR)/base/base.swig + $(SWIG_BINARY) -I$(INC_DIR) -c++ -python -o $(GEN_DIR)$Sortools$Sconstraint_solver$Srouting_python_wrap.cc -module pywraprouting $(SRC_DIR)/constraint_solver$Srouting.swig -$(GEN_DIR)/constraint_solver/routing_python_wrap.cc: $(GEN_DIR)/constraint_solver/pywraprouting.py +$(GEN_DIR)/ortools/constraint_solver/routing_python_wrap.cc: $(GEN_DIR)/ortools/constraint_solver/pywraprouting.py -$(OBJ_DIR)/routing_python_wrap.$O: $(GEN_DIR)/constraint_solver/routing_python_wrap.cc - $(CCC) $(CFLAGS) $(PYTHON_INC) -c $(GEN_DIR)/constraint_solver/routing_python_wrap.cc $(OBJ_OUT)$(OBJ_DIR)$Srouting_python_wrap.$O +$(OBJ_DIR)/routing_python_wrap.$O: $(GEN_DIR)/ortools/constraint_solver/routing_python_wrap.cc + $(CCC) $(CFLAGS) $(PYTHON_INC) -c $(GEN_DIR)/ortools/constraint_solver/routing_python_wrap.cc $(OBJ_OUT)$(OBJ_DIR)$Srouting_python_wrap.$O $(LIB_DIR)/_pywraprouting.$(DYNAMIC_SWIG_LIB_SUFFIX): $(OBJ_DIR)/routing_python_wrap.$O $(STATIC_ROUTING_DEPS) $(DYNAMIC_LD) $(LDOUT)$(LIB_DIR)$S_pywraprouting.$(DYNAMIC_SWIG_LIB_SUFFIX) $(OBJ_DIR)$Srouting_python_wrap.$O $(STATIC_ROUTING_LNK) $(STATIC_LD_FLAGS) $(PYTHON_LNK) ifeq "$(SYSTEM)" "win" - copy $(LIB_DIR)\\_pywraprouting.dll $(GEN_DIR)\\constraint_solver\\_pywraprouting.pyd + copy $(LIB_DIR)\\_pywraprouting.dll $(PY_GEN_DIR)\\constraint_solver\\_pywraprouting.pyd endif # pywraplp -pylp: $(LIB_DIR)/_pywraplp.$(DYNAMIC_SWIG_LIB_SUFFIX) $(GEN_DIR)/linear_solver/pywraplp.py +pylp: $(LIB_DIR)/_pywraplp.$(DYNAMIC_SWIG_LIB_SUFFIX) $(GEN_DIR)/ortools/linear_solver/pywraplp.py -$(GEN_DIR)/linear_solver/pywraplp.py: $(SRC_DIR)/linear_solver/linear_solver.swig $(SRC_DIR)/linear_solver/linear_solver.h $(SRC_DIR)/base/base.swig $(GEN_DIR)/linear_solver/linear_solver2.pb.h - $(SWIG_BINARY) $(SWIG_INC) -I$(INC_DIR) -c++ -python -o $(GEN_DIR)$Slinear_solver$Slinear_solver_python_wrap.cc -module pywraplp $(SRC_DIR)/linear_solver$Slinear_solver.swig +$(GEN_DIR)/ortools/linear_solver/pywraplp.py: $(SRC_DIR)/linear_solver/linear_solver.swig $(SRC_DIR)/linear_solver/linear_solver.h $(SRC_DIR)/base/base.swig $(GEN_DIR)/linear_solver/linear_solver2.pb.h + $(SWIG_BINARY) $(SWIG_INC) -I$(INC_DIR) -c++ -python -o $(GEN_DIR)$Sortools$Slinear_solver$Slinear_solver_python_wrap.cc -module pywraplp $(SRC_DIR)/linear_solver$Slinear_solver.swig -$(GEN_DIR)/linear_solver/linear_solver_python_wrap.cc: $(GEN_DIR)/linear_solver/pywraplp.py +$(GEN_DIR)/ortools/linear_solver/linear_solver_python_wrap.cc: $(GEN_DIR)/ortools/linear_solver/pywraplp.py -$(OBJ_DIR)/linear_solver_python_wrap.$O: $(GEN_DIR)/linear_solver/linear_solver_python_wrap.cc - $(CCC) $(CFLAGS) $(PYTHON_INC) -c $(GEN_DIR)$Slinear_solver$Slinear_solver_python_wrap.cc $(OBJ_OUT)$(OBJ_DIR)$Slinear_solver_python_wrap.$O +$(OBJ_DIR)/linear_solver_python_wrap.$O: $(GEN_DIR)/ortools/linear_solver/linear_solver_python_wrap.cc + $(CCC) $(CFLAGS) $(PYTHON_INC) -c $(GEN_DIR)$Sortools$Slinear_solver$Slinear_solver_python_wrap.cc $(OBJ_OUT)$(OBJ_DIR)$Slinear_solver_python_wrap.$O $(LIB_DIR)/_pywraplp.$(DYNAMIC_SWIG_LIB_SUFFIX): $(OBJ_DIR)/linear_solver_python_wrap.$O $(STATIC_LP_DEPS) $(DYNAMIC_LD) $(LDOUT)$(LIB_DIR)$S_pywraplp.$(DYNAMIC_SWIG_LIB_SUFFIX) $(OBJ_DIR)$Slinear_solver_python_wrap.$O $(STATIC_LP_LNK) $(STATIC_LD_FLAGS) $(PYTHON_LNK) ifeq "$(SYSTEM)" "win" - copy $(LIB_DIR)\\_pywraplp.dll $(GEN_DIR)\\linear_solver\\_pywraplp.pyd + copy $(LIB_DIR)\\_pywraplp.dll $(PY_GEN_DIR)\\linear_solver\\_pywraplp.pyd endif # Run a single example @@ -126,39 +138,41 @@ python_archive: python $(MKDIR) temp$Sor-tools.$(PORT) $(MKDIR) temp$Sor-tools.$(PORT)$Sexamples $(MKDIR) temp$Sor-tools.$(PORT)$Sdata - $(MKDIR) temp$Sor-tools.$(PORT)$Sconstraint_solver - $(MKDIR) temp$Sor-tools.$(PORT)$Slinear_solver - $(MKDIR) temp$Sor-tools.$(PORT)$Sgraph - $(MKDIR) temp$Sor-tools.$(PORT)$Salgorithms - $(COPY) src$Sgen$Sconstraint_solver$Spywrapcp.py temp$Sor-tools.$(PORT)$Sconstraint_solver - $(COPY) src$Sgen$Sconstraint_solver$Spywraprouting.py temp$Sor-tools.$(PORT)$Sconstraint_solver - $(COPY) src$Sgen$Slinear_solver$Spywraplp.py temp$Sor-tools.$(PORT)$Slinear_solver - $(COPY) src$Sgen$Sgraph$Spywrapgraph.py temp$Sor-tools.$(PORT)$Sgraph - $(COPY) src$Sgen$Salgorithms$Spywrapknapsack_solver.py temp$Sor-tools.$(PORT)$Salgorithms + $(MKDIR) temp$Sor-tools.$(PORT)$Sortools + $(MKDIR) temp$Sor-tools.$(PORT)$Sortools$Sconstraint_solver + $(MKDIR) temp$Sor-tools.$(PORT)$Sortools$Slinear_solver + $(MKDIR) temp$Sor-tools.$(PORT)$Sortools$Sgraph + $(MKDIR) temp$Sor-tools.$(PORT)$Sortools$Salgorithms + $(COPY) src$Sgen$Sortools$Sconstraint_solver$Spywrapcp.py temp$Sor-tools.$(PORT)$Sortools$Sconstraint_solver + $(COPY) src$Sgen$Sortools$Sconstraint_solver$Spywraprouting.py temp$Sor-tools.$(PORT)$Sortools$Sconstraint_solver + $(COPY) src$Sgen$Sortools$Slinear_solver$Spywraplp.py temp$Sor-tools.$(PORT)$Sortools$Slinear_solver + $(COPY) src$Sgen$Sortools$Sgraph$Spywrapgraph.py temp$Sor-tools.$(PORT)$Sortools$Sgraph + $(COPY) src$Sgen$Sortools$Salgorithms$Spywrapknapsack_solver.py temp$Sor-tools.$(PORT)$Sortools$Salgorithms $(COPY) examples$Spython$S*.py temp$Sor-tools.$(PORT)$Sexamples - $(TOUCH) temp$Sor-tools.$(PORT)$Sconstraint_solver$S__init__.py - $(TOUCH) temp$Sor-tools.$(PORT)$Slinear_solver$S__init__.py - $(TOUCH) temp$Sor-tools.$(PORT)$Sgraph$S__init__.py - $(TOUCH) temp$Sor-tools.$(PORT)$Salgorithms$S__init__.py + $(TOUCH) temp$Sor-tools.$(PORT)$Sortools$S__init__.py + $(TOUCH) temp$Sor-tools.$(PORT)$Sortools$Sconstraint_solver$S__init__.py + $(TOUCH) temp$Sor-tools.$(PORT)$Sortools$Slinear_solver$S__init__.py + $(TOUCH) temp$Sor-tools.$(PORT)$Sortools$Sgraph$S__init__.py + $(TOUCH) temp$Sor-tools.$(PORT)$Sortools$Salgorithms$S__init__.py $(COPY) tools$SREADME.python temp$Sor-tools.$(PORT)$SREADME $(COPY) tools$Ssetup.py temp$Sor-tools.$(PORT) $(SED) -i -e 's/VVVV/$(shell svnversion)/' temp$Sor-tools.$(PORT)$Ssetup.py ifeq ($(SYSTEM),win) - copy src\gen\constraint_solver\_pywrapcp.pyd temp$Sor-tools.$(PORT)$Sconstraint_solver - copy src\gen\constraint_solver\_pywraprouting.pyd temp$Sor-tools.$(PORT)$Sconstraint_solver - copy src\gen\linear_solver\_pywraplp.pyd temp$Sor-tools.$(PORT)$Slinear_solver - copy src\gen\graph\_pywrapgraph.pyd temp$Sor-tools.$(PORT)$Sgraph - copy src\gen\algorithms\_pywrapknapsack_solver.pyd temp$Sor-tools.$(PORT)$Salgorithms + copy src\gen\ortools\constraint_solver\_pywrapcp.pyd temp$Sor-tools.$(PORT)$Sortools$Sconstraint_solver + copy src\gen\ortools\constraint_solver\_pywraprouting.pyd temp$Sor-tools.$(PORT)$Sortools$Sconstraint_solver + copy src\gen\ortools\linear_solver\_pywraplp.pyd temp$Sor-tools.$(PORT)$Sortools$Slinear_solver + copy src\gen\ortools\graph\_pywrapgraph.pyd temp$Sor-tools.$(PORT)$Sortools$Sgraph + copy src\gen\ortools\algorithms\_pywrapknapsack_solver.pyd temp$Sor-tools.$(PORT)$Sortools$Salgorithms $(SED) -i -e 's/\.dll/\.pyd/' temp/or-tools.$(PORT)/setup.py -del temp\or-tools.$(PORT)\setup.py-e cd temp\or-tools.$(PORT) && ..\..\tools\tar.exe -C ..\.. -c -v --exclude *svn* --exclude *roadef* data | ..\..\tools\tar.exe xvm cd temp && ..\tools\zip.exe -r ..\Google.OrTools.python.$(PORT).$(SVNVERSION).zip or-tools.$(PORT) else - cp lib$S_pywrapcp.$(DYNAMIC_SWIG_LIB_SUFFIX) temp$Sor-tools.$(PORT)$Sconstraint_solver - cp lib$S_pywraprouting.$(DYNAMIC_SWIG_LIB_SUFFIX) temp$Sor-tools.$(PORT)$Sconstraint_solver - cp lib$S_pywraplp.$(DYNAMIC_SWIG_LIB_SUFFIX) temp$Sor-tools.$(PORT)$Slinear_solver - cp lib$S_pywrapgraph.$(DYNAMIC_SWIG_LIB_SUFFIX) temp$Sor-tools.$(PORT)$Sgraph - cp lib$S_pywrapknapsack_solver.$(DYNAMIC_SWIG_LIB_SUFFIX) temp$Sor-tools.$(PORT)$Salgorithms + cp lib$S_pywrapcp.$(DYNAMIC_SWIG_LIB_SUFFIX) temp$Sor-tools.$(PORT)$Sortools$Sconstraint_solver + cp lib$S_pywraprouting.$(DYNAMIC_SWIG_LIB_SUFFIX) temp$Sor-tools.$(PORT)$Sortools$Sconstraint_solver + cp lib$S_pywraplp.$(DYNAMIC_SWIG_LIB_SUFFIX) temp$Sor-tools.$(PORT)$Sortools$Slinear_solver + cp lib$S_pywrapgraph.$(DYNAMIC_SWIG_LIB_SUFFIX) temp$Sor-tools.$(PORT)$Sortools$Sgraph + cp lib$S_pywrapknapsack_solver.$(DYNAMIC_SWIG_LIB_SUFFIX) temp$Sor-tools.$(PORT)$Sortools$Salgorithms $(SED) -i -e 's/\.dll/\.so/' temp/or-tools.$(PORT)/setup.py -rm temp/or-tools.$(PORT)/setup.py-e cd temp/or-tools.$(PORT) && tar -C ../.. -c -v --exclude *svn* --exclude *roadef* data | tar xvm diff --git a/src/algorithms/__init__.py b/src/algorithms/__init__.py index c2bce5b4ab..4a3e5f3bca 100644 --- a/src/algorithms/__init__.py +++ b/src/algorithms/__init__.py @@ -1,3 +1,3 @@ import os as _os -__path__.append(_os.path.join(__path__[0], '../gen/algorithms')) +__path__.append(_os.path.join(__path__[0], '../gen/ortools/algorithms')) __path__.append(_os.path.join(__path__[0], '../../lib')) diff --git a/src/constraint_solver/__init__.py b/src/constraint_solver/__init__.py index 82d7d79d88..4f485039ee 100644 --- a/src/constraint_solver/__init__.py +++ b/src/constraint_solver/__init__.py @@ -1,3 +1,3 @@ import os as _os -__path__.append(_os.path.join(__path__[0], '../gen/constraint_solver')) +__path__.append(_os.path.join(__path__[0], '../gen/ortools/constraint_solver')) __path__.append(_os.path.join(__path__[0], '../../lib')) diff --git a/src/graph/__init__.py b/src/graph/__init__.py index 4aab696e7a..5ef670ab87 100644 --- a/src/graph/__init__.py +++ b/src/graph/__init__.py @@ -1,3 +1,3 @@ import os as _os -__path__.append(_os.path.join(__path__[0], '../gen/graph')) +__path__.append(_os.path.join(__path__[0], '../gen/ortools/graph')) __path__.append(_os.path.join(__path__[0], '../../lib')) diff --git a/src/linear_solver/__init__.py b/src/linear_solver/__init__.py index d1be8c0b25..b7ae67b29e 100644 --- a/src/linear_solver/__init__.py +++ b/src/linear_solver/__init__.py @@ -1,3 +1,3 @@ import os as _os -__path__.append(_os.path.join(__path__[0], '../gen/linear_solver')) +__path__.append(_os.path.join(__path__[0], '../gen/ortools/linear_solver')) __path__.append(_os.path.join(__path__[0], '../../lib')) diff --git a/src/ortools/__init__.py b/src/ortools/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/ortools/algorithms/__init__.py b/src/ortools/algorithms/__init__.py new file mode 100644 index 0000000000..adfe472141 --- /dev/null +++ b/src/ortools/algorithms/__init__.py @@ -0,0 +1,3 @@ +import os as _os +__path__.append(_os.path.join(__path__[0], '../../gen/ortools/algorithms')) +__path__.append(_os.path.join(__path__[0], '../../../lib')) diff --git a/src/ortools/constraint_solver/__init__.py b/src/ortools/constraint_solver/__init__.py new file mode 100644 index 0000000000..ab8c5a1e15 --- /dev/null +++ b/src/ortools/constraint_solver/__init__.py @@ -0,0 +1,3 @@ +import os as _os +__path__.append(_os.path.join(__path__[0], '../../gen/ortools/constraint_solver')) +__path__.append(_os.path.join(__path__[0], '../../../lib')) diff --git a/src/ortools/graph/__init__.py b/src/ortools/graph/__init__.py new file mode 100644 index 0000000000..d3a17f655b --- /dev/null +++ b/src/ortools/graph/__init__.py @@ -0,0 +1,3 @@ +import os as _os +__path__.append(_os.path.join(__path__[0], '../../gen/ortools/graph')) +__path__.append(_os.path.join(__path__[0], '../../../lib')) diff --git a/src/ortools/linear_solver/__init__.py b/src/ortools/linear_solver/__init__.py new file mode 100644 index 0000000000..8846f4883f --- /dev/null +++ b/src/ortools/linear_solver/__init__.py @@ -0,0 +1,3 @@ +import os as _os +__path__.append(_os.path.join(__path__[0], '../../gen/ortools/linear_solver')) +__path__.append(_os.path.join(__path__[0], '../../../lib')) diff --git a/tools/setup.py b/tools/setup.py index b8dfe4cb7e..0af2849d36 100644 --- a/tools/setup.py +++ b/tools/setup.py @@ -4,22 +4,23 @@ from os.path import join as pjoin setup( name='or-tools', version='1.0.VVVV', - packages=[ 'constraint_solver', - 'linear_solver', - 'graph', - 'algorithms' + packages=[ 'ortools', + 'ortools.constraint_solver', + 'ortools.linear_solver', + 'ortools.graph', + 'ortools.algorithms' ], install_requires = ['google-apputils >= 0.3'], dependency_links = ['http://google-apputils-python.googlecode.com/files/'], - data_files=[('constraint_solver', - [pjoin('constraint_solver', '_pywrapcp.dll'), - pjoin('constraint_solver', '_pywraprouting.dll')]), - ('linear_solver', - [pjoin('linear_solver', '_pywraplp.dll'), ]), - ('graph', - [pjoin('graph', '_pywrapgraph.dll'), ]), - ('algorithms', - [pjoin('algorithms', '_pywrapknapsack_solver.dll'), ]), + data_files=[(pjoin('ortools', 'constraint_solver'), + [pjoin('ortools', 'constraint_solver', '_pywrapcp.dll'), + pjoin('ortools', 'constraint_solver', '_pywraprouting.dll')]), + (pjoin('ortools', 'linear_solver'), + [pjoin('ortools', 'linear_solver', '_pywraplp.dll'), ]), + (pjoin('ortools', 'graph'), + [pjoin('ortools', 'graph', '_pywrapgraph.dll'), ]), + (pjoin('ortools', 'algorithms'), + [pjoin('ortools', 'algorithms', '_pywrapknapsack_solver.dll'), ]), ], license='Apache 2.0', author = "Google Inc",