Class StaticPartitioning
java.lang.Object
org.btrplace.scheduler.runner.disjoint.StaticPartitioning
- All Implemented Interfaces:
InstanceSolver
- Direct Known Subclasses:
FixedNodeSetsPartitioning
public abstract class StaticPartitioning extends Object implements InstanceSolver
An abstract solver that decompose statically an instance
into multiple disjoint sub-instances than are solved in parallel.
The resulting reconfiguration plan is composed by all the sub reconfiguration plans. Each sub-instance must then have a solution.
The solving process relies on a master/worker paradigm with a number of workers equals to the number of available cores by default.
- Author:
- Fabien Hermenier
-
Constructor Summary
Constructors Constructor Description StaticPartitioning()
Make a new partitioning algorithm. -
Method Summary
Modifier and Type Method Description StaticPartitioningStatistics
getStatistics()
Return the statistics of the solving process.int
getWorkersCount()
Get the number of workers that are used to solve instances.void
setWorkersCount(int s)
Set the number of workers that solve instances.ReconfigurationPlan
solve(Parameters cra, Instance orig)
Solve an instance.abstract List<Instance>
split(Parameters ps, Instance i)
Split an instance into several disjoint instances.void
stop()
Stop the solving process.
-
Constructor Details
-
StaticPartitioning
public StaticPartitioning()Make a new partitioning algorithm. The number of workers is set to the number of available cores.
-
-
Method Details
-
getWorkersCount
public int getWorkersCount()Get the number of workers that are used to solve instances.- Returns:
- a number >= 1
-
setWorkersCount
public void setWorkersCount(int s)Set the number of workers that solve instances.- Parameters:
s
- a number >= 1
-
solve
Description copied from interface:InstanceSolver
Solve an instance.- Specified by:
solve
in interfaceInstanceSolver
- Parameters:
cra
- the parameters to considerorig
- the instance to solve- Returns:
- the resulting reconfiguration plan,
null
if there is no solution - Throws:
SchedulerException
- if an error prevent from running a solving process
-
getStatistics
Description copied from interface:InstanceSolver
Return the statistics of the solving process.- Specified by:
getStatistics
in interfaceInstanceSolver
- Returns:
- some statistics
-
split
Split an instance into several disjoint instances.- 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
-
stop
public void stop()Description copied from interface:InstanceSolver
Stop the solving process.- Specified by:
stop
in interfaceInstanceSolver
-