Data type conversion

The engine.
Post Reply
Gary
Posts: 40
Joined: Thu Nov 17, 2016 2:38 am

Data type conversion

Post by Gary »

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?
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Data type conversion

Post by shooltz[BayesFusion] »

I want to enter which node, which node is set to have occurred. but it does not work.
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'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.
Post Reply