Class CPowerView
java.lang.Object
org.btrplace.scheduler.choco.view.CPowerView
- All Implemented Interfaces:
Injectable
,MisplacedVMsEstimator
,ChocoView
public class CPowerView extends Object implements ChocoView
A solver-side view to store variables that
indicate the moment a node is powered on or off.
User: Tu Huynh Dang Date: 6/4/13 Time: 9:17 PM
-
Field Summary
-
Constructor Summary
Constructors Constructor Description CPowerView()
-
Method Summary
Modifier and Type Method Description boolean
beforeSolve(ReconfigurationProblem rp)
An event that is send to indicate a RP will be solved.String
getIdentifier()
Get the view unique identifier.org.chocosolver.solver.variables.IntVar
getPowerEnd(int idx)
Get the moment a given node is off.org.chocosolver.solver.variables.IntVar
getPowerStart(int idx)
Get the moment a given node is on.boolean
inject(Parameters ps, ReconfigurationProblem rp)
Inject the constraint into the problem.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.btrplace.scheduler.choco.view.ChocoView
cloneVM, getDependencies, getMisPlacedVMs, insertActions
-
Field Details
-
VIEW_ID
The view identifier.- See Also:
- Constant Field Values
-
-
Constructor Details
-
CPowerView
public CPowerView()
-
-
Method Details
-
inject
Description copied from interface:Injectable
Inject the constraint into the problem.- Specified by:
inject
in interfaceInjectable
- Parameters:
ps
- the scheduler parametersrp
- the problem- Returns:
true
if the injection succeeded,false
if the problem is sure to not have a solution- Throws:
SchedulerException
- if an error occurred while injecting.
-
getPowerStart
public org.chocosolver.solver.variables.IntVar getPowerStart(int idx)Get the moment a given node is on.- Parameters:
idx
- the node index- Returns:
- the variable denoting the moment
-
getPowerEnd
public org.chocosolver.solver.variables.IntVar getPowerEnd(int idx)Get the moment a given node is off.- Parameters:
idx
- the node index- Returns:
- the variable denoting the moment.
-
getIdentifier
Description copied from interface:ChocoView
Get the view unique identifier.- Specified by:
getIdentifier
in interfaceChocoView
- Returns:
- a non-empty String
-
beforeSolve
Description copied from interface:ChocoView
An event that is send to indicate a RP will be solved. The view can then customize the RP a last time.- Specified by:
beforeSolve
in interfaceChocoView
- Parameters:
rp
- the problem we solve- Returns:
false
iff there will be no solution to the RP.
-