Package org.btrplace.scheduler.choco
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 Summary
Constructors Constructor Description SliceBuilder(ReconfigurationProblem p, VM v, Object... prefix)
Make a new Builder. -
Method Summary
Modifier and Type Method Description Slice
build()
Build the slice.SliceBuilder
setDuration(org.chocosolver.solver.variables.IntVar d)
Set the duration of the slice.SliceBuilder
setEnd(org.chocosolver.solver.variables.IntVar e)
Set the moment the slice ends.SliceBuilder
setHoster(int v)
Set the hoster to a specific valueSliceBuilder
setHoster(org.chocosolver.solver.variables.IntVar h)
Set the hoster.SliceBuilder
setStart(org.chocosolver.solver.variables.IntVar st)
Set the moment the slice consume.
-
Constructor Details
-
SliceBuilder
Make a new Builder.- Parameters:
p
- the problem to customizev
- the VM associated to the sliceprefix
- the label prefix for the variables
-
-
Method Details
-
build
Build the slice.- Returns:
- the resulting slice
- Throws:
SchedulerException
- if an error occurred
-
setStart
Set the moment the slice consume.- Parameters:
st
- the variable to use- Returns:
- the current builder
-
setEnd
Set the moment the slice ends.- Parameters:
e
- the variable to use- Returns:
- the current builder
-
setDuration
Set the duration of the slice.- Parameters:
d
- the variable to use- Returns:
- the current builder
-
setHoster
Set the hoster.- Parameters:
h
- the variable to use- Returns:
- the current builder
-
setHoster
Set the hoster to a specific value- Parameters:
v
- the node index- Returns:
- the current builder
-