Class KTask

java.lang.Object
com.artelys.kalis.KTask

public class KTask extends 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
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    Empty constructor
    protected
    KTask​(long cPtr, boolean cMemoryOwn)
     
     
    KTask​(KSchedule schedule)
    Basic constructor
     
    KTask​(KSchedule s, String name)
    Primary constructor

     
    KTask​(KSchedule s, String name, int duration)
    Copy constructor

     
    KTask​(KSchedule s, String name, int smin, int smax, int dmin, int dmax)
    Constructor with min/max value for start time and duration

     
    KTask​(KSchedule s, String name, int duration, KResource r)
    Constructor with fixed duration and unary resource usage

     
    KTask​(KSchedule s, String name, KResource r, int consumption)
     
     
    KTask​(KTask toCopy)
    Copy constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    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 task
    void
    consumes​(KResourceUsageArray resusagearray)
    Add optional resources usages consumptions for this task and ensure that
    between [min..max] of theses requirements are satisfied
    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
    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
    void
     
    protected void
     
    Return a pointer to the KIntVar representing the resource requirement of
    this task for resource `r` if any or nullptr
    Return a pointer to the KIntVar representing the resource consumtion of
    this task for resource `r` if any or nullptr
     
    protected static long
    getCPtr​(KTask obj)
     
    int
    Return the constant duration of this task or the lowerbound if duration
    is not constant
    Return a pointer to the KIntVar representing the duration of this task
    int
    Return the earliest completion time of this task
    int
    Return the earliest starting time of this task
    Return a pointer to the KIntVar representing the ending date of this task
    int
    Return the id of this task
    int
    Return the latest completion time of this task
    int
    Return the latest starting time of this task
    int
    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
    Return the maximum duration of this task
    int
    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
    Return the minimum duration of this task
    Return the name of this task
    Return a pointer to the KIntVar representing the resource production of
    this task for resource `r` if any or nullptr
    Return a pointer to the KIntVar representing the resource provision of
    this task for resource `r` if any or nullptr
    Return a pointer to the KIntVar representing the resource requirement of
    this task for resource `r` if any or nullptr
    int
     
    Pretty printing of the task to stdout
    int
    Return the setup time between the current task and the one passed in parameter
    Return a pointer to the KIntVar representing the product requirement * duration
    Return a pointer to the KIntVar representing the starting date of this
    task
    com.artelys.kalis.SWIGTYPE_p_KTask_I
     
    boolean
    Return true IFF this task is fixed (Start,End,Duration, and
    resource utilizations variables are instantiated)
    void
    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
    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
    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
    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
     
    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
    int
    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 task
    void
    produces​(KResourceUsageArray resusagearray)
    Add optional resources usages productions for this task and ensure that
    between [min..max] of theses requirements are satisfied
    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
    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
    int
    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 task
    void
    provides​(KResourceUsageArray resusagearray)
    Add optional resources usages provisions for this task and ensure that
    between [min..max] of theses requirements are satisfied
    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
    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
    int
    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 task
    void
    requires​(KResourceUsageArray resusagearray)
    Add optional resources usages requirements for this task and ensure that
    between [min..max] of theses requirements are satisfied
    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
    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
    void
    setDuration​(int duration)
    Set the duration of this task to `duration`
    void
    Set the earliest completion time of this task
    void
    setEarliestStartTime​(int time)
    Set the earliest starting time of this task
    void
    setEndTime​(int endTime)
    Set the ending time of this task to `endTime`
    void
    setIndex​(int index)
     
    void
    Set the latest completion time of this task
    void
    setLatestStartTime​(int time)
    Set the latest starting time of this task
    void
    setMaximumDuration​(int durationmax)
    Set the maximum duration of this task
    void
    setMinimumDuration​(int durationmin)
    Set the minimum duration of this task
    void
    setName​(String name)
    Set the name of this task
    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
    void
    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
    task `task`

    void
    startsAfter​(KTask task, int delay)
    State that this task starts `delay` time unit after the completion of
    task `task`

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • swigCMemOwn

      protected transient boolean swigCMemOwn
  • Constructor Details

    • KTask

      protected KTask(long cPtr, boolean cMemoryOwn)
    • KTask

      public KTask()
      Empty constructor
    • KTask

      public KTask(KSchedule schedule)
      Basic constructor
    • KTask

      public KTask(KSchedule s, String name)
      Primary constructor

      Parameters:
      s - the schedule
      name - string representing the name of the task
    • KTask

      public KTask(KSchedule s, String name, int smin, int smax, int dmin, int dmax)
      Constructor with min/max value for start time and duration

      Parameters:
      s - the schedule
      name - string representing the name of the task
    • KTask

      public KTask(KSchedule s, String name, int duration)
      Copy constructor

      Parameters:
      s - the schedule
      name - string representing the name of the task
    • KTask

      public KTask(KSchedule s, String name, int duration, KResource r)
      Constructor with fixed duration and unary resource usage

      Parameters:
      s - the schedule
      name - string representing the name of the task
      duration - fixed task duration
      r - the resource required by the task
    • KTask

      public KTask(KSchedule s, String name, KResource r, int consumption)
      Parameters:
      s - the schedule
      name - string representing the name of the task
    • KTask

      public KTask(KTask toCopy)
      Copy constructor
  • Method Details

    • getCPtr

      protected static long getCPtr(KTask obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • delete

      public void delete()
    • getSchedule

      public KSchedule getSchedule()
      Pretty printing of the task to stdout
    • print

      public void print()
    • 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 resource
      requirement - 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 resource
      consumption - 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 resource
      provision - 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 resource
      production - 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 resource
      requirementmin - the minimal resource requirement
      requirementmax - 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 resource
      consumptionmin - the minimal resource consumption
      consumptionmax - 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 resource
      provisionmin - the minimal resource provision
      provisionmax - 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 resource
      productionmin - the minimal resource production
      productionmax - 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
      task `task`

      Parameters:
      task - the task before the current task
      delay - 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
      task `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 task
      Max - 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 task
      Max - 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 task
      Min - 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 task
      Min - 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 String getName()
      Return the name of this task
    • setName

      public void setName(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
    • getAffectationVar

      public KIntVar getAffectationVar(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)