Class SliceBuilder

java.lang.Object
org.btrplace.scheduler.choco.SliceBuilder

public class SliceBuilder
extends Object
A tool to help at the instantiation of Slices.

By default, the slice starts at ReconfigurationProblem.getStart() and ends at ReconfigurationProblem.getEnd() and can be hosted on any node declared in the origin model.

Author:
Fabien Hermenier
  • Constructor Details

    • SliceBuilder

      public SliceBuilder​(ReconfigurationProblem p, VM v, Object... prefix)
      Make a new Builder.
      Parameters:
      p - the problem to customize
      v - the VM associated to the slice
      prefix - the label prefix for the variables
  • Method Details

    • build

      public Slice build() throws SchedulerException
      Build the slice.
      Returns:
      the resulting slice
      Throws:
      SchedulerException - if an error occurred
    • setStart

      public SliceBuilder setStart​(org.chocosolver.solver.variables.IntVar st)
      Set the moment the slice consume.
      Parameters:
      st - the variable to use
      Returns:
      the current builder
    • setEnd

      public SliceBuilder setEnd​(org.chocosolver.solver.variables.IntVar e)
      Set the moment the slice ends.
      Parameters:
      e - the variable to use
      Returns:
      the current builder
    • setDuration

      public SliceBuilder setDuration​(org.chocosolver.solver.variables.IntVar d)
      Set the duration of the slice.
      Parameters:
      d - the variable to use
      Returns:
      the current builder
    • setHoster

      public SliceBuilder setHoster​(org.chocosolver.solver.variables.IntVar h)
      Set the hoster.
      Parameters:
      h - the variable to use
      Returns:
      the current builder
    • setHoster

      public SliceBuilder setHoster​(int v)
      Set the hoster to a specific value
      Parameters:
      v - the node index
      Returns:
      the current builder