Remove unnecessary methods
This commit is contained in:
parent
7d9af75c35
commit
3363019c93
@ -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
|
void
|
||||||
Var::setEvidence (int ev)
|
Var::setEvidence (int evidence)
|
||||||
{
|
{
|
||||||
assert (ev < (int) range_);
|
assert (evidence < (int) range_);
|
||||||
evidence_ = ev;
|
evidence_ = evidence;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,12 +59,8 @@ class Var
|
|||||||
|
|
||||||
bool isValidState (int);
|
bool isValidState (int);
|
||||||
|
|
||||||
bool isValidState (const string&);
|
|
||||||
|
|
||||||
void setEvidence (int);
|
void setEvidence (int);
|
||||||
|
|
||||||
void setEvidence (const string&);
|
|
||||||
|
|
||||||
string label (void) const;
|
string label (void) const;
|
||||||
|
|
||||||
States states (void) const;
|
States states (void) const;
|
||||||
|
Reference in New Issue
Block a user