Thursday 16 October 2008

Repast and C# (again)!

Well, after my earlier rant I've been busy trying to find a solution to my Repast and C# problem and I think I may have found one.

I (semi)successfully managed to create a very simple Agent Based Model using Eclipse and RepastJ. After I had it running in Eclipse and under Java fine, I used a tool called IKVM. This tool allows the conversion of java class files, libraries and jars into .net executables and dll's. It is scarily easy to use even for a command line tool.

My only concern is that the tool may start throwing me a lot of nasty errors once my "Simple ABM" becomes much more complicated. I also need to convert it to a dll library for importing into my XNA environment as I will need to access the underlying data that the model contains (the tool does have an option to do this, I just haven't tried it yet).

For anyone who is interested, the source code for my (and I use "my" in the loosest possible definition) CarryDrop Agent Based Model can be found here. Also, a zip file with both the runnable jar and the converted .net executable can be found here.

Finally, in order to gain a better insight into ABM programming, I followed a magnificent tutorial written by John Murphy. It was written for Repast 3.1 so is incompatible with the new Repast Simphony but is still a great starting place for anyone wanting to try their hand at ABM programming. His tutorial can be found right here.

Happy Coding ;-)

Chris

No comments: