PDA

View Full Version : Expert Systems in C++


tintin
06-11-2003, 04:55
Anyone got a clue if its possible to build an Expert system shell in C++, or at least where i could get my hands on a pre built shell, im stuck trying to find a book, there seams to be only one by a guy called David Hu, but its out of print, most annoying.

Thanks, Scott

Clarksy
06-11-2003, 10:38
Hi Scott, welcome...

An "Expert system shell"...?

I'm not sure what your wanting to do here? Replace the Shell of your OS? (if so what is it?) or create a shell for some app you've created or are creating?

tintin
06-11-2003, 15:20
Probably should have been clearer, sorry, im trying to build an Expert System in C++ as part of my uni 4rth year project.

An expert System is a simulation of an expert in any given field, eg, if you took your car in for repair and the mechanic was having trouble finding the problem, or the problem was one he wasnt too familiar with, he could insert all the information he knew about the cars state into the program, the program holds thousands of case studies or information about cars, what goes wrong with them, and how to repair the problem or test for it. The expert system would then be able to work out what was wrong with the car, in the same way an actual expert would reason it out in their head. It does this by activating rules it must follow depending on what information was inserted about the car in question.

i need to create a shell or find one and fill it with my own rules. its part of a war simulation, the ES has to use rules which will guide the construction and configuration of war units, the unit is then placed in a sparing simulator where its played against other units, then a neural net is used to optimise the unit so that it is better able to win more often, or last as long as possible inflicing the maximum damage more often before it is destroyed.

The Problem is that i can build Neural Nets in C++ and Expert Systems in Prolog, but i need to integrate the two together, and its either i learn how to build neural nets in prolog (something i really dont want to do) or learn how to construct ES in C++. which is proving very difficult, a book or online tutorial would help me out a lot, or a prebuilt shell compatable with C++ would do too.

im having trouble finding one online, was looking to see if anyone else knew of where i could find what im looking for.

Scott

Clarksy
07-11-2003, 00:48
So, in broad terms, your looking to find or create some kind of interface for your c++ code?

chedburgh
07-11-2003, 15:00
Hi tintin,

Building a full expert system in C++ would be a large project, consider you need to design and implement inference rules and database storage etc. You’ll then need to train it with a large mount of data to make sure it works.

Using an established expert system, you could have it write out config files of your units, which you load into your sparing arena. Another alternate would be to plug a prolog expert system you create into C++ as a dll, a quick google found this: http://www.trinc-prolog.com/doc/pl_dll.htm.

If your design rules for the units can be distilled fairly well without excessive amounts of variables, you could use straight C/C++.

Doing it in C++ does not have to mean hundreds of if/switch statements, using object composition you could assemble units out of many smaller well defined objects.

i.e.(very rough idea this) tank is made of wheels, turret, body, gun barrel, AI (neural net). Each part is an object and has a set of variables that represent it, i.e for body, weight, size, life, effectiveness, etc. You can then define sub types of each, i.e. tracked wheels, monster wheels, tweaked wheel all inherited from base wheel. After sparing the unit generator could study the resulting state of the units parts and overall match stats, so it can generate a new parts for new units.

Personally, having done something slightly similar at uni, I’d go with straight C++.

ched

tintin
08-11-2003, 02:03
Yes to Clarksy and thanks very much to chedburgh, i didnt know it was possible to plug prolog into C++ at all, i'll give that a go and see what i can do, cheers guys.

If anyone does know of books in this area would be cool to find out what they are.

What was your 4th year project by the way chedburgh, im intrested.

Scott

chedburgh
11-11-2003, 14:39
Hi tintin, sorry bout the delay on the post, my PC blew up last week!

For my dissertation I did AI concepts, and made small games to test/prove them. I did a project in another module which was like yours, we had to make a small virtual environment for species of birds, then they had to compete for food/space etc and breed till one specie was dominant. We then would tweak the all the stats etc and see how the results varied. Looking back at it, we should have added neural nets to each bird >:)

Anyway, on books, I would search amazon to find the books you want, and look for reviews on the net of each book that interests you. www.oreillynet.com tend to have some good books to, and you can get a limited free subscription to the online books section.

Heres some sites that may help with plugging the dll in, or other windows based code:

www.codeproject.com
www.codeguru.com
www.programmersheaven.com

Another excellent site is www.gamedev.net they have a bunch of stuff in the articles section about AI/neural nets and such, and a lot of info in the forums. www.gametutorials.com is another good site for info, not sure if they have anything practically relevant to your project thought.

cheers
ched

tintin
19-11-2003, 17:54
Thanks very much, that halep a lot, hope your PC didnt blow up to badly, sorry also for the delay in replying, i had a 10000 word essay on Agent and Multi Agent systems to hand in and been takin up all my time.

your project sounds like i was pretty cool.

Thanks again.

Scott