Compile Error: SMILE Tutorial Code 2

The engine.
Post Reply
makneed
Posts: 2
Joined: Thu Oct 11, 2012 12:55 pm

Compile Error: SMILE Tutorial Code 2

Post by makneed »

I'm very new to SMILE and Genie and I'm going through the Tutorials in the documentation. I'm trying to do a task similar to what is shown in SMILE Tutorial Code 2; Performing Inference with a Bayesian Network so I figured that I should just plug the code from the tutorial and apply it straight to my project.

Here's the section of the code that I added, which is essentially the same as that in Tutorial Code 2 except that I changed some variable names:

DSL_network theNet;
theNet.ReadFile("3rdTry.xdsl");

theNet.SetDefaultBNAlgorithm(DSL_ALG_BN_LAURITZEN);

theNet.UpdateBeliefs();

int Size = theNet.FindNode("Size");

DSL_sysCoordinates theCoordinates(*theNet.Getnode(Size)->Value());
DSL_idArray *theNames;
theNames = theNet.GetNode(Size)->Definition()->GetOutcomesNames();
int s02Index = theNames->FindPosition("S02");
theCoordinates[0] = s02Index;
theCoordinates.GoToCurrentPosition();

double P_SizeS02 = theCoordinates.UncheckedValue();
cout << "Size: S02: Probability: " << P_SizeS02 << "\n";

When I compiled, I got errors as follows:

1>------ Build started: Project: Loadimage, Configuration: Release Win32 ------
1>Compiling...
1>HGASolder2.cpp
1>.\HGASolder2.cpp(51) : error C2039: 'Getnode' : is not a member of 'DSL_network'
1> e:\cw mak\personal\ait masters\wave v\my-research\loadimage\network.h(160) : see declaration of 'DSL_network'
1>.\HGASolder2.cpp(51) : error C2227: left of '->Value' must point to class/struct/union/generic type

Can someone help explain a little?

Thanks.
makneed
Posts: 2
Joined: Thu Oct 11, 2012 12:55 pm

Re: Compile Error: SMILE Tutorial Code 2

Post by makneed »

Sorry, my error. I found my silly mistake; I must be too tired.

I found the spelling mistake - Getnode; instead it should be GetNode. Silly spelling mistake.
shooltz[BayesFusion]
Site Admin
Posts: 1461
Joined: Mon Nov 26, 2007 5:51 pm

Re: Compile Error: SMILE Tutorial Code 2

Post by shooltz[BayesFusion] »

makneed wrote:Sorry, my error. I found my silly mistake; I must be too tired.
No problem - don't hesitate to post any questions/comments on the forum.
Post Reply