hello ,this is my program:
for(int n=1;n<=x;n++)
{
printf("请输入证据节点名称");
char str[10];
cin>>str;
int num=atoi(str);
cout<<num;
theNet.GetNode(num)->Value()->SetEvidence(0);
};
I want to enter which node, which node is set to have occurred. but it does not work.
what should i do?
Data type conversion
-
- Site Admin
- Posts: 1422
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Data type conversion
I believe the intent of your program is to read integers from the standard input and uses these integers as node handles for node lookup, then set 0th node outcome as evidence.I want to enter which node, which node is set to have occurred. but it does not work.
I'd suggest going through Tutorial 2 (Inference with a Bayesian Network) in SMILE manual. The code in the tutorial shows how to specify evidence in the node.