85 double secondaryscore) {
97 double secondaryscore) {
112 for (
auto varIter = bestSet->
beginSafe(); varIter != bestSet->
endSafe(); ++varIter) {
113 if (bestVar ==
nullptr
116 && bestVar->
domainSize() < (*varIter)->domainSize()))
144 if (varSet->
empty()) {
Base class for discrete random variable.
virtual Size domainSize() const =0
iterator_safe beginSafe() const
The usual safe begin iterator to parse the set.
const iterator_safe & endSafe() const noexcept
The usual safe end iterator to parse the set.
bool empty() const noexcept
Indicates whether the set is the empty set.
HashTable< const DiscreteVariable *, double > _remainingVarsScore_
HashTable associating to each variable its score.
void _removeVar_(const DiscreteVariable *var)
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 downdateScore(const DiscreteVariable *var, double score, double secondaryscore)
The set of remaining vars to select among.
~VariableSelector()
Default destructor.
VariableSelector(const gum::VariableSet &startingSet)
Default constructor.
gum::VariableSet _remainingVars_
The set of remaining vars to select among.
const DiscreteVariable * select()
Select the most relevant variable.
HashTable< const DiscreteVariable *, double > _remainingVarsOtherScore_
HashTable associating to each variable its 2nd score.
MultiPriorityQueue< double, double, std::greater< double > > _remainingScores_
Heap keeping best score on top for immediate access.
void _addVar_(const DiscreteVariable *var)
The set of remaining vars to select among.
HashTable< double, gum::VariableSet * > _remainingVarsByScore_
HashTable associating to each score the set of variable having that score.
gum is the global namespace for all aGrUM entities
Set< const DiscreteVariable * > VariableSet
Headers of the Variable Selector class.