Source code for discrete_optimization.generic_tasks_tools.solvers.cpsat.objectives.allocated_tasks

#  Copyright (c) 2026 AIRBUS and its affiliates.
#  This source code is licensed under the MIT license found in the
#  LICENSE file in the root directory of this source tree.

from ortools.sat.python.cp_model import LinearExpr

from discrete_optimization.generic_tasks_tools.solvers.cpsat.objectives.objective_modeler import (
    ObjectiveModelerCpSat,
)


[docs] class AllocatedTasksObjectiveCpSatModeler(ObjectiveModelerCpSat):
[docs] def get_objective_expr(self) -> LinearExpr: self.solver.create_task_allocated_variables() return self.solver.get_nb_tasks_allocated_variable()