Class MaxOnline

java.lang.Object
org.btrplace.model.constraint.SimpleConstraint
org.btrplace.model.constraint.MaxOnline
All Implemented Interfaces:
Constraint, SatConstraint

@SideConstraint(args={"ns <: nodes","nb : int"},
                inv="card({i. i : ns , nodeState(i) = online}) <= nb")
public class MaxOnline
extends SimpleConstraint
A constraint to force a set of nodes to have a maximum number of nodes to be online.

In discrete restriction mode, the constraint only ensures that the set of nodes have at most n nodes being online at by end of the reconfiguration process. The set of nodes may have more number than n nodes being online in the reconfiguration process.

In continuous restriction mode, a boot node action is performed only when the number of online nodes is smaller than n.

Author:
Tu Huynh Dang
  • Constructor Details

    • MaxOnline

      public MaxOnline​(Set<Node> nodes, int n, boolean continuous)
      Make a new constraint specifying restriction explicitly.
      Parameters:
      nodes - The set of nodes
      n - The maximum number of online nodes
      continuous - true for continuous restriction
    • MaxOnline

      public MaxOnline​(Set<Node> nodes, int n)
      Make a new discrete constraint.
      Parameters:
      nodes - the set of nodes
      n - the maximum number of online nodes
  • Method Details