GetOutcomeIds(handle) does not work for value node

The engine.
Post Reply
sez
Posts: 11
Joined: Fri Jun 05, 2009 6:41 pm

GetOutcomeIds(handle) does not work for value node

Post by sez »

The following code is working for chance node but not working for Value Node

error:


foreach (int handle in net)
{
String[] outcomeIds = net.GetOutcomeIds(handle);
}

Could you tell me why or is there other method I can use?
Attachments
error message
error message
errormsg.GIF (13.04 KiB) Viewed 7367 times
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: GetOutcomeIds(handle) does not work for value node

Post by shooltz[BayesFusion] »

That's by design - the value nodes don't have outcomes. What are you trying to do?
sez
Posts: 11
Joined: Fri Jun 05, 2009 6:41 pm

value node

Post by sez »

We have several Chance nodes and Value nodes.

We need to get the value of Value Node
sez
Posts: 11
Joined: Fri Jun 05, 2009 6:41 pm

Post by sez »

Also, we need to read BN file and get all of those nodes(Chance, Value),
how to identify or distinguish change node and value before the method of
GetOutcomeIds?

If it is Chance node then
use GetOutcomeIds
else
use other method


foreach (int handle in net)
{

String[] outcomeIds = net.GetOutcomeIds(handle);
}
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Post by shooltz[BayesFusion] »

Try Network.GetNodeType method and Network.NodeType enum.
sez
Posts: 11
Joined: Fri Jun 05, 2009 6:41 pm

Post by sez »

Thanks

we have a couple of chance nodes and few value nodes.

What is the best way to get Value Node value

double expectedUtility = net.GetNodeValue("Node1");
??
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Post by shooltz[BayesFusion] »

sez wrote:What is the best way to get Value Node value

double[] expectedUtility = net.GetNodeValue("Node1");
sez
Posts: 11
Joined: Fri Jun 05, 2009 6:41 pm

Post by sez »

Thanks

One more thing.

I guess getting the value of MAU Node is as the same as the way get Value Node mentioned above?
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Post by shooltz[BayesFusion] »

sez wrote:I guess getting the value of MAU Node is as the same as the way get Value Node mentioned above?
Yes.
Post Reply