discrete_optimization.generic_tasks_tools.objectives package

Submodules

discrete_optimization.generic_tasks_tools.objectives.allocated_tasks module

class discrete_optimization.generic_tasks_tools.objectives.allocated_tasks.AllocatedTasksObjective(problem: TasksProblem[Task] = None, weight_objective: float = 1.0)[source]

Bases: ObjectiveComputer[Task], Generic[Task, UnaryResource]

compute_objective(solution: AllocationSolution[Task, UnaryResource])[source]
static get_objective_name() → Objective | str[source]
problem: AllocationProblem[Task, UnaryResource]

discrete_optimization.generic_tasks_tools.objectives.allocation_changes module

class discrete_optimization.generic_tasks_tools.objectives.allocation_changes.AllocationSwitchObjectiveComputer(problem: AllocationProblem[Task, UnaryResource], base_allocation_solution: AllocationSolution[Task, UnaryResource] = None, weight_objective: float = 1.0, switch_on_cost: dict[Task, dict[UnaryResource, int]] = None, switch_off_cost: dict[Task, dict[UnaryResource, int]] = None)[source]

Bases: ObjectiveComputer[Task], Generic[Task, UnaryResource]

base_allocation_solution: AllocationSolution[Task, UnaryResource]
compute_objective(solution: AllocationSolution[Task, UnaryResource]) → float[source]
static get_objective_name() → Objective | str[source]
get_switch_off_cost(task: Task, unary_resource: UnaryResource) → int[source]
get_switch_on_cost(task: Task, unary_resource: UnaryResource) → int[source]
has_switch_off_cost()[source]
has_switch_on_cost()[source]
has_switches_cost()[source]
problem: AllocationProblem[Task, UnaryResource]
set_base_allocation_solution(allocation_solution: AllocationSolution[Task, UnaryResource])[source]

discrete_optimization.generic_tasks_tools.objectives.allocation_cost module

class discrete_optimization.generic_tasks_tools.objectives.allocation_cost.AllocationCostComputer(problem: AllocationProblem[Task, UnaryResource] = None, weight_objective: float = 1.0, cost_allocation_resource_to_task: dict[Task, dict[UnaryResource, int]] = None)[source]

Bases: ObjectiveComputer[Task], Generic[Task, UnaryResource]

compute_objective(solution: AllocationSolution[Task, UnaryResource]) → float[source]
cost_allocation_resource_to_task(task: Task, unary_resource: UnaryResource) → float[source]
static get_objective_name() → Objective | str[source]
has_any_cost_allocation()[source]
problem: AllocationProblem[Task, UnaryResource]
class discrete_optimization.generic_tasks_tools.objectives.allocation_cost.AllocationCostComputerMultimode(problem: MultimodeAllocationProblem[Task, UnaryResource] = None, weight_objective: float = 1.0, cost_allocation_resource_to_task_mode: dict[tuple[Task, int], dict[UnaryResource, int]] = None)[source]

Bases: ObjectiveComputer[Task], Generic[Task, UnaryResource]

compute_objective(solution: MultimodeAllocationSolution[Task, UnaryResource]) → float[source]
cost_allocation_resource_to_task_mode(task: Task, mode: int, unary_resource: UnaryResource) → float[source]
static get_objective_name() → Objective | str[source]
get_tasks_having_cost()[source]
has_any_cost_allocation()[source]
problem: MultimodeAllocationProblem[Task, UnaryResource]
class discrete_optimization.generic_tasks_tools.objectives.allocation_cost.MultimodeAllocationProblem[source]

Bases: AllocationProblem[Task, UnaryResource], MultimodeProblem[Task]

class discrete_optimization.generic_tasks_tools.objectives.allocation_cost.MultimodeAllocationSolution(problem: Problem)[source]

Bases: AllocationSolution[Task, UnaryResource], MultimodeSolution[Task]

discrete_optimization.generic_tasks_tools.objectives.cumul_cost module

class discrete_optimization.generic_tasks_tools.objectives.cumul_cost.CumulCostComputer(problem: GenericSchedulingProblem[Task, UnaryResource, Skill, NonSkillCumulativeResource, NonRenewableResource] = None, weight_objective: float = 1.0, cumul_dimensions: list[CUMUL_DIMENSIONS] = None, value_tasks: dict[CUMUL_DIMENSIONS, dict[Task, float]] = None, value_tasks_per_mode: dict[CUMUL_DIMENSIONS, dict[tuple[Task, int], float]] = None)[source]

Bases: ObjectiveComputer[Task], Generic[Task, UnaryResource, Skill, NonSkillCumulativeResource, NonRenewableResource]

