Package com.artelys.kalis
Class KSchedule
- java.lang.Object
-
- com.artelys.kalis.KSchedule
-
public class KSchedule extends java.lang.Object
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KSchedule.ScheduleStatus
-
Field Summary
Fields Modifier and Type Field Description protected boolean
swigCMemOwn
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRelaxationSolver(KLinearRelaxationSolver solver)
Add a relaxation solver to be used during the resolution processvoid
addResource(KResource resource)
Add a resource to this schedule
void
addTask(KTask task)
Add a task to this schedulevoid
close()
Close this schedule (no tasks or resources can be added after thisboolean
computeLowerBounds()
void
delete()
protected void
finalize()
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 optimalprotected static long
getCPtr(KSchedule obj)
double
getDblAttrib(int attribute)
Return the value of a double attribute
double
getDblControl(int control)
Return the value of a double control
KIntVarArray
getDurationsArray()
Return a pointer to the durations array of all the tasks in this scheduleKIntVarArray
getEndDatesArray()
Return a pointer to the end dates array of all the tasks in this schedulecom.artelys.kalis.SWIGTYPE_p_void
getFirstResource()
com.artelys.kalis.SWIGTYPE_p_void
getFirstTask()
KSchedule
getInstance(long pb)
int
getIntAttrib(int attribute)
Return the value of an int attribute
int
getIntControl(int control)
Return the value of an int control
KIntVar
getMakeSpan()
Return a reference to the objective variable representing the makespan of this schedulecom.artelys.kalis.SWIGTYPE_p_void
getNextResource()
com.artelys.kalis.SWIGTYPE_p_void
getNextTask()
int
getNumberOfResources()
Return the number of resources in this scheduleint
getNumberOfTasks()
Return the number of tasks in this scheduleKNumVar
getObjective()
Return a reference to the objective variable of this schedulecom.artelys.kalis.SWIGTYPE_p_KParallelSchedule_I
getParallelSchedule_IPtr()
KProblem
getProblem()
Return the problem associated to this scheduleKResource
getResource(int nbResource)
Return a pointer to the resource number 'nbResource' in this schedule in the input orderKResourceArray
getResourceArray()
Return a pointer to the list of resource of this schedulecom.artelys.kalis.SWIGTYPE_p_KSchedule_I
getSchedule_IPtr()
KSolver
getSolver()
Return the solver object used to optimize the scheduleKSolverEventListener
getSolverEventListener()
KIntVarArray
getStartDatesArray()
Return a pointer to the start dates array of all the tasks in this scheduleKTask
getTask(int nbTask)
Return a pointer to the task number 'nbTask" in the input orderKTaskArray
getTaskArray()
Return a pointer to the list of tasks of this scheduleint
getTimeMax()
Return the maximal time horizon of this scheduleint
getTimeMin()
Return the minimal time horizon of this scheduleboolean
isClosed()
Return true if the schedule is closedint
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.int
optimize()
Launch the optimization phasevoid
print()
Pretty printing of the schedulevoid
print(com.artelys.kalis.SWIGTYPE_p_void ctx, com.artelys.kalis.SWIGTYPE_p_f_p_void_p_q_const__char__int pfp)
Pretty printing of the schedulevoid
printRessourcesGantt(KSolution sol, int factor)
Pretty printing of the solution of this schedulevoid
setDblAttrib(int attribute, double value)
Set the value of a double attribute
void
setDblControl(int control, double value)
Set the value of a double control
void
setFirstSolutionSearchStrategy(KBranchingSchemeArray branchingSchemeArray)
void
setFunctionPointers(com.artelys.kalis.SWIGTYPE_p_f_p_void__int asyncfunc, com.artelys.kalis.SWIGTYPE_p_f_p_void__int sol, com.artelys.kalis.SWIGTYPE_p_f_p_void__int nodes, com.artelys.kalis.SWIGTYPE_p_f_p_void__int goup, com.artelys.kalis.SWIGTYPE_p_f_p_void__int godown, com.artelys.kalis.SWIGTYPE_p_void param)
Set the callback functions to call when the schedule is optimized
void
setIntAttrib(int attribute, int value)
Set the value of an int attribute of the solver
void
setIntControl(int control, int value)
Set the value of an int control of the solver
void
setObjective(KFloatVar obj)
Set the objective variable for this schedule as a KFloatVar
void
setObjective(KIntVar obj)
Set the objective variable for this schedule as a KIntVar
void
setOptimalSolutionSearchStrategy(KBranchingSchemeArray branchingSchemeArray)
void
setSolverEventListener(KSolverEventListener arg0)
void
setTimeMax(int timemax)
Setting the maxiaml horizon timestepvoid
setTimeMin(int timemin)
Setting the minimal horizon timestep
-
-
-
Constructor Detail
-
KSchedule
protected KSchedule(long cPtr, boolean cMemoryOwn)
-
KSchedule
public KSchedule(KProblem p, java.lang.String name, int timeMin, int timeMax)
Constructor
- Parameters:
p
- the kalis problemname
- the name of this scheduletimeMin
- minimal time horizontimeMax
- maximal time horizon
-
-
Method Detail
-
getCPtr
protected static long getCPtr(KSchedule obj)
-
finalize
protected void finalize()
- Overrides:
finalize
in classjava.lang.Object
-
delete
public void delete()
-
print
public void print()
Pretty printing of the schedule
-
print
public void print(com.artelys.kalis.SWIGTYPE_p_void ctx, com.artelys.kalis.SWIGTYPE_p_f_p_void_p_q_const__char__int pfp)
Pretty printing of the schedule
-
addTask
public void addTask(KTask task)
Add a task to this schedule
-
addResource
public void addResource(KResource resource)
Add a resource to this schedule
- Parameters:
resource
- the resource to add to this schedule
-
getProblem
public KProblem getProblem()
Return the problem associated to this schedule
-
printRessourcesGantt
public void printRessourcesGantt(KSolution sol, int factor)
Pretty printing of the solution of this schedule
-
setFirstSolutionSearchStrategy
public void setFirstSolutionSearchStrategy(KBranchingSchemeArray branchingSchemeArray)
-
setOptimalSolutionSearchStrategy
public void setOptimalSolutionSearchStrategy(KBranchingSchemeArray branchingSchemeArray)
-
getStartDatesArray
public KIntVarArray getStartDatesArray()
Return a pointer to the start dates array of all the tasks in this schedule
-
getEndDatesArray
public KIntVarArray getEndDatesArray()
Return a pointer to the end dates array of all the tasks in this schedule
-
getDurationsArray
public KIntVarArray getDurationsArray()
Return a pointer to the durations array of all the tasks in this schedule
-
getResourceArray
public KResourceArray getResourceArray()
Return a pointer to the list of resource of this schedule
-
getTaskArray
public KTaskArray getTaskArray()
Return a pointer to the list of tasks of this schedule
-
getTimeMin
public int getTimeMin()
Return the minimal time horizon of this schedule
-
getTimeMax
public int getTimeMax()
Return the maximal time horizon of this schedule
-
setTimeMin
public void setTimeMin(int timemin)
Setting the minimal horizon timestep
-
setTimeMax
public void setTimeMax(int timemax)
Setting the maxiaml horizon timestep
-
optimize
public int optimize()
Launch the optimization phase
-
findInitialSolution
public 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.
-
findOptimalSolution
public 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
-
localOptimization
public 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.
-
setObjective
public 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
-
setObjective
public void setObjective(KIntVar obj)
Set the objective variable for this schedule as a KIntVar
-
getObjective
public KNumVar getObjective()
Return a reference to the objective variable of this schedule
-
getMakeSpan
public KIntVar getMakeSpan()
Return a reference to the objective variable representing the makespan of this schedule
-
close
public void close()
Close this schedule (no tasks or resources can be added after this
-
computeLowerBounds
public boolean computeLowerBounds()
-
setFunctionPointers
public void setFunctionPointers(com.artelys.kalis.SWIGTYPE_p_f_p_void__int asyncfunc, com.artelys.kalis.SWIGTYPE_p_f_p_void__int sol, com.artelys.kalis.SWIGTYPE_p_f_p_void__int nodes, com.artelys.kalis.SWIGTYPE_p_f_p_void__int goup, com.artelys.kalis.SWIGTYPE_p_f_p_void__int godown, com.artelys.kalis.SWIGTYPE_p_void param)
Set the callback functions to call when the schedule is optimized
- Parameters:
asyncfunc
- the callback to call to stop the optimization processsol
- the callback to call when a solution has been foundnodes
- the callback to call when a node is createdgoup
- the callback to call when a branch has been fully exploredgodown
- the callback to call when a branch is explored
-
getSolver
public KSolver getSolver()
Return the solver object used to optimize the schedule
-
getNumberOfTasks
public int getNumberOfTasks()
Return the number of tasks in this schedule
-
getTask
public KTask getTask(int nbTask)
Return a pointer to the task number 'nbTask" in the input order
-
getNumberOfResources
public int getNumberOfResources()
Return the number of resources in this schedule
-
getResource
public KResource getResource(int nbResource)
Return a pointer to the resource number 'nbResource' in this schedule in the input order
-
getIntAttrib
public int getIntAttrib(int attribute)
Return the value of an int attribute
- Parameters:
attribute
- integer attribute to retrieve
- See Also:
IntAttrib
-
getDblAttrib
public double getDblAttrib(int attribute)
Return the value of a double attribute
- Parameters:
attribute
- double attribute to retrieve
- See Also:
DblAttrib
-
setIntAttrib
public void setIntAttrib(int attribute, int value)
Set the value of an int attribute of the solver
- Parameters:
attribute
- the int attribute to setvalue
- the value of the attribute
- See Also:
IntAttrib
-
setDblAttrib
public void setDblAttrib(int attribute, double value)
Set the value of a double attribute
- Parameters:
attribute
- the double attribute to setvalue
- value of the attribute
- See Also:
DblAttrib
-
getIntControl
public int getIntControl(int control)
Return the value of an int control
- Parameters:
control
- integer control to retrieve
- See Also:
IntControl
-
getDblControl
public double getDblControl(int control)
Return the value of a double control
- Parameters:
control
- double control to retrieve
- See Also:
DblControl
-
setIntControl
public void setIntControl(int control, int value)
Set the value of an int control of the solver
- Parameters:
control
- the int control to setvalue
- the value of the control
- See Also:
IntControl
-
setDblControl
public void setDblControl(int control, double value)
Set the value of a double control
- Parameters:
control
- the double control to setvalue
- value of the control
- See Also:
DblControl
-
addRelaxationSolver
public void addRelaxationSolver(KLinearRelaxationSolver solver)
Add a relaxation solver to be used during the resolution process
-
getFirstTask
public com.artelys.kalis.SWIGTYPE_p_void getFirstTask()
-
getNextTask
public com.artelys.kalis.SWIGTYPE_p_void getNextTask()
-
getFirstResource
public com.artelys.kalis.SWIGTYPE_p_void getFirstResource()
-
getNextResource
public com.artelys.kalis.SWIGTYPE_p_void getNextResource()
-
isClosed
public boolean isClosed()
Return true if the schedule is closed
-
getSchedule_IPtr
public com.artelys.kalis.SWIGTYPE_p_KSchedule_I getSchedule_IPtr()
-
getParallelSchedule_IPtr
public com.artelys.kalis.SWIGTYPE_p_KParallelSchedule_I getParallelSchedule_IPtr()
-
getInstance
public KSchedule getInstance(long pb)
-
getSolverEventListener
public KSolverEventListener getSolverEventListener()
-
setSolverEventListener
public void setSolverEventListener(KSolverEventListener arg0)
-
-