Package com.artelys.kalis
Class KTask
- java.lang.Object
-
- com.artelys.kalis.KTask
-
public class KTask extends java.lang.Object
Tasks (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 boolean
swigCMemOwn
-
Constructor Summary
Constructors Modifier Constructor Description KTask()
Empty constructorprotected
KTask(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 void
constrainVars()
int
consumes(KResource resource)
State that this ressource consumes ( non-renewable ) one unit of resource
`resource`void
consumes(KResource resource, int consumption)
State that this ressource consumes ( non-renewable ) `consumption` unit
of resource `resource`
void
consumes(KResource resource, int consumptionmin, int consumptionmax)
State that this ressource consumes ( non-renewable ) between
`consumptionmin` and `consumptionmax` unit of resource `resource`
void
consumes(KResourceUsage resusage)
Add a resource usage consumption for this taskvoid
consumes(KResourceUsageArray resusagearray)
Add optional resources usages consumptions for this task and ensure that
between [min..max] of theses requirements are satisfiedvoid
consumes(KResourceUsageArray resusagearray, int min)
Add optional resources usages consumptions for this task and ensure that
between [min..max] of theses requirements are satisfiedvoid
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 satisfiedvoid
delete()
void
endsBefore(KTask task)
State that this task ends `delay` time unit before the completion of
the given `task`
void
endsBefore(KTask task, int delay)
State that this task ends `delay` time unit before the completion of
the given `task`
protected void
finalize()
KIntVar
getAssignmentVar(KResource r)
Return a pointer to the KIntVar representing the resource requirement of
this task for resource `r` if any or nullptrKIntVar
getConsumesVar(KResource r)
Return a pointer to the KIntVar representing the resource consumtion of
this task for resource `r` if any or nullptrKTask
getCopyPtr()
protected static long
getCPtr(KTask obj)
int
getDurationValue()
Return the constant duration of this task or the lowerbound if duration
is not constantKIntVar
getDurationVar()
Return a pointer to the KIntVar representing the duration of this taskint
getEarliestCompletionTime()
Return the earliest completion time of this taskint
getEarliestStartTime()
Return the earliest starting time of this taskKIntVar
getEndDateVar()
Return a pointer to the KIntVar representing the ending date of this taskint
getIndex()
Return the id of this taskint
getLatestCompletionTime()
Return the latest completion time of this taskint
getLatestStartTime()
Return the latest starting time of this taskint
getMaximalProduction(KResource resource, int tslot)
Return the maximal resource production for this task and the resource in
parameters at time step `tslot`int
getMaximalProvision(KResource resource, int tslot)
Return the maximal resource provision for this task and the resource in
parameters at time step `tslot`int
getMaximumDuration()
Return the maximum duration of this taskint
getMinimalConsumption(KResource resource, int tslot)
Return the minimal resource consumption for this task and the resource in
parameters at time step `tslot`int
getMinimalRequirement(KResource resource, int tslot)
Return the minimal resource requirement for this task and the resource in
parameters at time step `tslot`int
getMinimumDuration()
Return the minimum duration of this taskjava.lang.String
getName()
Return the name of this taskKIntVar
getProducesVar(KResource r)
Return a pointer to the KIntVar representing the resource production of
this task for resource `r` if any or nullptrKIntVar
getProvidesVar(KResource r)
Return a pointer to the KIntVar representing the resource provision of
this task for resource `r` if any or nullptrKIntVar
getRequiresVar(KResource r)
Return a pointer to the KIntVar representing the resource requirement of
this task for resource `r` if any or nullptrint
getResourceConsumption()
KSchedule
getSchedule()
Pretty printing of the task to stdoutint
getSetupTime(KTask task)
Return the setup time between the current task and the one passed in parameterKIntVar
getSizeVar(KResource r)
Return a pointer to the KIntVar representing the product requirement * durationKIntVar
getStartDateVar()
Return a pointer to the KIntVar representing the starting date of this
taskcom.artelys.kalis.SWIGTYPE_p_KTask_I
getTaskIPtr()
boolean
isFixed()
Return true IFF this task is fixed (Start,End,Duration, and
resource utilizations variables are instantiated)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
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
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
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
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
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
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
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
void
print()
Pretty printing the taskvoid
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 PrintFunctionPtrint
produces(KResource resource)
State that this ressource produces ( non-renewable ) one unit of resource
`resource`void
produces(KResource resource, int production)
State that this ressource produces ( non-renewable ) `production` unit of
resource `resource`
void
produces(KResource resource, int productionmin, int productionmax)
State that this ressource produces ( non-renewable ) between
`productionmin` and `productionmax` unit of resource `resource`
void
produces(KResourceUsage resusage)
Add a resource usage production for this taskvoid
produces(KResourceUsageArray resusagearray)
Add optional resources usages productions for this task and ensure that
between [min..max] of theses requirements are satisfiedvoid
produces(KResourceUsageArray resusagearray, int min)
Add optional resources usages productions for this task and ensure that
between [min..max] of theses requirements are satisfiedvoid
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 satisfiedint
provides(KResource resource)
State that this ressource provides ( renewable ) one unit of resource
`resource`void
provides(KResource resource, int provision)
State that this ressource provides ( renewable ) `provision` unit of
resource `resource`
void
provides(KResource resource, int provisionmin, int provisionmax)
State that this ressource provides ( renewable ) between `provisionmin`
and 'provisionmax unit of resource `resource`
void
provides(KResourceUsage resusage)
Add a resource usage provision for this taskvoid
provides(KResourceUsageArray resusagearray)
Add optional resources usages provisions for this task and ensure that
between [min..max] of theses requirements are satisfiedvoid
provides(KResourceUsageArray resusagearray, int min)
Add optional resources usages provisions for this task and ensure that
between [min..max] of theses requirements are satisfiedvoid
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 satisfiedint
requires(KResource resource)
State that this ressource requires ( renewable ) one unit of resource
`resource`void
requires(KResource resource, int requirement)
State that this ressource requires ( renewable ) `requirement` unit of
resource `resource`
void
requires(KResource resource, int requirementmin, int requirementmax)
State that this ressource requires ( renewable ) between `requirementmin`
and 'requirementmax unit of resource `resource`
void
requires(KResourceUsage resusage)
Add a resource usage requirement for this taskvoid
requires(KResourceUsageArray resusagearray)
Add optional resources usages requirements for this task and ensure that
between [min..max] of theses requirements are satisfiedvoid
requires(KResourceUsageArray resusagearray, int min)
Add optional resources usages requirements for this task and ensure that
between [min..max] of theses requirements are satisfiedvoid
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 satisfiedvoid
setDuration(int duration)
Set the duration of this task to `duration`void
setEarliestCompletionTime(int time)
Set the earliest completion time of this taskvoid
setEarliestStartTime(int time)
Set the earliest starting time of this taskvoid
setEndTime(int endTime)
Set the ending time of this task to `endTime`void
setIndex(int index)
void
setLatestCompletionTime(int time)
Set the latest completion time of this taskvoid
setLatestStartTime(int time)
Set the latest starting time of this taskvoid
setMaximumDuration(int durationmax)
Set the maximum duration of this taskvoid
setMinimumDuration(int durationmin)
Set the minimum duration of this taskvoid
setName(java.lang.String name)
Set the name of this taskvoid
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/aftervoid
setStartTime(int startTime)
Set the starting time of this task to `startTime`void
setTaskIPtr(com.artelys.kalis.SWIGTYPE_p_KTask_I taskIPtr)
void
startsAfter(KTask task)
State that this task starts `delay` time unit after the completion of
the given `task`
void
startsAfter(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:
finalize
in 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)
-
-