Author Topic: software for decisions with microsoft visual c++  (Read 30280 times)

Offline amuizzc

  • Newbie
  • *
  • Posts: 5
    • View Profile
software for decisions with microsoft visual c++
« on: March 23, 2009, 11:48:06 »
Hi I'm Antonio,
i've just created a software in microsoft visual c++ 2005 for decisions with a series of if-then-else.
Now i wanna substitute this kind of decisions system with a bayesian network using hugin.
How i can do it? How i can use Hugin with microsoft visual c++ (2005 or 2008 doesen't matter)?
Have you some code examples to do this? Some guides or tutorials?
Thank you very much
Regards
Antonio

Offline Martin

  • HUGIN Expert
  • Hero Member
  • *****
  • Posts: 613
    • View Profile
Re: software for decisions with microsoft visual c++
« Reply #1 on: March 24, 2009, 17:58:46 »
Quote
How i can use Hugin with microsoft visual c++ (2005 or 2008 doesen't matter)?
The Hugin C++ API provides files for both VS2005 and VS2008 (located in <hugin-install-dir>\VC8 for VS2005 and \VC9 for VS2008). For instructions on how to set up a C++ project with Hugin in Visual Studio please refer to the API Manual (pdf-file) section 1.3 "Using the HUGIN API on Windows Platforms".

Quote
Have you some code examples to do this? Some guides or tutorials?
The C++ API Documentation contains a number of examples.
Hugin Expert A/S

Offline amuizzc

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: software for decisions with microsoft visual c++
« Reply #2 on: April 25, 2009, 01:12:15 »
Hi Martin,
first, thanks for the response!
Then, i've implemented my bn with hugin, i've posted for you my file here: http://digilander.libero.it/thuglupin/BN.rar

Now i wanna manage my net with visual c++ 2008 e.d. in the sense that i wanna create a windows form with 4 combobox where can choose the states of Categoria_Utente, Conoscenza_Utente, Posizione_Utente, Azione_Utente.
Successively to the choice, i wanna display in a box (doesen't matter what kind), the states chosen by the BN for Attitudine_Affettiva, Goal, Attitudine_Sociale.
But i don't know how to manage the BN with visual c++ 2008 e.d.
Help me please!
Thank you very very much!
Antonio
« Last Edit: April 25, 2009, 23:22:32 by amuizzc »

Offline amuizzc

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: software for decisions with microsoft visual c++
« Reply #3 on: April 25, 2009, 23:22:06 »
please help me! ???

Offline Martin

  • HUGIN Expert
  • Hero Member
  • *****
  • Posts: 613
    • View Profile
Re: software for decisions with microsoft visual c++
« Reply #4 on: April 27, 2009, 10:38:11 »
For Visual Studio 2008 you should use the library files in <hugin-install-dir>\HDE7.1CPP\Lib\VC9.

The API reference manual contains information on the steps needed to to set up Visual Studio for using the Hugin APIs. (See section 1.3 Using the HUGIN API on Windows Platforms).

You can also take a look at the C++ test code in <hugin-install-dir>\Test.
The Hugin C++ Doxygen documentation contains a number of C++ examples with code.

Here is a list of Hugin C++ functions I think you will need for this solution - you should check them out in the documentation as well:

Getting nodes and states:
HAPI::NetworkModel::getNodes
HAPI::DiscreteNode::getNumberOfStates
HAPI::DiscreteNode::getStateLabel

Entering evidence:
HAPI::DiscreteNode::selectState

Reading beliefs:
HAPI::DiscreteNode::getBelief
Hugin Expert A/S

Offline amuizzc

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: software for decisions with microsoft visual c++
« Reply #5 on: April 27, 2009, 16:12:46 »
thanks a lot Martin,
but i've some problems: the API reference manual contains information on the steps needed to to set up Visual Studio for using the Hugin APIs, but the one i've is only for c# and not for visual c++, have you the link where i can find it? then where i can find The Hugin C++ Doxygen documentation? and what's Hugin C++ Doxygen?
Thanks
Antonio A.

Offline Martin

  • HUGIN Expert
  • Hero Member
  • *****
  • Posts: 613
    • View Profile
Re: software for decisions with microsoft visual c++
« Reply #6 on: May 01, 2009, 11:02:33 »
The C++ documentation can be found here:
<hugin-install-dir>\HDE7.1CPP\Doc\index.html
and by clicking through the Windows Start menu:
Start -> Programs -> Hugin 7.1 - > Hugin C++ API 7.1 Help

The Hugin API reference manual:
<hugin-install-dir>\HDE7.1C\Doc\api-manual.pdf
Or from start menu:
Start -> Programs -> Hugin 7.1 - > Hugin C API 7.1 Help

If you read a little further in the Hugin API reference manual (the PDF file) from section 1.3 "Using the HUGIN API on Windows platforms" you will find information on setting up C++ environment in visual studio.

Doxygen is a tool that generates documentation based on C++ code. We have used it to genete documentation for the classes in the Hugin C++ API.
Hugin Expert A/S

Offline bmquan80

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: software for decisions with microsoft visual c++
« Reply #7 on: January 11, 2010, 19:20:18 »
I meet error, when I try to do example1 on hugin c++ API 6.6 is "fatal error LNK1104: cannot open file 'C:\Program.obj'"

   When i read api-munual.pdf, it show me do? but I can't know . How to do, If you know, Can you help me

(2b) Click “Properties” on the “Project” menu. Click the “Linker” folder, and
select the “Input” property page.
• Add the import library to the “Additional Dependencies” property:
– If hConfigurationi is Debug, add hugincpp27.2vc7d.
lib.
– If hConfigurationi is Release, add hugincpp27.2vc7.
lib.
Thanks a lot, if you help me.