hi!
this is my first time programming, and i'm trying do write a program that updates with observation an existing .xdsl network that i previously created with genie.
this is the code, i don't have the input data so i can't try it.
what about setting evidence? is it the right function?
i'm calling nodes by their names, but if i knew how they're ordered i could use a counter...
sorry for the simplicity of the question but i don't have a lot of informatic background, but i hope bayesian approach can explain the physical phenomena i'm studying
kiara
set evidence
-
- Posts: 6
- Joined: Wed Jul 22, 2009 11:37 am
set evidence
- Attachments
-
- prog_smile_prova.c
- (2.2 KiB) Downloaded 370 times
-
- Site Admin
- Posts: 1420
- Joined: Mon Nov 26, 2007 5:51 pm
Re: set evidence
You should use DSL_network::FindNode to translate node identifier (case-sensitive) to node handle, then call SetEvidence:
Note that for discrete nodes the argument passed to SetEvidence should be an integer, 0-based index of the node outcome.
Code: Select all
int handle = theNet.FindNode("ZA_Corr");
assert(handle >= 0);
theNet.GetNode(handle)->Value()->SetEvidence(par1);