compute_objective(solution: GenericSchedulingSolution[Task, UnaryResource, Skill, NonSkillCumulativeResource, NonRenewableResource]) → float[source]
depends_on_mode(dimension: CUMUL_DIMENSIONS, task: Task)[source]
static get_objective_name() → Objective | str[source]
get_value_dimension_task_mode(dimension: CUMUL_DIMENSIONS, task: Task, mode: int)[source]
problem: GenericSchedulingProblem[Task, UnaryResource, Skill, NonSkillCumulativeResource, NonRenewableResource]

discrete_optimization.generic_tasks_tools.objectives.earliness_tardiness module

class discrete_optimization.generic_tasks_tools.objectives.earliness_tardiness.EarlinessTardinessComputer(problem: SchedulingProblem[Task], weight_objective: float = 1.0, max_start_and_weight_for_tardiness: dict[Task, tuple[int | None, int | None]] = None, max_end_and_weight_for_tardiness: dict[Task, tuple[int | None, int | None]] = None, min_start_and_weight_for_earliness: dict[Task, tuple[int | None, int | None]] = None, min_end_and_weight_for_earliness: dict[Task, tuple[int | None, int | None]] = None)[source]

Bases: ObjectiveComputer[Task]

compute_aggregated_cost(solution: SchedulingSolution[Task]) → float[source]
compute_earliness_cost(solution: SchedulingSolution[Task]) → float[source]
compute_earliness_end(solution: SchedulingSolution[Task], task: Task) → float[source]
compute_earliness_start(solution: SchedulingSolution[Task], task: Task) → float[source]
compute_objective(solution: TasksSolution) → float[source]
compute_tardiness_cost(solution: SchedulingSolution[Task]) → float[source]
compute_tardiness_end(solution: SchedulingSolution[Task], task: Task) → float[source]
compute_tardiness_start(solution: SchedulingSolution[Task], task: Task) → float[source]
detailed_objectives(solution: SchedulingSolution[Task]) → dict[tuple[str, str], dict[Task, int]][source]
get_max_end_for_tardiness(task: Task) → int[source]
get_max_start_for_tardiness(task: Task) → int | None[source]
get_min_end_for_earliness(task: Task) → int[source]
get_min_start_for_earliness(task: Task) → int[source]
static get_objective_name() → Objective | str[source]
get_tasks_having_max_end_for_tardiness() → list[Task][source]
get_tasks_having_max_start_for_tardiness() → list[Task][source]
get_tasks_having_min_end_for_earliness() → list[Task][source]
get_tasks_having_min_start_for_earliness() → list[Task][source]
get_weight_end_for_earliness(task: Task) → float[source]
get_weight_end_for_tardiness(task: Task) → float[source]
get_weight_start_for_earliness(task: Task) → float[source]
get_weight_start_for_tardiness(task: Task) → float[source]
problem: SchedulingProblem[Task]

discrete_optimization.generic_tasks_tools.objectives.makespan module

class discrete_optimization.generic_tasks_tools.objectives.makespan.MakespanObjectiveComputer(problem: TasksProblem[Task] = None, weight_objective: float = 1.0)[source]

Bases: ObjectiveComputer[Task]

compute_objective(solution: SchedulingSolution[Task]) → int[source]
static get_objective_name() → Objective | str[source]
problem: SchedulingProblem[Task]

discrete_optimization.generic_tasks_tools.objectives.mode_cost module

class discrete_optimization.generic_tasks_tools.objectives.mode_cost.ModeCostComputer(problem: MultimodeProblem[Task] = None, weight_objective: float = 1.0, mode_cost: dict[Task, dict[int, int]] = None)[source]

Bases: ObjectiveComputer[Task]

compute_objective(solution: MultimodeSolution[Task]) → float[source]
static get_objective_name() → Objective | str[source]
has_any_mode_cost()[source]
mode_cost(task: Task, mode: int) → float[source]
problem: MultimodeProblem[Task]

discrete_optimization.generic_tasks_tools.objectives.objective_computer module

class discrete_optimization.generic_tasks_tools.objectives.objective_computer.ObjectiveComputer(problem: TasksProblem[Task] = None, weight_objective: float = 1.0)[source]

Bases: ABC, Generic[Task]

abstractmethod compute_objective(solution: TasksSolution) → float[source]
static get_objective_name() → Objective | str[source]
problem: TasksProblem[Task]
set_problem(problem: TasksProblem[Task])[source]
property weight_cost: float

discrete_optimization.generic_tasks_tools.objectives.resource_levels module

class discrete_optimization.generic_tasks_tools.objectives.resource_levels.CalendarRenewableResourceLevelObjectiveComputer(problem: CalendarResourceProblem[Task, Resource], weight_objective: float = 1.0, weight_resource: dict[Resource, float] = None)[source]

