set evidence

The engine.
Post Reply
kiara_madrid
Posts: 6
Joined: Wed Jul 22, 2009 11:37 am

set evidence

Post by kiara_madrid »

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
Attachments
prog_smile_prova.c
(2.2 KiB) Downloaded 370 times
shooltz[BayesFusion]
Site Admin
Posts: 1420
Joined: Mon Nov 26, 2007 5:51 pm

Re: set evidence

Post by shooltz[BayesFusion] »

You should use DSL_network::FindNode to translate node identifier (case-sensitive) to node handle, then call SetEvidence:

Code: Select all

int handle = theNet.FindNode("ZA_Corr");
assert(handle >= 0);
theNet.GetNode(handle)->Value()->SetEvidence(par1);
Note that for discrete nodes the argument passed to SetEvidence should be an integer, 0-based index of the node outcome.
Post Reply