KSchedule

class KSchedule

Scheduling and planning problems are concerned with determining a plan for the execution of a given set of tasks.

The objective may be to generate a feasible schedule that satisfies the given constraints (such as sequence of tasks or limited resource availability) or to optimize a given criterion such as the makespan of the schedule.

Artelys-Kalis defines several aggregate modeling objects to simplify the formulation of standard scheduling problems like tasks,resources and schedule objects. by the types KUnaryResource and KDiscreteResource. When working with these scheduling objects it is often sufficient to state the objects and their properties, such as task duration or resource use; the necessary constraint relations are set up automatically by Artelys-Kalis (referred to as implicit constraints).

Since

2016.1

Public Functions

KSchedule(KProblem &p, const char *name, int timeMin, int timeMax)

Constructor

Parameters
  • p – the kalis problem

  • name – the name of this schedule

  • timeMin – minimal time horizon

  • timeMax – maximal time horizon

virtual ~KSchedule()

Destuctor

virtual void print() const

Pretty printing of the schedule

virtual void print(void *ctx, PrintFunctionPtr *pfp) const

Pretty printing of the schedule

void addTask(KTask &task)

Add a task to this schedule

void addResource(KResource &resource)

Add a resource to this schedule

Parameters

resource – the resource to add to this schedule

KProblem *getProblem()

Return the problem associated to this schedule

void printRessourcesGantt(KSolution &sol, int factor) const

Pretty printing of the solution of this schedule

KIntVarArray *getStartDatesArray(void)

Return a pointer to the start dates array of all the tasks in this schedule

KIntVarArray *getEndDatesArray(void)

Return a pointer to the end dates array of all the tasks in this schedule

KIntVarArray *getDurationsArray(void)

Return a pointer to the durations array of all the tasks in this schedule

KResourceArray *getResourceArray()

Return a pointer to the list of resource of this schedule

KTaskArray *getTaskArray()

Return a pointer to the list of tasks of this schedule

int getTimeMin()

Return the minimal time horizon of this schedule

int getTimeMax()

Return the maximal time horizon of this schedule

void setTimeMin(int timemin)

Setting the minimal horizon timestep

void setTimeMax(int timemax)

Setting the maxiaml horizon timestep

int optimize()

Launch the optimization phase

int findInitialSolution()

Find a initial heuristic solution for this schedule

Return Inconsistent if this schedule has no solution. Return Suboptimal if the heuristic solution is subobtimal. Return Optimal if the heuristic solution is optimal.

int findOptimalSolution()

Find the optimal solution for this schedule

Return Inconsistent if this schedule has no solution. Return Optimal if the heuristic solution is optimal

int localOptimization()

Find suboptimal solutions for this schedule using a local search algorithm.

Return Inconsistent if this schedule has no solution. Return Suboptimal if the heuristic solution is suboptimal.

void setObjective(KFloatVar &obj)

Set the objective variable for this schedule as a KFloatVar

Parameters

obj – the objective variable for this schedule as a KFloatVar

void setObjective(KIntVar &obj)

Set the objective variable for this schedule as a KIntVar

Parameters

the – objective variable for this schedule as a KIntVar

KNumVar &getObjective(void)

Return a reference to the objective variable of this schedule

KIntVar &getMakeSpan(void)

Return a reference to the objective variable representing the makespan of this schedule

void close()

Close this schedule (no tasks or resources can be added after this

void setFunctionPointers(KalisCallBackFunctionPtr asyncfunc, KalisCallBackFunctionPtr sol, KalisCallBackFunctionPtr nodes, KalisCallBackFunctionPtr goup, KalisCallBackFunctionPtr godown, void *param)

Set the callback functions to call when the schedule is optimized

Parameters
  • asyncfunc – the callback to call to stop the optimization process

  • sol – the callback to call when a solution has been found

  • nodes – the callback to call when a node is created

  • goup – the callback to call when a branch has been fully explored

  • godown – the callback to call when a branch is explored

KSolver *getSolver()

Return the solver object used to optimize the schedule

int getNumberOfTasks(void)

Return the number of tasks in this schedule

KTask *getTask(int nbTask)

Return a pointer to the task number ‘nbTask” in the input order

int getNumberOfResources(void)

Return the number of resources in this schedule

KResource *getResource(int nbResource)

Return a pointer to the resource number ‘nbResource’ in this schedule in the input order

int getIntAttrib(KSolver::IntAttrib attribute)

Return the value of an int attribute

See

IntAttrib

Parameters

attribute – integer attribute to retrieve

double getDblAttrib(KSolver::DblAttrib attribute)

Return the value of a double attribute

See

DblAttrib

Parameters

attribute – double attribute to retrieve

void setIntAttrib(KSolver::IntAttrib attribute, int value)

Set the value of an int attribute of the solver

See

IntAttrib

Parameters
  • attribute – the int attribute to set

  • value – the value of the attribute

void setDblAttrib(KSolver::DblAttrib attribute, double value)

Set the value of a double attribute

See

DblAttrib

Parameters
  • attribute – the double attribute to set

  • value – value of the attribute

int getIntControl(KSolver::IntControl control)

Return the value of an int control

See

IntControl

Parameters

control – integer control to retrieve

double getDblControl(KSolver::DblControl control)

Return the value of a double control

See

DblControl

Parameters

control – double control to retrieve

void setIntControl(KSolver::IntControl control, int value)

Set the value of an int control of the solver

See

IntControl

Parameters
  • control – the int control to set

  • value – the value of the control

void setDblControl(KSolver::DblControl control, double value)

Set the value of a double control

See

DblControl

Parameters
  • control – the double control to set

  • value – value of the control

void addRelaxationSolver(KLinearRelaxationSolver *solver)

Add a relaxation solver to be used during the resolution process

bool isClosed()

Return true if the schedule is closed.