choco.cp.solver.constraints.global.tree.filtering
Class RemovalsAdvisor

java.lang.Object
  extended by choco.cp.solver.constraints.global.tree.filtering.RemovalsAdvisor

public class RemovalsAdvisor
extends Object


Field Summary
protected  boolean affiche
          boolean for debug and show a trace of the execution
protected  boolean afficheRemovals
          boolean that allow to display the removals trace
protected  boolean compatible
          check the compatibility of the udpate according to the constraint itself
protected  boolean filter
          true iff at least one valur is removed from the domain of a variable
protected  BitSet[] graphRem
          a bitset matrix that record the set of arcs to remove
protected static Logger LOGGER
           
protected  int maxObjective
          upper bound of the objective cost
protected  int maxprop
          upper bound of the number of proper trees
protected  int[] maxStart
          table of the maximum starting time from each node
protected  int maxtree
          upper bound of the number of trees
protected  int minObjective
          lower bound of the objective cost
protected  int minprop
          lower bound of the number of proper trees
protected  int[] minStart
          table of the minimum starting time from each node
protected  int mintree
          lower bound of the number of trees
protected  int nbNodes
          total number of nodes involved in the graph
protected  Node[] nodes
           
protected  Solver solver
          Choco solver embedding the tree constraint
protected  StructuresAdvisor struct
          structure advisor
protected  TreeSConstraint treeConst
          the tree constraint object that allow to access to the Choco solver functions like fail()
protected  TreeParameters treeParams
          attributes
protected  boolean updateNprop
          true iff the nproper variable is updated
protected  boolean updateNtree
          true iff the ntree variable is updated
protected  boolean updateObjective
          true iff the objective variable is updated
protected  boolean updateStart
          true iff a starting time from a node is updated
 
Constructor Summary
RemovalsAdvisor(Solver solver, TreeSConstraint treeConst, TreeParameters treeParams, StructuresAdvisor struct)
           
 
Method Summary
 void addRemoval(int[] arc)
           
 BitSet[] getGraphRem()
           
 void initialise()
          initialize the attributes of this class according to the current state of the variables
 boolean isFilter()
           
 void setMaxNProper(int val)
          update the upper bound of the nproper variable with the value val
 void setMaxNtree(int val)
          update the upper bound of the ntree variable with the value val
 void setMaxObjective(int val)
          update the upper bound of the objective variable with the value val
 void setMaxStart(int idx, int max)
          update the upper bound of the node idx with the value max
 void setMinNProper(int val)
          update the lower bound of the nproper variable with the value val
 void setMinNtree(int val)
          update the lower bound of the ntree variable with the value val
 void setMinObjective(int val)
          update the lower bound of the objective variable with the value val
 void setMinStart(int idx, int min)
          update the lower bound of the node idx with the value min
 void startRemovals()
          main method that synchronize the recorded value removals with the corresponding variables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final Logger LOGGER

affiche

protected boolean affiche
boolean for debug and show a trace of the execution


afficheRemovals

protected boolean afficheRemovals
boolean that allow to display the removals trace


compatible

protected boolean compatible
check the compatibility of the udpate according to the constraint itself


nbNodes

protected int nbNodes
total number of nodes involved in the graph


solver

protected Solver solver
Choco solver embedding the tree constraint


treeConst

protected TreeSConstraint treeConst
the tree constraint object that allow to access to the Choco solver functions like fail()


treeParams

protected TreeParameters treeParams
attributes


nodes

protected Node[] nodes

struct

protected StructuresAdvisor struct
structure advisor


mintree

protected int mintree
lower bound of the number of trees


maxtree

protected int maxtree
upper bound of the number of trees


minprop

protected int minprop
lower bound of the number of proper trees


maxprop

protected int maxprop
upper bound of the number of proper trees


minStart

protected int[] minStart
table of the minimum starting time from each node


maxStart

protected int[] maxStart
table of the maximum starting time from each node


minObjective

protected int minObjective
lower bound of the objective cost


maxObjective

protected int maxObjective
upper bound of the objective cost


graphRem

protected BitSet[] graphRem
a bitset matrix that record the set of arcs to remove


updateNtree

protected boolean updateNtree
true iff the ntree variable is updated


updateNprop

protected boolean updateNprop
true iff the nproper variable is updated


updateObjective

protected boolean updateObjective
true iff the objective variable is updated


updateStart

protected boolean updateStart
true iff a starting time from a node is updated


filter

protected boolean filter
true iff at least one valur is removed from the domain of a variable

Constructor Detail

RemovalsAdvisor

public RemovalsAdvisor(Solver solver,
                       TreeSConstraint treeConst,
                       TreeParameters treeParams,
                       StructuresAdvisor struct)
Parameters:
solver - the Choco problem who uses the current tree constraint.
treeConst - the current Choco constraint (because we have to access to constraints primitives)
treeParams - the input data structure available in the structure.inputStructure package.
struct - the advisor of the internal data structures
Method Detail

initialise

public void initialise()
initialize the attributes of this class according to the current state of the variables


startRemovals

public void startRemovals()
                   throws ContradictionException
main method that synchronize the recorded value removals with the corresponding variables

Throws:
ContradictionException

getGraphRem

public BitSet[] getGraphRem()
Returns:
the bitset matrix of the arc to remove

addRemoval

public void addRemoval(int[] arc)
Parameters:
arc - add the arc in the removal structure

setMinStart

public void setMinStart(int idx,
                        int min)
update the lower bound of the node idx with the value min

Parameters:
idx - idx of the node
min - new lower bound of the starting time

setMaxStart

public void setMaxStart(int idx,
                        int max)
update the upper bound of the node idx with the value max

Parameters:
idx - idx of the node
max - new upper bound of the starting time

setMaxNtree

public void setMaxNtree(int val)
                 throws ContradictionException
update the upper bound of the ntree variable with the value val

Parameters:
val - new upper bound of the ntree variable
Throws:
ContradictionException

setMinNtree

public void setMinNtree(int val)
                 throws ContradictionException
update the lower bound of the ntree variable with the value val

Parameters:
val - new lower bound of the ntree variable
Throws:
ContradictionException

setMaxNProper

public void setMaxNProper(int val)
                   throws ContradictionException
update the upper bound of the nproper variable with the value val

Parameters:
val - new upper bound of the nproper variable
Throws:
ContradictionException

setMinNProper

public void setMinNProper(int val)
                   throws ContradictionException
update the lower bound of the nproper variable with the value val

Parameters:
val - new lower bound of the nproper variable
Throws:
ContradictionException

setMaxObjective

public void setMaxObjective(int val)
                     throws ContradictionException
update the upper bound of the objective variable with the value val

Parameters:
val - new upper bound of the objective variable
Throws:
ContradictionException

setMinObjective

public void setMinObjective(int val)
                     throws ContradictionException
update the lower bound of the objective variable with the value val

Parameters:
val - new lower bound of the objective variable
Throws:
ContradictionException

isFilter

public boolean isFilter()
Returns:
true iff a value has been removed from the domain of a variable


Copyright © 2012. All Rights Reserved.