This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/CLPBN/clpbn/bp/BifTest.cpp
2011-02-23 15:31:56 +00:00

37 lines
999 B
C++

#include <iostream>
#include "BayesianNetwork.h"
#include "BayesianNode.h"
#include "BpNetwork.h"
#include "BpNode.h"
#include "BifInterface.h"
using namespace std;
int main (int argc, char* argv[])
{
BpNetwork bn;
// BayesianNetwork bn;
BifInterface::createNetworkFromXML (&bn, argv[1]);
bn.printNetwork();
// bn.getNode("FreightTruck")->setEvidence (0);
// bn.getNode("Alarm")->setEvidence (0);
// bn.setSolverParameters (SEQUENTIAL_SCHEDULE, 500, 0.001);
// bn.setSolverParameters (PARALLEL_SCHEDULE, 500, 0.00000000000001);
// bn.setSolverParameters (PARALLEL_SCHEDULE, 500, 0.0000000000000000000001);
//bn.getNode ("F")->setEvidence (0);
vector<BayesianNode*> queryVars;
//queryVars.push_back (bn.getNode ("D"));
//queryVars.push_back (bn.getNode ("Burglar"));
queryVars.push_back (bn.getNode ("FreightTruck"));
queryVars.push_back (bn.getNode ("Alarm"));
bn.runSolver (queryVars);
// bn.printCurrentStatus();
// bn.printBeliefs();
return 0;
}