Sign in to follow this  
Preacher

[java] swing & prolog opinions please

Recommended Posts

Hi im developing an ant colony simulation for my final year project and i'm doing it in Java, i just wanna throw out a few ideas i have and get peoples opinions. firstly i need to develop a 3D user interface which will involve a terrain for the ants to roam around in and objects such as food etc, but most importantly i need to be able to integrate swing. I know that xith3D and JOGL support swing, and i used Xith a little last year. I'm not looking for blistering performance or fancy effects i just want an API with good documentation and tutorials. Next i need to represent the ants logic in a belief desire intention format so that means prolog to me, found a java-prolog API called InterProlog, looking for peoples thoughts and experiences usig prolog with java. I don't need a prolog front end just want to be able to query prolog from java code and call java methods from prolog code. Thanks for your time

Share this post


Link to post
Share on other sites
Quote:
Original post by Preacher
Next i need to represent the ants logic in a belief desire intention format so that means prolog to me, found a java-prolog API called InterProlog, looking for peoples thoughts and experiences usig prolog with java. I don't need a prolog front end just want to be able to query prolog from java code and call java methods from prolog code.


Sisctus Prolog comes with a Java API called Jasper that is quite mature. It lets you call Prolog methods from Java and call Java methods from Prolog like you want. The former is actually quite clean and the latter is very messy. I imagine each frame you'll be sending data to each ant about its environment via a Prolog call, and the same call will instantiate variables with the ant's new position, so it should be quite straight forward.



SWI Prolog has a Java interface too, but it wasn't too well developed when I tried it. If I remember correctly, InterProlog interfaces Java with SWI and/or Sicstus by using ports and just sending text across them. I didn't manage to get it working though so went with Jasper.

Share this post


Link to post
Share on other sites
Java 3D also integrates well into Swing. Usually I'm not a huge fan of J3D, but for something like this where you don't really need superb graphics, it'll do.

Share this post


Link to post
Share on other sites
K thanks will give a look at those java - prolog interfaces. I'm kind of put off by Java3D as it's very volitile support wise, I like Xith3D's ability to get down to OpenGL level if the need arises

Share this post


Link to post
Share on other sites
Quote:
Original post by Preacher
I'm kind of put off by Java3D as it's very volitile support wise

Huh? You mean in terms of the support for graphics operations?

If so, then I agree. But since you had mentioned that you don't need any fancy effects and simply wanted good documentation and tutorials in addition to something that integrates well with Swing, I suggested Java 3D.

I'm not defending it. I don't even really like it all that much. But it is nice if you just need a dirt simple 3D interface integrated into a GUI.

Share this post


Link to post
Share on other sites
Quote:
Original post by Preacher
Hi im developing an ant colony simulation for my final year project and i'm doing it in Java, i just wanna throw out a few ideas i have and get peoples opinions.
end just want to be able to query prolog from java code and call java methods from prolog code.


Seeing as it's your final year project (assuming you don't major in computer graphics/games or something), you really should just do the minimum amount of graphics possible and concentrate on the AI instead. You could spend weeks on your graphics and all it will amount to in your report is a couple of screenshots. For example, just have a 2D top-down map with dots for the ants. It would be much better for screenshots which explain the ants behaviour too because you can clearly see what's going on, which might not be the case if you use textures and fancy effects. Anyway, my advice is to find out what you'll get the most marks for and concentrate on that.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I agree. Besides, it would be the easier form of 3d if the ants just move in 2d space irrespective the actaully height of the terrain.

Sounds really cool. You should post here when you have somthing to show.

Share this post


Link to post
Share on other sites
Thanks all for the advice, i agree about the concentrating on AI and thats what i originally intended to do. But my peers do not think that the AI on its own will do for a forth year project, therefore i'll have to put in some graphics. The graphics will not be fancy.

What i need to do is create a 3D table top ant colony with an editable environment eg. create planes for the ants to live on which can be linked together using bridges and have food and obstales placed on them etc.

I've done a lot of research into biological ant colonies, event gone and bought wilson and holdoblers "The Ants" and book on swarm intelligence by Dorigo and Santa Fe Institute!

The AI should be interesting, as i want it to resemble a biological colony as much as possible adn therefore be highl emergent and agent based.

Im lookinh into whether prolog can help describe the ants "deliberation" elegantly, as i'm going to have a Behaviour loader (Class Loader) which can change the behaviours associated with every caste of ant. So the prolog will just deal with the logical part of the ant.

As soon as i have something of note done ill post it, finished my research report and moving onto the funtional spec. So a working example should be along soon;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this