Package com.artelys.kalis
Class KTask
- java.lang.Object
-
- com.artelys.kalis.KTask
-
public class KTask extends java.lang.ObjectTasks (processing operations, activities) are represented by the class KTask. This object contains three variables :
- a start variable representing the starting time of the task
- an end variable representing the ending time of the task
- a duration variable representing the duration of the task
These three structural variables are linked by Artelys-Kalis with the following constraint :
start + duration = end
The starting time variable represents two specific parameters of the task:
- the Earliest Starting Time (EST represented by the start variable lower bound)
- and its Latest Starting Time (LST represented by the start variable upper bound)
The end variable represents two specific parameters of the task:
- the Earliest Completion Time (ECT represented by the end variable lower bound)
- and its Latest Completion Time (LCT represented by the end variable upper bound)
The duration variable represents two specific parameters of the task:
- the minimum task duration (Dmin represented by the duration variable lower bound)
- the maximum task duration (Dmax represented by the duration variable upper bound)

- Since:
- 2016.1
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanswigCMemOwn
-
Constructor Summary
Constructors Modifier Constructor Description KTask()Empty constructorprotectedKTask(long cPtr, boolean cMemoryOwn)KTask(KSchedule schedule)Basic constructorKTask(KSchedule s, java.lang.String name)Primary constructor
KTask(KSchedule s, java.lang.String name, int duration)Constructor with constant duration
KTask(KSchedule s, java.lang.String name, int smin, int smax, int dmin, int dmax)Constructor with min/max value for start time and duration
KTask(KSchedule s, java.lang.String name, int duration, KResource r)Constructor with fixed duration and unary resource usage
KTask(KSchedule s, java.lang.String name, KResource r, int consumption)KTask(KTask toCopy)Copy constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconstrainVars()intconsumes(KResource resource)State that this ressource consumes ( non-renewable ) one unit of resource
`resource`voidconsumes(KResource resource, int consumption)State that this ressource consumes ( non-renewable ) `consumption` unit
of resource `resource`
voidconsumes(KResource resource, int consumptionmin, int consumptionmax)State that this ressource consumes ( non-renewable ) between
`consumptionmin` and `consumptionmax` unit of resource `resource`
voidconsumes(KResourceUsage resusage)Add a resource usage consumption for this taskvoidconsumes(KResourceUsageArray resusagearray)Add optional resources usages consumptions for this task and ensure that
between [min..max] of theses requirements are satisfiedvoidconsumes(KResourceUsageArray resusagearray, int min)Add optional resources usages consumptions for this task and ensure that
between [min..max] of theses requirements are satisfiedvoidconsumes(KResourceUsageArray resusagearray, int min, int max)Add optional resources usages consumptions for this task and ensure that
between [min..max] of theses requirements are satisfiedvoiddelete()voidendsBefore(KTask task)State that this task ends `delay` time unit before the completion of
the given `task`
voidendsBefore(KTask task, int delay)State that this task ends `delay` time unit before the completion of
the given `task`
protected voidfinalize()KIntVargetAssignmentVar(KResource r)Return a pointer to the KIntVar representing the resource requirement of
this task for resource `r` if any or nullptrKIntVargetConsumesVar(KResource r)Return a pointer to the KIntVar representing the resource consumtion of
this task for resource `r` if any or nullptrKTaskgetCopyPtr()protected static longgetCPtr(KTask obj)intgetDurationValue()Return the constant duration of this task or the lowerbound if duration
is not constantKIntVargetDurationVar()Return a pointer to the KIntVar representing the duration of this taskintgetEarliestCompletionTime()Return the earliest completion time of this taskintgetEarliestStartTime()Return the earliest starting time of this taskKIntVargetEndDateVar()Return a pointer to the KIntVar representing the ending date of this taskintgetIndex()Return the id of this taskintgetLatestCompletionTime()Return the latest completion time of this taskintgetLatestStartTime()Return the latest starting time of this taskintgetMaximalProduction(KResource resource, int tslot)Return the maximal resource production for this task and the resource in
parameters at time step `tslot`intgetMaximalProvision(KResource resource, int tslot)Return the maximal resource provision for this task and the resource in
parameters at time step `tslot`intgetMaximumDuration()Return the maximum duration of this taskintgetMinimalConsumption(KResource resource, int tslot)Return the minimal resource consumption for this task and the resource in
parameters at time step `tslot`intgetMinimalRequirement(KResource resource, int tslot)Return the minimal resource requirement for this task and the resource in
parameters at time step `tslot`intgetMinimumDuration()Return the minimum duration of this taskjava.lang.StringgetName()Return the name of this taskKIntVargetProducesVar(KResource r)Return a pointer to the KIntVar representing the resource production of
this task for resource `r` if any or nullptrKIntVargetProvidesVar(KResource r)Return a pointer to the KIntVar representing the resource provision of
this task for resource `r` if any or nullptrKIntVargetRequiresVar(KResource r)Return a pointer to the KIntVar representing the resource requirement of
this task for resource `r` if any or nullptrintgetResourceConsumption()KSchedulegetSchedule()Pretty printing of the task to stdoutintgetSetupTime(KTask task)Return the setup time between the current task and the one passed in parameterKIntVargetSizeVar(KResource r)Return a pointer to the KIntVar representing the product requirement * durationKIntVargetStartDateVar()Return a pointer to the KIntVar representing the starting date of this
taskcom.artelys.kalis.SWIGTYPE_p_KTask_IgetTaskIPtr()booleanisFixed()Return true IFF this task is fixed (Start,End,Duration, and
resource utilizations variables are instantiated)voidpostEndToEndMaxC(KTask task)State that the distance between the completion of this task and the
completion of task `task` cannot exceed `Max` time units
voidpostEndToEndMaxC(KTask task, int Max)State that the distance between the completion of this task and the
completion of task `task` cannot exceed `Max` time units
voidpostEndToStartMaxC(KTask task)State that the distance between the completion of this task and the start
of task `task` cannot exceed `Max` time units
voidpostEndToStartMaxC(KTask task, int Max)State that the distance between the completion of this task and the start
of task `task` cannot exceed `Max` time units
voidpostEndToStartMinC(KTask task)State that the distance between the completion of this task and the start
of task `task` must exceed `Min` time units
voidpostEndToStartMinC(KTask task, int Min)State that the distance between the completion of this task and the start
of task `task` must exceed `Min` time units
voidpostStartToStartMinC(KTask task)State that the distance between the start of this task and the start of
task `task` must exceed `Min` time units
voidpostStartToStartMinC(KTask task, int Min)State that the distance between the start of this task and the start of
task `task` must exceed `Min` time units
voidprint()Pretty printing the taskvoidprint(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 task with a PrintFunctionPtrintproduces(KResource resource)State that this ressource produces ( non-renewable ) one unit of resource
`resource`voidproduces(KResource resource, int production)State that this ressource produces ( non-renewable ) `production` unit of
resource `resource`
voidproduces(KResource resource, int productionmin, int productionmax)State that this ressource produces ( non-renewable ) between
`productionmin` and `productionmax` unit of resource `resource`
voidproduces(KResourceUsage resusage)Add a resource usage production for this taskvoidproduces(KResourceUsageArray resusagearray)Add optional resources usages productions for this task and ensure that
between [min..max] of theses requirements are satisfiedvoidproduces(KResourceUsageArray resusagearray, int min)Add optional resources usages productions for this task and ensure that
between [min..max] of theses requirements are satisfiedvoidproduces(KResourceUsageArray resusagearray, int min, int max)Add optional resources usages productions for this task and ensure that
between [min..max] of theses requirements are satisfiedintprovides(KResource resource)State that this ressource provides ( renewable ) one unit of resource
`resource`voidprovides(KResource resource, int provision)State that this ressource provides ( renewable ) `provision` unit of
resource `resource`
voidprovides(KResource resource, int provisionmin, int provisionmax)State that this ressource provides ( renewable ) between `provisionmin`
and 'provisionmax unit of resource `resource`
voidprovides(KResourceUsage resusage)Add a resource usage provision for this taskvoidprovides(KResourceUsageArray resusagearray)Add optional resources usages provisions for this task and ensure that
between [min..max] of theses requirements are satisfiedvoidprovides(KResourceUsageArray resusagearray, int min)Add optional resources usages provisions for this task and ensure that
between [min..max] of theses requirements are satisfiedvoidprovides(KResourceUsageArray resusagearray, int min, int max)Add optional resources usages provisions for this task and ensure that
between [min..max] of theses requirements are satisfiedintrequires(KResource resource)State that this ressource requires ( renewable ) one unit of resource
`resource`voidrequires(KResource resource, int requirement)State that this ressource requires ( renewable ) `requirement` unit of
resource `resource`
voidrequires(KResource resource, int requirementmin, int requirementmax)State that this ressource requires ( renewable ) between `requirementmin`
and 'requirementmax unit of resource `resource`
voidrequires(KResourceUsage resusage)Add a resource usage requirement for this taskvoidrequires(KResourceUsageArray resusagearray)Add optional resources usages requirements for this task and ensure that
between [min..max] of theses requirements are satisfiedvoidrequires(KResourceUsageArray resusagearray, int min)Add optional resources usages requirements for this task and ensure that
between [min..max] of theses requirements are satisfiedvoidrequires(KResourceUsageArray resusagearray, int min, int max)Add optional resources usages requirements for this task and ensure that
between [min..max] of theses requirements are satisfiedvoidsetDuration(int duration)Set the duration of this task to `duration`voidsetEarliestCompletionTime(int time)Set the earliest completion time of this taskvoidsetEarliestStartTime(int time)Set the earliest starting time of this taskvoidsetEndTime(int endTime)Set the ending time of this task to `endTime`voidsetIndex(int index)voidsetLatestCompletionTime(int time)Set the latest completion time of this taskvoidsetLatestStartTime(int time)Set the latest starting time of this taskvoidsetMaximumDuration(int durationmax)Set the maximum duration of this taskvoidsetMinimumDuration(int durationmin)Set the minimum duration of this taskvoidsetName(java.lang.String name)Set the name of this taskvoidsetSetupTime(KTask task, int before, int after)Set the sequence dependent setup time between the current task,and the one passed in parameters to before/aftervoidsetStartTime(int startTime)Set the starting time of this task to `startTime`voidsetTaskIPtr(com.artelys.kalis.SWIGTYPE_p_KTask_I taskIPtr)voidstartsAfter(KTask task)State that this task starts `delay` time unit after the completion of
the given `task`
voidstartsAfter(KTask task, int delay)State that this task starts `delay` time unit after the completion of
the given `task`
-
-
-
Constructor Detail
-
KTask
protected KTask(long cPtr, boolean cMemoryOwn)
-
KTask
public KTask()
Empty constructor
-
KTask
public KTask(KSchedule schedule)
Basic constructor
-
KTask
public KTask(KSchedule s, java.lang.String name)
Primary constructor
- Parameters:
s- the schedulename- string representing the name of the task
-
KTask
public KTask(KSchedule s, java.lang.String name, int smin, int smax, int dmin, int dmax)
Constructor with min/max value for start time and duration
- Parameters:
s- the schedulename- string representing the name of the tasksmin- Minimum possible start of the tasksmin- Maximum possible start of the taskdmin- Minimum possible duration of the taskdmax- Maximum possible duration of the task
-
KTask
public KTask(KSchedule s, java.lang.String name, int duration)
Constructor with constant duration
- Parameters:
s- the schedulename- string representing the name of the taskduration- fixed duration of the task
-
KTask
public KTask(KSchedule s, java.lang.String name, int duration, KResource r)
Constructor with fixed duration and unary resource usage
- Parameters:
s- the schedulename- string representing the name of the taskduration- fixed task durationr- the resource required by the task
-
KTask
public KTask(KSchedule s, java.lang.String name, KResource r, int consumption)
- Parameters:
s- the schedulename- string representing the name of the task
-
KTask
public KTask(KTask toCopy)
Copy constructor
-
-
Method Detail
-
getCPtr
protected static long getCPtr(KTask obj)
-
finalize
protected void finalize()
- Overrides:
finalizein classjava.lang.Object
-
delete
public void delete()
-
getSchedule
public KSchedule getSchedule()
Pretty printing of the task to stdout
-
print
public void print()
Pretty printing the task
-
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 task with a PrintFunctionPtr
-
setSetupTime
public void setSetupTime(KTask task, int before, int after)
Set the sequence dependent setup time between the current task,and the one passed in parameters to before/after
-
getSetupTime
public int getSetupTime(KTask task)
Return the setup time between the current task and the one passed in parameter
-
requires
public void requires(KResourceUsage resusage)
Add a resource usage requirement for this task
-
provides
public void provides(KResourceUsage resusage)
Add a resource usage provision for this task
-
consumes
public void consumes(KResourceUsage resusage)
Add a resource usage consumption for this task
-
produces
public void produces(KResourceUsage resusage)
Add a resource usage production for this task
-
requires
public void requires(KResourceUsageArray resusagearray, int min, int max)
Add optional resources usages requirements for this task and ensure that
between [min..max] of theses requirements are satisfied
-
requires
public void requires(KResourceUsageArray resusagearray, int min)
Add optional resources usages requirements for this task and ensure that
between [min..max] of theses requirements are satisfied
-
requires
public void requires(KResourceUsageArray resusagearray)
Add optional resources usages requirements for this task and ensure that
between [min..max] of theses requirements are satisfied
-
provides
public void provides(KResourceUsageArray resusagearray, int min, int max)
Add optional resources usages provisions for this task and ensure that
between [min..max] of theses requirements are satisfied
-
provides
public void provides(KResourceUsageArray resusagearray, int min)
Add optional resources usages provisions for this task and ensure that
between [min..max] of theses requirements are satisfied
-
provides
public void provides(KResourceUsageArray resusagearray)
Add optional resources usages provisions for this task and ensure that
between [min..max] of theses requirements are satisfied
-
consumes
public void consumes(KResourceUsageArray resusagearray, int min, int max)
Add optional resources usages consumptions for this task and ensure that
between [min..max] of theses requirements are satisfied
-
consumes
public void consumes(KResourceUsageArray resusagearray, int min)
Add optional resources usages consumptions for this task and ensure that
between [min..max] of theses requirements are satisfied
-
consumes
public void consumes(KResourceUsageArray resusagearray)
Add optional resources usages consumptions for this task and ensure that
between [min..max] of theses requirements are satisfied
-
produces
public void produces(KResourceUsageArray resusagearray, int min, int max)
Add optional resources usages productions for this task and ensure that
between [min..max] of theses requirements are satisfied
-
produces
public void produces(KResourceUsageArray resusagearray, int min)
Add optional resources usages productions for this task and ensure that
between [min..max] of theses requirements are satisfied
-
produces
public void produces(KResourceUsageArray resusagearray)
Add optional resources usages productions for this task and ensure that
between [min..max] of theses requirements are satisfied
-
getMinimalRequirement
public int getMinimalRequirement(KResource resource, int tslot)
Return the minimal resource requirement for this task and the resource in
parameters at time step `tslot`
-
getMinimalConsumption
public int getMinimalConsumption(KResource resource, int tslot)
Return the minimal resource consumption for this task and the resource in
parameters at time step `tslot`
-
getMaximalProvision
public int getMaximalProvision(KResource resource, int tslot)
Return the maximal resource provision for this task and the resource in
parameters at time step `tslot`
-
getMaximalProduction
public int getMaximalProduction(KResource resource, int tslot)
Return the maximal resource production for this task and the resource in
parameters at time step `tslot`
-
requires
public void requires(KResource resource, int requirement)
State that this ressource requires ( renewable ) `requirement` unit of
resource `resource`
- Parameters:
resource- the resourcerequirement- the resource requirement
-
consumes
public void consumes(KResource resource, int consumption)
State that this ressource consumes ( non-renewable ) `consumption` unit
of resource `resource`
- Parameters:
resource- the involved resourceconsumption- the resource consumption
-
provides
public void provides(KResource resource, int provision)
State that this ressource provides ( renewable ) `provision` unit of
resource `resource`
- Parameters:
resource- the resourceprovision- the resource provision
-
produces
public void produces(KResource resource, int production)
State that this ressource produces ( non-renewable ) `production` unit of
resource `resource`
- Parameters:
resource- the resourceproduction- the resource production
-
requires
public void requires(KResource resource, int requirementmin, int requirementmax)
State that this ressource requires ( renewable ) between `requirementmin`
and 'requirementmax unit of resource `resource`
- Parameters:
resource- the resourcerequirementmin- the minimal resource requirementrequirementmax- the maximal resource requirement
-
consumes
public void consumes(KResource resource, int consumptionmin, int consumptionmax)
State that this ressource consumes ( non-renewable ) between
`consumptionmin` and `consumptionmax` unit of resource `resource`
- Parameters:
resource- the resourceconsumptionmin- the minimal resource consumptionconsumptionmax- the maximal resource consumption
-
provides
public void provides(KResource resource, int provisionmin, int provisionmax)
State that this ressource provides ( renewable ) between `provisionmin`
and 'provisionmax unit of resource `resource`
- Parameters:
resource- the resourceprovisionmin- the minimal resource provisionprovisionmax- the maximal resource provision
-
produces
public void produces(KResource resource, int productionmin, int productionmax)
State that this ressource produces ( non-renewable ) between
`productionmin` and `productionmax` unit of resource `resource`
- Parameters:
resource- the resourceproductionmin- the minimal resource productionproductionmax- the maximal resource production
-
requires
public int requires(KResource resource)
State that this ressource requires ( renewable ) one unit of resource
`resource`
-
consumes
public int consumes(KResource resource)
State that this ressource consumes ( non-renewable ) one unit of resource
`resource`
-
provides
public int provides(KResource resource)
State that this ressource provides ( renewable ) one unit of resource
`resource`
-
produces
public int produces(KResource resource)
State that this ressource produces ( non-renewable ) one unit of resource
`resource`
-
startsAfter
public void startsAfter(KTask task, int delay)
State that this task starts `delay` time unit after the completion of
the given `task`
- Parameters:
task- the task before the current taskdelay- the time distance between the two tasks
-
startsAfter
public void startsAfter(KTask task)
State that this task starts `delay` time unit after the completion of
the given `task`
- Parameters:
task- the task before the current task
-
endsBefore
public void endsBefore(KTask task, int delay)
State that this task ends `delay` time unit before the completion of
the given `task`
- Parameters:
task- the task before the current taskdelay- the time distance between the two tasks
-
endsBefore
public void endsBefore(KTask task)
State that this task ends `delay` time unit before the completion of
the given `task`
- Parameters:
task- the task before the current task
-
postEndToEndMaxC
public void postEndToEndMaxC(KTask task, int Max)
State that the distance between the completion of this task and the
completion of task `task` cannot exceed `Max` time units
- Parameters:
task- the taskMax- the distance between the completion of this task and the completion of task `task`
-
postEndToEndMaxC
public void postEndToEndMaxC(KTask task)
State that the distance between the completion of this task and the
completion of task `task` cannot exceed `Max` time units
- Parameters:
task- the task
-
postEndToStartMaxC
public void postEndToStartMaxC(KTask task, int Max)
State that the distance between the completion of this task and the start
of task `task` cannot exceed `Max` time units
- Parameters:
task- the taskMax- the distance between the completion of this task and the start of task `task`
-
postEndToStartMaxC
public void postEndToStartMaxC(KTask task)
State that the distance between the completion of this task and the start
of task `task` cannot exceed `Max` time units
- Parameters:
task- the task
-
postStartToStartMinC
public void postStartToStartMinC(KTask task, int Min)
State that the distance between the start of this task and the start of
task `task` must exceed `Min` time units
- Parameters:
task- the taskMin- the distance between the start of this task and the start of task `task`
-
postStartToStartMinC
public void postStartToStartMinC(KTask task)
State that the distance between the start of this task and the start of
task `task` must exceed `Min` time units
- Parameters:
task- the task
-
postEndToStartMinC
public void postEndToStartMinC(KTask task, int Min)
State that the distance between the completion of this task and the start
of task `task` must exceed `Min` time units
- Parameters:
task- the taskMin- the distance between the completion of this task and the start of task `task`
-
postEndToStartMinC
public void postEndToStartMinC(KTask task)
State that the distance between the completion of this task and the start
of task `task` must exceed `Min` time units
- Parameters:
task- the task
-
setIndex
public void setIndex(int index)
-
getIndex
public int getIndex()
Return the id of this task
-
getName
public java.lang.String getName()
Return the name of this task
-
setName
public void setName(java.lang.String name)
Set the name of this task
-
getStartDateVar
public KIntVar getStartDateVar()
Return a pointer to the KIntVar representing the starting date of this
task
-
getEndDateVar
public KIntVar getEndDateVar()
Return a pointer to the KIntVar representing the ending date of this task
-
getDurationVar
public KIntVar getDurationVar()
Return a pointer to the KIntVar representing the duration of this task
-
getRequiresVar
public KIntVar getRequiresVar(KResource r)
Return a pointer to the KIntVar representing the resource requirement of
this task for resource `r` if any or nullptr
-
getConsumesVar
public KIntVar getConsumesVar(KResource r)
Return a pointer to the KIntVar representing the resource consumtion of
this task for resource `r` if any or nullptr
-
getProvidesVar
public KIntVar getProvidesVar(KResource r)
Return a pointer to the KIntVar representing the resource provision of
this task for resource `r` if any or nullptr
-
getProducesVar
public KIntVar getProducesVar(KResource r)
Return a pointer to the KIntVar representing the resource production of
this task for resource `r` if any or nullptr
-
getSizeVar
public KIntVar getSizeVar(KResource r)
Return a pointer to the KIntVar representing the product requirement * duration
-
getAssignmentVar
public KIntVar getAssignmentVar(KResource r)
Return a pointer to the KIntVar representing the resource requirement of
this task for resource `r` if any or nullptr
-
getDurationValue
public int getDurationValue()
Return the constant duration of this task or the lowerbound if duration
is not constant
-
getResourceConsumption
public int getResourceConsumption()
-
getEarliestStartTime
public int getEarliestStartTime()
Return the earliest starting time of this task
-
getLatestStartTime
public int getLatestStartTime()
Return the latest starting time of this task
-
getEarliestCompletionTime
public int getEarliestCompletionTime()
Return the earliest completion time of this task
-
getLatestCompletionTime
public int getLatestCompletionTime()
Return the latest completion time of this task
-
getMinimumDuration
public int getMinimumDuration()
Return the minimum duration of this task
-
getMaximumDuration
public int getMaximumDuration()
Return the maximum duration of this task
-
setEarliestStartTime
public void setEarliestStartTime(int time)
Set the earliest starting time of this task
-
setLatestStartTime
public void setLatestStartTime(int time)
Set the latest starting time of this task
-
setEarliestCompletionTime
public void setEarliestCompletionTime(int time)
Set the earliest completion time of this task
-
setLatestCompletionTime
public void setLatestCompletionTime(int time)
Set the latest completion time of this task
-
setMinimumDuration
public void setMinimumDuration(int durationmin)
Set the minimum duration of this task
-
setMaximumDuration
public void setMaximumDuration(int durationmax)
Set the maximum duration of this task
-
setStartTime
public void setStartTime(int startTime)
Set the starting time of this task to `startTime`
-
setEndTime
public void setEndTime(int endTime)
Set the ending time of this task to `endTime`
-
setDuration
public void setDuration(int duration)
Set the duration of this task to `duration`
-
isFixed
public boolean isFixed()
Return true IFF this task is fixed (Start,End,Duration, and
resource utilizations variables are instantiated)
-
constrainVars
public void constrainVars()
-
getCopyPtr
public KTask getCopyPtr()
-
getTaskIPtr
public com.artelys.kalis.SWIGTYPE_p_KTask_I getTaskIPtr()
-
setTaskIPtr
public void setTaskIPtr(com.artelys.kalis.SWIGTYPE_p_KTask_I taskIPtr)
-
-