pyscheduling.PMSP.RmSijkCmax#

Module Contents#

Classes#

RmSijkCmax_Instance

Helper class that provides a standard way to create an ABC using

CSP

ExactSolvers

ListHeuristic

Helper class that provides a standard way to create an ABC using

Attributes#

DOCPLEX_IMPORTED

pyscheduling.PMSP.RmSijkCmax.DOCPLEX_IMPORTED#
class pyscheduling.PMSP.RmSijkCmax.RmSijkCmax_Instance(n: int, m: int, name: str = 'Unknown', **kwargs)#

Bases: pyscheduling.PMSP.ParallelMachines.ParallelInstance

Helper class that provides a standard way to create an ABC using inheritance.

P :List[List[int]]#
S :List[List[List[int]]]#
constraints :ClassVar[List[pyscheduling.PMSP.ParallelMachines.Constraints]]#
objective :ClassVar[pyscheduling.Problem.Objective]#
init_sol_method :pyscheduling.core.base_solvers.BaseSolver#
lower_bound()#

Computes the lower bound of maximal completion time of the instance by dividing the sum of minimal completion time between job pairs on the number of machines

Returns

Lower Bound of maximal completion time

Return type

int

class pyscheduling.PMSP.RmSijkCmax.CSP#
class MyCallback(stop_times=[300, 600, 3600, 7200])#

Bases: docplex.cp.solver.cpo_callback.CpoCallback

A callback used to log the value of cmax at different timestamps

Parameters

CpoCallback (_type_) – Inherits from CpoCallback

invoke(solver, event, jsol)#

Notify the callback about a solver event.

This method is called every time an event is notified by the CPO solver. Associated to the event, the solver information is provided as a an object of class class:~docplex.cp.solution.CpoSolveResult that is instantiated with information available at this step.

Parameters
  • solver – Originator CPO solver (object of class CpoSolver)

  • event – Event id, string with value in ALL_CALLBACK_EVENTS

  • sres – Solver data, object of class CpoSolveResult

CPO_STATUS#
static _transform_csp_solution(msol, T_ki, instance)#

Transforms cp optimizer interval variable into a solution

Parameters
  • () (msol) – CPO solution

  • T_ki (list[list[interval_var]]) – Interval variables represening jobs

  • instance (RmSijkCmax_Instance) – instance corresponding to the solution

Returns

cpoptimizer’s solution

Return type

ParallelSolution

static solve(instance, **kwargs)#

Returns the solution using the Cplex - CP optimizer solver

Parameters
  • instance (Instance) – Instance object to solve

  • log_path (str, optional) – Path to the log file to output cp optimizer log. Defaults to None to disable logging.

  • time_limit (int, optional) – Time limit for executing the solver. Defaults to 300s.

  • threads (int, optional) – Number of threads to set for cp optimizer solver. Defaults to 1.

Returns

The object represeting the solving process result

Return type

SolveResult

class pyscheduling.PMSP.RmSijkCmax.ExactSolvers#
class pyscheduling.PMSP.RmSijkCmax.ListHeuristic#

Bases: pyscheduling.core.base_solvers.BaseSolver

Helper class that provides a standard way to create an ABC using inheritance.

rule :int = 1#
decreasing :bool = False#
solve(instance: RmSijkCmax_Instance)#

list_heuristic gives the option to use different rules in order to consider given factors in the construction of the solution

Parameters

instance (_type_) – Instance to be solved by the heuristic

Returns

the solver result of the execution of the heuristic

Return type

Problem.SolveResult