diff --git a/packages/CLPBN/horus/Var.cpp b/packages/CLPBN/horus/Var.cpp index f84257585..99540718a 100644 --- a/packages/CLPBN/horus/Var.cpp +++ b/packages/CLPBN/horus/Var.cpp @@ -36,35 +36,11 @@ Var::isValidState (int stateIndex) -bool -Var::isValidState (const string& stateName) -{ - States states = Var::getVarInfo (varId_).states; - return Util::contains (states, stateName); -} - - - void -Var::setEvidence (int ev) +Var::setEvidence (int evidence) { - assert (ev < (int) range_); - evidence_ = ev; -} - - - -void -Var::setEvidence (const string& ev) -{ - States states = Var::getVarInfo (varId_).states; - for (size_t i = 0; i < states.size(); i++) { - if (states[i] == ev) { - evidence_ = i; - return; - } - } - assert (false); + assert (evidence < (int) range_); + evidence_ = evidence; } diff --git a/packages/CLPBN/horus/Var.h b/packages/CLPBN/horus/Var.h index d1b3461ac..3ae6eeed8 100644 --- a/packages/CLPBN/horus/Var.h +++ b/packages/CLPBN/horus/Var.h @@ -59,12 +59,8 @@ class Var bool isValidState (int); - bool isValidState (const string&); - void setEvidence (int); - void setEvidence (const string&); - string label (void) const; States states (void) const;