aGrUM  0.16.0
variableselector.h
Go to the documentation of this file.
1 
30 // =========================================================================
31 #ifndef GUM_VARIABLE_SELECTOR_H
32 #define GUM_VARIABLE_SELECTOR_H
33 // =========================================================================
35 #include <agrum/core/set.h>
36 // =========================================================================
38 // =========================================================================
39 
40 namespace gum {
41 
53  public:
54  // ==========================================================================
56  // ==========================================================================
58 
59  // ###################################################################
61  // ###################################################################
63 
64  // ###################################################################
66  // ###################################################################
68 
70 
71  // ==========================================================================
73  // ==========================================================================
75 
76  // ###################################################################
78  // ###################################################################
79  void updateScore(const DiscreteVariable* var,
80  double score,
81  double secondaryscore);
82  void downdateScore(const DiscreteVariable* var,
83  double score,
84  double secondaryscore);
85 
86 
87  // ###################################################################
89  // ###################################################################
90  const DiscreteVariable* select();
91 
92  bool isEmpty() { return __remainingVars.empty(); }
93 
94  void begin() { __rvi = __remainingVars.beginSafe(); }
95  bool hasNext() { return __rvi != __remainingVars.endSafe(); }
96  void next() { ++__rvi; }
97  const DiscreteVariable* current() { return *__rvi; }
98 
99  private:
100  void __addVar(const DiscreteVariable* var);
101  void __removeVar(const DiscreteVariable* var);
102 
106 
109 
113 
116 
119  };
120 
121 } // namespace gum
122 
123 #endif // GUM_VARIABLE_SELECTOR_H
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
HashTable< const DiscreteVariable *, double > __remainingVarsScore
HashTable associating to each variable its score.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
HashTable< const DiscreteVariable *, double > __remainingVarsOtherScore
HashTable associating to each variable its 2nd score.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Safe iterators for the Set classDevelopers may consider using Set<x>::iterator_safe instead of SetIte...
Definition: set.h:811
void downdateScore(const DiscreteVariable *var, double score, double secondaryscore)
The set of remaining vars to select among.
Base class for discrete random variable.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
SetIteratorSafe< const DiscreteVariable *> __rvi
The set of remaining vars to select among.
MultiPriorityQueue< double, double, std::greater< double > > __remainingScores
Heap keeping best score on top for immediate access.
The class for generic Hash Tables.
Definition: hashTable.h:679
Representation of a setA Set is a structure that contains arbitrary elements.
Definition: set.h:165
void begin()
The set of remaining vars to select among.
~VariableSelector()
Default destructor.
Set< const DiscreteVariable *> __remainingVars
The set of remaining vars to select among.
void __removeVar(const DiscreteVariable *var)
The set of remaining vars to select among.
bool hasNext()
The set of remaining vars to select among.
const DiscreteVariable * select()
Select the most relevant variable.
void __addVar(const DiscreteVariable *var)
The set of remaining vars to select among.
<agrum/FMDP/planning/FunctionGraph/variableselector.h>
bool isEmpty()
The set of remaining vars to select among.
void updateScore(const DiscreteVariable *var, double score, double secondaryscore)
The set of remaining vars to select among.
void next()
The set of remaining vars to select among.
HashTable< double, Set< const DiscreteVariable *> *> __remainingVarsByScore
HashTable associating to each score the set of variable having that score.
const DiscreteVariable * current()
The set of remaining vars to select among.
VariableSelector(Set< const DiscreteVariable * > &startingSet)
Default constructor.
A MultiPriorityQueue is a heap in which each element has a mutable priority and duplicates are allowe...