Commit d89d784a authored by Davis King's avatar Davis King

Just added a try/catch block around the whole program.

parent cbcb80bf
......@@ -51,6 +51,8 @@ using namespace std;
int main()
{
try
{
// There are many useful convenience functions in this namespace. They all
// perform simple access or modify operations on the nodes of a bayesian network.
// You don't have to use them but they are convenient and they also will check for
......@@ -291,6 +293,15 @@ int main()
cout << "p(B=1 | C=1) = " << (double)B_count/(double)rounds << endl;
cout << "p(C=1 | C=1) = " << (double)C_count/(double)rounds << endl;
cout << "p(D=1 | C=1) = " << (double)D_count/(double)rounds << endl;
}
catch (std::exception& e)
{
cout << "exception thrown: " << endl;
cout << e.what() << endl;
cout << "hit enter to terminate" << endl;
cin.get();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment