Class FixedNodeSetsPartitioning
java.lang.Object
org.btrplace.scheduler.runner.disjoint.StaticPartitioning
org.btrplace.scheduler.runner.disjoint.FixedNodeSetsPartitioning
- All Implemented Interfaces:
InstanceSolver
- Direct Known Subclasses:
FixedSizePartitioning
public class FixedNodeSetsPartitioning extends StaticPartitioning
A partitioning algorithm to split an instance
into multiple disjoint sub-instances from a
specific node partitioning.
Running and sleeping VMs are spread on the sub-instances
depending on their current location while ready VMs are spread
evenly.
The SatConstraint
s are split when necessary using
splitters available through the ConstraintSplitterMapper
.
The OptConstraint
is re-used
for each sub-instance.
- Author:
- Fabien Hermenier
-
Constructor Summary
Constructors Constructor Description FixedNodeSetsPartitioning(Collection<Collection<Node>> parts)
Make a new partitioning algorithm. -
Method Summary
Modifier and Type Method Description Collection<Collection<Node>>
getPartitions()
Get the node partitions.ConstraintSplitterMapper
getSplitterMapper()
Get the mapper that is used to split the constraints.boolean
setPartitions(Collection<Collection<Node>> parts)
Set the node partitionsvoid
setSplitterMapper(ConstraintSplitterMapper m)
Set the mapper to use to split constraints.List<Instance>
split(Parameters ps, Instance i)
Split an instance into several disjoint instances.Methods inherited from class org.btrplace.scheduler.runner.disjoint.StaticPartitioning
getStatistics, getWorkersCount, setWorkersCount, solve, stop
-
Constructor Details
-
FixedNodeSetsPartitioning
Make a new partitioning algorithm. By default, the partition algorithm use theConstraintSplitterMapper
returned byConstraintSplitterMapper.newBundle()
.- Parameters:
parts
- the node partitions to rely on
-
-
Method Details
-
getSplitterMapper
Get the mapper that is used to split the constraints.- Returns:
- a mapper
-
setSplitterMapper
Set the mapper to use to split constraints.- Parameters:
m
- the mapper
-
getPartitions
Get the node partitions.- Returns:
- multiple collections of nodes
-
setPartitions
Set the node partitions- Parameters:
parts
- disjoint set of nodes- Returns:
true
iff the partitions have been set.false
if the sets were not disjoint
-
split
Description copied from class:StaticPartitioning
Split an instance into several disjoint instances.- Specified by:
split
in classStaticPartitioning
- Parameters:
ps
- the parameters for the solveri
- the instance to split- Returns:
- a list of disjoint instances. Cannot be empty.
- Throws:
SchedulerException
- if an error prevent the splitting process
-