From 3b00b323ba753e556dbb764bac14eb6266ebf8ff Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Thu, 26 Oct 2023 10:33:09 +0200 Subject: [PATCH] notebook: regenerate them --- .../examples/prize_collecting_vrp.ipynb | 2 +- .../linear_solver/assignment_groups_mip.ipynb | 1 + .../linear_solver/assignment_mip.ipynb | 1 + .../assignment_task_sizes_mip.ipynb | 1 + .../linear_solver/assignment_teams_mip.ipynb | 1 + .../linear_solver/basic_example.ipynb | 1 + .../linear_solver/bin_packing_mip.ipynb | 1 + .../linear_solver/clone_model_mb.ipynb | 150 ++++++++++++++++++ .../integer_programming_example.ipynb | 29 +++- .../linear_programming_example.ipynb | 11 +- .../linear_solver/mip_var_array.ipynb | 7 +- .../linear_solver/multiple_knapsack_mip.ipynb | 1 + .../linear_solver/simple_lp_program.ipynb | 4 +- .../linear_solver/simple_mip_program.ipynb | 6 +- .../notebook/linear_solver/stigler_diet.ipynb | 5 +- examples/notebook/sat/assignment_sat.ipynb | 4 +- examples/notebook/sat/bin_packing_sat.ipynb | 8 +- ...sat.ipynb => clone_model_sample_sat.ipynb} | 18 +-- ...mulative_variable_profile_sample_sat.ipynb | 4 +- 19 files changed, 216 insertions(+), 39 deletions(-) create mode 100644 examples/notebook/linear_solver/clone_model_mb.ipynb rename examples/notebook/sat/{copy_model_sample_sat.ipynb => clone_model_sample_sat.ipynb} (83%) diff --git a/examples/notebook/examples/prize_collecting_vrp.ipynb b/examples/notebook/examples/prize_collecting_vrp.ipynb index 89a351e58e..9d2199ef03 100644 --- a/examples/notebook/examples/prize_collecting_vrp.ipynb +++ b/examples/notebook/examples/prize_collecting_vrp.ipynb @@ -161,7 +161,7 @@ " plan_output += f' {node} ->'\n", " previous_index = index\n", " index = assignment.Value(routing.NextVar(index))\n", - " route_distance += routing.GetArcCostForVehicle(previous_index, index, 0)\n", + " route_distance += routing.GetArcCostForVehicle(previous_index, index, v)\n", " plan_output += f' {manager.IndexToNode(index)}\\n'\n", " plan_output += f'Distance of the route: {route_distance}m\\n'\n", " plan_output += f'Value collected: {value_collected}\\n'\n", diff --git a/examples/notebook/linear_solver/assignment_groups_mip.ipynb b/examples/notebook/linear_solver/assignment_groups_mip.ipynb index e04ff6f0e9..38966588ee 100644 --- a/examples/notebook/linear_solver/assignment_groups_mip.ipynb +++ b/examples/notebook/linear_solver/assignment_groups_mip.ipynb @@ -210,6 +210,7 @@ " solver.Minimize(solver.Sum(objective_terms))\n", "\n", " # Solve\n", + " print(f\"Solving with {solver.SolverVersion()}\")\n", " status = solver.Solve()\n", "\n", " # Print solution.\n", diff --git a/examples/notebook/linear_solver/assignment_mip.ipynb b/examples/notebook/linear_solver/assignment_mip.ipynb index 308eae6630..6540ed8f04 100644 --- a/examples/notebook/linear_solver/assignment_mip.ipynb +++ b/examples/notebook/linear_solver/assignment_mip.ipynb @@ -130,6 +130,7 @@ " solver.Minimize(solver.Sum(objective_terms))\n", "\n", " # Solve\n", + " print(f\"Solving with {solver.SolverVersion()}\")\n", " status = solver.Solve()\n", "\n", " # Print solution.\n", diff --git a/examples/notebook/linear_solver/assignment_task_sizes_mip.ipynb b/examples/notebook/linear_solver/assignment_task_sizes_mip.ipynb index 0154be66a1..2b1f0b69f0 100644 --- a/examples/notebook/linear_solver/assignment_task_sizes_mip.ipynb +++ b/examples/notebook/linear_solver/assignment_task_sizes_mip.ipynb @@ -144,6 +144,7 @@ " solver.Minimize(solver.Sum(objective_terms))\n", "\n", " # Solve\n", + " print(f\"Solving with {solver.SolverVersion()}\")\n", " status = solver.Solve()\n", "\n", " # Print solution.\n", diff --git a/examples/notebook/linear_solver/assignment_teams_mip.ipynb b/examples/notebook/linear_solver/assignment_teams_mip.ipynb index 1a33ca98e6..75911a8447 100644 --- a/examples/notebook/linear_solver/assignment_teams_mip.ipynb +++ b/examples/notebook/linear_solver/assignment_teams_mip.ipynb @@ -148,6 +148,7 @@ " solver.Minimize(solver.Sum(objective_terms))\n", "\n", " # Solve\n", + " print(f\"Solving with {solver.SolverVersion()}\")\n", " status = solver.Solve()\n", "\n", " # Print solution.\n", diff --git a/examples/notebook/linear_solver/basic_example.ipynb b/examples/notebook/linear_solver/basic_example.ipynb index b1300d2578..97cc416ab3 100644 --- a/examples/notebook/linear_solver/basic_example.ipynb +++ b/examples/notebook/linear_solver/basic_example.ipynb @@ -111,6 +111,7 @@ " objective.SetCoefficient(y, 1)\n", " objective.SetMaximization()\n", "\n", + " print(f\"Solving with {solver.SolverVersion()}\")\n", " solver.Solve()\n", "\n", " print(\"Solution:\")\n", diff --git a/examples/notebook/linear_solver/bin_packing_mip.ipynb b/examples/notebook/linear_solver/bin_packing_mip.ipynb index 9b0bb03284..1b43da8711 100644 --- a/examples/notebook/linear_solver/bin_packing_mip.ipynb +++ b/examples/notebook/linear_solver/bin_packing_mip.ipynb @@ -134,6 +134,7 @@ " # Objective: minimize the number of bins used.\n", " solver.Minimize(solver.Sum([y[j] for j in data[\"bins\"]]))\n", "\n", + " print(f\"Solving with {solver.SolverVersion()}\")\n", " status = solver.Solve()\n", "\n", " if status == pywraplp.Solver.OPTIMAL:\n", diff --git a/examples/notebook/linear_solver/clone_model_mb.ipynb b/examples/notebook/linear_solver/clone_model_mb.ipynb new file mode 100644 index 0000000000..25b390123d --- /dev/null +++ b/examples/notebook/linear_solver/clone_model_mb.ipynb @@ -0,0 +1,150 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "google", + "metadata": {}, + "source": [ + "##### Copyright 2023 Google LLC." + ] + }, + { + "cell_type": "markdown", + "id": "apache", + "metadata": {}, + "source": [ + "Licensed under the Apache License, Version 2.0 (the \"License\");\n", + "you may not use this file except in compliance with the License.\n", + "You may obtain a copy of the License at\n", + "\n", + " http://www.apache.org/licenses/LICENSE-2.0\n", + "\n", + "Unless required by applicable law or agreed to in writing, software\n", + "distributed under the License is distributed on an \"AS IS\" BASIS,\n", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", + "See the License for the specific language governing permissions and\n", + "limitations under the License.\n" + ] + }, + { + "cell_type": "markdown", + "id": "basename", + "metadata": {}, + "source": [ + "# clone_model_mb" + ] + }, + { + "cell_type": "markdown", + "id": "link", + "metadata": {}, + "source": [ + "\n", + "\n", + "\n", + "
\n", + "Run in Google Colab\n", + "\n", + "View source on GitHub\n", + "
" + ] + }, + { + "cell_type": "markdown", + "id": "doc", + "metadata": {}, + "source": [ + "First, you must install [ortools](https://pypi.org/project/ortools/) package in this colab." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "install", + "metadata": {}, + "outputs": [], + "source": [ + "%pip install ortools" + ] + }, + { + "cell_type": "markdown", + "id": "description", + "metadata": {}, + "source": [ + "\n", + "Integer programming examples that show how to clone a model." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "code", + "metadata": {}, + "outputs": [], + "source": [ + "import math\n", + "\n", + "from ortools.linear_solver.python import model_builder\n", + "\n", + "\n", + "def main():\n", + " # Create the model.\n", + " model = model_builder.ModelBuilder()\n", + "\n", + " # x and y are integer non-negative variables.\n", + " x = model.new_int_var(0.0, math.inf, \"x\")\n", + " y = model.new_int_var(0.0, math.inf, \"y\")\n", + "\n", + " # x + 7 * y <= 17.5.\n", + " unused_c1 = model.add(x + 7 * y <= 17.5)\n", + "\n", + " # x <= 3.5.\n", + " c2 = model.add(x <= 3.5)\n", + "\n", + " # Maximize x + 10 * y.\n", + " model.maximize(x + 10 * y)\n", + "\n", + " # [Start clone]\n", + " # Clone the model.\n", + " print(\"Cloning the model.\")\n", + " model_copy = model.clone()\n", + " x_copy = model_copy.var_from_index(x.index)\n", + " y_copy = model_copy.var_from_index(y.index)\n", + " z_copy = model_copy.new_bool_var(\"z\")\n", + " c2_copy = model_copy.linear_constraint_from_index(c2.index)\n", + "\n", + " # Add new constraint.\n", + " model_copy.add(x_copy >= 1)\n", + " print(f\"Number of constraints in original model ={model.num_constraints}\")\n", + " print(f\"Number of constraints in cloned model = {model_copy.num_constraints}\")\n", + "\n", + " # Modify a constraint.\n", + " c2_copy.add_term(z_copy, 2.0)\n", + "\n", + " # Create the solver with the SCIP backend, and solve the model.\n", + " solver = model_builder.ModelSolver(\"scip\")\n", + " status = solver.solve(model_copy)\n", + "\n", + " if status == model_builder.SolveStatus.OPTIMAL:\n", + " print(\"Solution:\")\n", + " print(f\"Objective value = {solver.objective_value}\")\n", + " print(f\"x = {solver.value(x_copy)}\")\n", + " print(f\"y = {solver.value(y_copy)}\")\n", + " print(f\"z = {solver.value(z_copy)}\")\n", + " else:\n", + " print(\"The problem does not have an optimal solution.\")\n", + "\n", + " print(\"\\nAdvanced usage:\")\n", + " print(f\"Problem solved in {solver.wall_time} seconds\")\n", + "\n", + "\n", + "main()\n", + "\n" + ] + } + ], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/examples/notebook/linear_solver/integer_programming_example.ipynb b/examples/notebook/linear_solver/integer_programming_example.ipynb index df91003c3b..8db2b7c336 100644 --- a/examples/notebook/linear_solver/integer_programming_example.ipynb +++ b/examples/notebook/linear_solver/integer_programming_example.ipynb @@ -98,6 +98,8 @@ " y = solver.IntVar(0.0, solver.infinity(), \"y\")\n", " z = solver.IntVar(0.0, solver.infinity(), \"z\")\n", "\n", + " print(\"Number of variables =\", solver.NumVariables())\n", + "\n", " # 2*x + 7*y + 3*z <= 50\n", " constraint0 = solver.Constraint(-solver.infinity(), 50)\n", " constraint0.SetCoefficient(x, 2)\n", @@ -116,6 +118,8 @@ " constraint2.SetCoefficient(y, 2)\n", " constraint2.SetCoefficient(z, -6)\n", "\n", + " print(\"Number of constraints =\", solver.NumConstraints())\n", + "\n", " # Maximize 2*x + 2*y + 3*z\n", " objective = solver.Objective()\n", " objective.SetCoefficient(x, 2)\n", @@ -123,14 +127,23 @@ " objective.SetCoefficient(z, 3)\n", " objective.SetMaximization()\n", "\n", - " # Solve the problem and print the solution.\n", - " solver.Solve()\n", - " # Print the objective value of the solution.\n", - " print(\"Maximum objective function value = %d\" % solver.Objective().Value())\n", - " print()\n", - " # Print the value of each variable in the solution.\n", - " for variable in [x, y, z]:\n", - " print(\"%s = %d\" % (variable.name(), variable.solution_value()))\n", + " # Solve the problem.\n", + " print(f\"Solving with {solver.SolverVersion()}\")\n", + " status = solver.Solve()\n", + "\n", + " # Print the solution.\n", + " if status == pywraplp.Solver.OPTIMAL:\n", + " print(\"Solution:\")\n", + " print(f\"Objective value = {solver.Objective().Value()}\")\n", + " # Print the value of each variable in the solution.\n", + " for variable in [x, y, z]:\n", + " print(f\"{variable.name()} = {variable.solution_value()}\")\n", + " else:\n", + " print(\"The problem does not have an optimal solution.\")\n", + "\n", + " print(\"\\nAdvanced usage:\")\n", + " print(f\"Problem solved in {solver.wall_time():d} milliseconds\")\n", + " print(f\"Problem solved in {solver.iterations():d} iterations\")\n", "\n", "\n", "IntegerProgrammingExample()\n", diff --git a/examples/notebook/linear_solver/linear_programming_example.ipynb b/examples/notebook/linear_solver/linear_programming_example.ipynb index 9d119dd563..00cb97c3b8 100644 --- a/examples/notebook/linear_solver/linear_programming_example.ipynb +++ b/examples/notebook/linear_solver/linear_programming_example.ipynb @@ -114,19 +114,20 @@ " solver.Maximize(3 * x + 4 * y)\n", "\n", " # Solve the system.\n", + " print(f\"Solving with {solver.SolverVersion()}\")\n", " status = solver.Solve()\n", "\n", " if status == pywraplp.Solver.OPTIMAL:\n", " print(\"Solution:\")\n", - " print(\"Objective value =\", solver.Objective().Value())\n", - " print(\"x =\", x.solution_value())\n", - " print(\"y =\", y.solution_value())\n", + " print(f\"Objective value = {solver.Objective().Value():0.1f}\")\n", + " print(f\"x = {x.solution_value():0.1f}\")\n", + " print(f\"y = {y.solution_value():0.1f}\")\n", " else:\n", " print(\"The problem does not have an optimal solution.\")\n", "\n", " print(\"\\nAdvanced usage:\")\n", - " print(\"Problem solved in %f milliseconds\" % solver.wall_time())\n", - " print(\"Problem solved in %d iterations\" % solver.iterations())\n", + " print(f\"Problem solved in {solver.wall_time():d} milliseconds\")\n", + " print(f\"Problem solved in {solver.iterations():d} iterations\")\n", "\n", "\n", "LinearProgrammingExample()\n", diff --git a/examples/notebook/linear_solver/mip_var_array.ipynb b/examples/notebook/linear_solver/mip_var_array.ipynb index fd7f770628..c20c57d456 100644 --- a/examples/notebook/linear_solver/mip_var_array.ipynb +++ b/examples/notebook/linear_solver/mip_var_array.ipynb @@ -135,6 +135,7 @@ " # obj_expr = [data['obj_coeffs'][j] * x[j] for j in range(data['num_vars'])]\n", " # solver.Maximize(solver.Sum(obj_expr))\n", "\n", + " print(f\"Solving with {solver.SolverVersion()}\")\n", " status = solver.Solve()\n", "\n", " if status == pywraplp.Solver.OPTIMAL:\n", @@ -142,9 +143,9 @@ " for j in range(data[\"num_vars\"]):\n", " print(x[j].name(), \" = \", x[j].solution_value())\n", " print()\n", - " print(\"Problem solved in %f milliseconds\" % solver.wall_time())\n", - " print(\"Problem solved in %d iterations\" % solver.iterations())\n", - " print(\"Problem solved in %d branch-and-bound nodes\" % solver.nodes())\n", + " print(f\"Problem solved in {solver.wall_time():d} milliseconds\")\n", + " print(f\"Problem solved in {solver.iterations():d} iterations\")\n", + " print(f\"Problem solved in {solver.nodes():d} branch-and-bound nodes\")\n", " else:\n", " print(\"The problem does not have an optimal solution.\")\n", "\n", diff --git a/examples/notebook/linear_solver/multiple_knapsack_mip.ipynb b/examples/notebook/linear_solver/multiple_knapsack_mip.ipynb index 29fb8200e2..dd829b3a21 100644 --- a/examples/notebook/linear_solver/multiple_knapsack_mip.ipynb +++ b/examples/notebook/linear_solver/multiple_knapsack_mip.ipynb @@ -131,6 +131,7 @@ " objective.SetCoefficient(x[i, b], data[\"values\"][i])\n", " objective.SetMaximization()\n", "\n", + " print(f\"Solving with {solver.SolverVersion()}\")\n", " status = solver.Solve()\n", "\n", " if status == pywraplp.Solver.OPTIMAL:\n", diff --git a/examples/notebook/linear_solver/simple_lp_program.ipynb b/examples/notebook/linear_solver/simple_lp_program.ipynb index 5bf4580a25..3094e7382e 100644 --- a/examples/notebook/linear_solver/simple_lp_program.ipynb +++ b/examples/notebook/linear_solver/simple_lp_program.ipynb @@ -122,8 +122,8 @@ " print(\"The problem does not have an optimal solution.\")\n", "\n", " print(\"\\nAdvanced usage:\")\n", - " print(\"Problem solved in %f milliseconds\" % solver.wall_time())\n", - " print(\"Problem solved in %d iterations\" % solver.iterations())\n", + " print(f\"Problem solved in {solver.wall_time():d} milliseconds\")\n", + " print(f\"Problem solved in {solver.iterations():d} iterations\")\n", "\n", "\n", "main()\n", diff --git a/examples/notebook/linear_solver/simple_mip_program.ipynb b/examples/notebook/linear_solver/simple_mip_program.ipynb index c3235b3176..8529c64c2d 100644 --- a/examples/notebook/linear_solver/simple_mip_program.ipynb +++ b/examples/notebook/linear_solver/simple_mip_program.ipynb @@ -122,9 +122,9 @@ " print(\"The problem does not have an optimal solution.\")\n", "\n", " print(\"\\nAdvanced usage:\")\n", - " print(\"Problem solved in %f milliseconds\" % solver.wall_time())\n", - " print(\"Problem solved in %d iterations\" % solver.iterations())\n", - " print(\"Problem solved in %d branch-and-bound nodes\" % solver.nodes())\n", + " print(f\"Problem solved in {solver.wall_time():d} milliseconds\")\n", + " print(f\"Problem solved in {solver.iterations():d} iterations\")\n", + " print(f\"Problem solved in {solver.nodes():d} branch-and-bound nodes\")\n", "\n", "\n", "main()\n", diff --git a/examples/notebook/linear_solver/stigler_diet.ipynb b/examples/notebook/linear_solver/stigler_diet.ipynb index 6b742806b5..7acaf3b707 100644 --- a/examples/notebook/linear_solver/stigler_diet.ipynb +++ b/examples/notebook/linear_solver/stigler_diet.ipynb @@ -215,6 +215,7 @@ " objective.SetCoefficient(food, 1)\n", " objective.SetMinimization()\n", "\n", + " print(f\"Solving with {solver.SolverVersion()}\")\n", " status = solver.Solve()\n", "\n", " # Check that the problem has an optimal solution.\n", @@ -243,8 +244,8 @@ " )\n", "\n", " print(\"\\nAdvanced usage:\")\n", - " print(\"Problem solved in \", solver.wall_time(), \" milliseconds\")\n", - " print(\"Problem solved in \", solver.iterations(), \" iterations\")\n", + " print(f\"Problem solved in {solver.wall_time():d} milliseconds\")\n", + " print(f\"Problem solved in {solver.iterations():d} iterations\")\n", "\n", "\n", "main()\n", diff --git a/examples/notebook/sat/assignment_sat.ipynb b/examples/notebook/sat/assignment_sat.ipynb index aadb1e4d6e..87a7fad908 100644 --- a/examples/notebook/sat/assignment_sat.ipynb +++ b/examples/notebook/sat/assignment_sat.ipynb @@ -146,8 +146,10 @@ " selected = data.loc[solver.BooleanValues(x).loc[lambda x: x].index]\n", " for unused_index, row in selected.iterrows():\n", " print(f\"{row.task} assigned to {row.worker} with a cost of {row.cost}\")\n", + " elif status == cp_model.INFEASIBLE:\n", + " print(\"No solution found\")\n", " else:\n", - " print(\"No solution found.\")\n", + " print(\"Something is wrong, check the status and the log of the solve\")\n", "\n", "\n", "main()\n", diff --git a/examples/notebook/sat/bin_packing_sat.ipynb b/examples/notebook/sat/bin_packing_sat.ipynb index d27da43644..2b8642ef4c 100644 --- a/examples/notebook/sat/bin_packing_sat.ipynb +++ b/examples/notebook/sat/bin_packing_sat.ipynb @@ -156,11 +156,11 @@ " # Objective: minimize the number of bins used.\n", " model.Minimize(y.sum())\n", "\n", - " # Create the solver with the CP-SAT backend, and solve the model.\n", + " # Create the solver and solve the model.\n", " solver = cp_model.CpSolver()\n", " status = solver.Solve(model)\n", "\n", - " if status == cp_model.OPTIMAL:\n", + " if status == cp_model.OPTIMAL or status == cp_model.FEASIBLE:\n", " print(f\"Number of bins used = {solver.ObjectiveValue()}\")\n", "\n", " x_values = solver.BooleanValues(x)\n", @@ -178,8 +178,10 @@ " print(f\"Total packed weight: {items.weight.sum()}\")\n", " print()\n", " print(f\"Time = {solver.WallTime()} seconds\")\n", + " elif status == cp_model.INFEASIBLE:\n", + " print(\"No solution found\")\n", " else:\n", - " print(\"The problem does not have an optimal solution.\")\n", + " print(\"Something is wrong, check the status and the log of the solve\")\n", "\n", "\n", "main()\n", diff --git a/examples/notebook/sat/copy_model_sample_sat.ipynb b/examples/notebook/sat/clone_model_sample_sat.ipynb similarity index 83% rename from examples/notebook/sat/copy_model_sample_sat.ipynb rename to examples/notebook/sat/clone_model_sample_sat.ipynb index ce0b47079c..06e98df05a 100644 --- a/examples/notebook/sat/copy_model_sample_sat.ipynb +++ b/examples/notebook/sat/clone_model_sample_sat.ipynb @@ -31,7 +31,7 @@ "id": "basename", "metadata": {}, "source": [ - "# copy_model_sample_sat" + "# clone_model_sample_sat" ] }, { @@ -41,10 +41,10 @@ "source": [ "\n", "\n", "\n", "
\n", - "Run in Google Colab\n", + "Run in Google Colab\n", "\n", - "View source on GitHub\n", + "View source on GitHub\n", "
" ] @@ -86,8 +86,8 @@ "from ortools.sat.python import cp_model\n", "\n", "\n", - "def CopyModelSat():\n", - " \"\"\"Showcases printing intermediate solutions found during search.\"\"\"\n", + "def CloneModelSampleSat():\n", + " \"\"\"Showcases cloning a model.\"\"\"\n", " # Creates the model.\n", " model = cp_model.CpModel()\n", "\n", @@ -109,21 +109,21 @@ " if status == cp_model.OPTIMAL:\n", " print(\"Optimal value of the original model: {}\".format(solver.ObjectiveValue()))\n", "\n", - " # Copy the model.\n", - " copy = cp_model.CpModel()\n", - " copy.CopyFrom(model)\n", + " # Clone the model.\n", + " copy = model.Clone()\n", "\n", " copy_x = copy.GetIntVarFromProtoIndex(x.Index())\n", " copy_y = copy.GetIntVarFromProtoIndex(y.Index())\n", "\n", " copy.Add(copy_x + copy_y <= 1)\n", + "\n", " status = solver.Solve(copy)\n", "\n", " if status == cp_model.OPTIMAL:\n", " print(\"Optimal value of the modified model: {}\".format(solver.ObjectiveValue()))\n", "\n", "\n", - "CopyModelSat()\n", + "CloneModelSampleSat()\n", "\n" ] } diff --git a/examples/notebook/sat/cumulative_variable_profile_sample_sat.ipynb b/examples/notebook/sat/cumulative_variable_profile_sample_sat.ipynb index 5ccd62e979..43c1601e5f 100644 --- a/examples/notebook/sat/cumulative_variable_profile_sample_sat.ipynb +++ b/examples/notebook/sat/cumulative_variable_profile_sample_sat.ipynb @@ -174,7 +174,7 @@ " index=tasks_df.index,\n", " starts=starts,\n", " sizes=tasks_df.duration,\n", - " performed_literals=performed,\n", + " are_present=performed,\n", " )\n", "\n", " # Set up the profile. We use fixed (intervals, demands) to fill in the space\n", @@ -215,7 +215,7 @@ " else:\n", " print(f\"task {task} is not performed\")\n", " elif status == cp_model.INFEASIBLE:\n", - " print(\"The problem is infeasible\")\n", + " print(\"No solution found\")\n", " else:\n", " print(\"Something is wrong, check the status and the log of the solve\")\n", "\n",