Bases: ObjectiveComputer[Task], Generic[Task, Resource]

compute_objective(solution: CalendarResourceSolution[Task, Resource]) → float[source]
static get_objective_name() → Objective | str[source]
get_weight_resource(resource: Resource) → float[source]
has_any_weight()[source]
problem: CalendarResourceProblem[Task, Resource]
class discrete_optimization.generic_tasks_tools.objectives.resource_levels.NonRenewableResourceLevelObjectiveComputer(problem: NonRenewableResourceProblem[Task, Resource], weight_objective: float = 1.0, weight_resource: dict[Resource, float] = None)[source]

Bases: ObjectiveComputer[Task], Generic[Task, NonRenewableResource]

compute_objective(solution: NonRenewableResourceSolution[Task, NonRenewableResource]) → float[source]
static get_objective_name() → Objective | str[source]
get_weight_resource(resource: Resource) → float[source]
has_any_weight()[source]
problem: NonRenewableResourceProblem[Task, NonRenewableResource]

discrete_optimization.generic_tasks_tools.objectives.schedule_changes module

class discrete_optimization.generic_tasks_tools.objectives.schedule_changes.ScheduleChangesComputer(problem: SchedulingProblem[Task], base_scheduling_solution: SchedulingSolution[Task], weight_objective: float = 1.0, cost_any_shift: dict[Task, float] = None, cost_unit_deviation: dict[Task, float] = None)[source]

Bases: ObjectiveComputer[Task]

base_scheduling_solution: SchedulingSolution[Task]
compute_any_shift_cost(solution: SchedulingSolution[Task]) → float[source]
compute_objective(solution: TasksSolution) → float[source]
compute_unit_deviation_cost(solution: SchedulingSolution[Task]) → float[source]
cost_any_shift(task: Task) → int[source]

Cost of any move of the task (whatever deviation) :param task: task of the scheduling problem :return: the cost of any move of the task

cost_unit_deviation(task: Task) → int[source]

Cost of shifting one unit of time so the total cost will be : unit*abs(new_time-prev_time)

static get_objective_name() → Objective | str[source]
has_any_shift_cost()[source]
has_any_unit_deviation_cost()[source]
problem: SchedulingProblem[Task]
tasks_with_any_shift_cost()[source]
tasks_with_unit_deviation_cost()[source]

discrete_optimization.generic_tasks_tools.objectives.scheduled_tasks module

class discrete_optimization.generic_tasks_tools.objectives.scheduled_tasks.ScheduledTasksComputer(problem: SchedulingProblem[Task], weight_objective: float = 1.0, weight_per_task: dict[Task, int] | None = None)[source]

Bases: ObjectiveComputer[Task], Generic[Task]

compute_objective(solution: SchedulingSolution[Task]) → float[source]
static get_objective_name() → Objective | str[source]
problem: SchedulingProblem[Task]

discrete_optimization.generic_tasks_tools.objectives.soft_time_penalty module

class discrete_optimization.generic_tasks_tools.objectives.soft_time_penalty.SoftTimePenaltyComputer(problem: TasksProblem[Task] = None, weight_objective: float = 1.0)[source]

Bases: ObjectiveComputer[Task], Generic[Task, UnaryResource, Skill, NonSkillCumulativeResource, NonRenewableResource]

compute_objective(solution: GenericSchedulingSolution[Task, UnaryResource, Skill, NonSkillCumulativeResource, NonRenewableResource]) → float[source]
static get_objective_name() → Objective[source]
penalty = 0
problem: GenericSchedulingProblem[Task, UnaryResource, Skill, NonSkillCumulativeResource, NonRenewableResource]

discrete_optimization.generic_tasks_tools.objectives.unary_resource_used module

class discrete_optimization.generic_tasks_tools.objectives.unary_resource_used.UnaryResourcesUsedComputer(problem: AllocationProblem[Task, UnaryResource] = None, weight_objective: float = 1.0, weight_per_unary_resource: dict[UnaryResource, float] = None)[source]

Bases: ObjectiveComputer[Task], Generic[Task, UnaryResource]

compute_objective(solution: AllocationSolution[Task, UnaryResource])[source]
static get_objective_name() → Objective | str[source]
get_weight_per_unary_resource(ur: UnaryResource) → float[source]
has_cost_on_unary_resource() → bool[source]
problem: AllocationProblem[Task, UnaryResource]

discrete_optimization.generic_tasks_tools.objectives.utils module

discrete_optimization.generic_tasks_tools.objectives.utils.get_mapping()[source]
discrete_optimization.generic_tasks_tools.objectives.utils.get_objective_computer_class(objective: Objective) → Type[ObjectiveComputer][source]

Module contents