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 Details

  • Constructor Details

  • Method Details

    • inject

      public boolean inject​(Parameters ps, ReconfigurationProblem rp) throws SchedulerException
      Description copied from interface: Injectable
      Inject the constraint into the problem.
      Specified by:
      inject in interface Injectable
      Parameters:
      ps - the scheduler parameters
      rp - 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

      public String getIdentifier()
      Description copied from interface: ChocoView
      Get the view unique identifier.
      Specified by:
      getIdentifier in interface ChocoView
      Returns:
      a non-empty String
    • beforeSolve

      public boolean beforeSolve​(ReconfigurationProblem rp)
      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 interface ChocoView
      Parameters:
      rp - the problem we solve
      Returns:
      false iff there will be no solution to the RP.