I'm not sure that I understand the request, or maybe I lack the sufficient amount of vision to see where this is going, but this doesn't strike as something that's very feasible. First off, writing a model in Java and then using NetLogo simply to visualize the model seems impractical to me. The problem here is that NetLogo's engine internals are intertwined with the display code. That is, the structures that are used in the engine for calculating new model states are the same ones that the NetLogo View uses to figure out what to display; to my knowledge, you cannot cause a display update in NetLogo without modifying the engine's data structures. (This is a problem that we fixed in the browser-based version of NetLogo that's in the works, but this statement is not helpful here.)

Consequently, in order for you to use NetLogo to visualize your model, you basically either need to find a way to map each of your Java modeling commands to the equivalent NetLogo API call, or you need to write your model entirely in NetLogo API calls. But... Java is clearly not a good language for writing agent-based simulations models; this is /why/ we provide the NetLogo programming language, which is designed to make it easier for people to create models. If you're writing an agent-based model and you're willing to use NetLogo to visualize the model, why not just write the model entirely in NetLogo?

Along those lines, why do you need to use Java at all? Is it really offering you something that NetLogo isn't? If the answer really, truly is an emphatic "YES!", then maybe consider writing an extension <https://github.com/NetLogo/NetLogo/wiki/Extensions-API>. With NetLogo extensions, you can define your own NetLogo primitives that call out to Java/Scala code (even code in third-party libraries). I would expect that there wouldn't be a whole lot of code for your simulation that's better expressed in Java than in NetLogo, and you shouldn't be surprised to learn that maybe someone has already written a NetLogo extension that runs that extra Java code you were planning on writing, so you don't actually need to write any Java, yourself. Maybe.

Does all this make sense?  Am I misunderstanding your goal in some way?

On 01/26/2015 05:29 AM, kinsuk sinha wrote:

Hi,

I am using Eclipse Luna (4.4.1) to write an agent based model. And, I would like to visualize this model in Netlogo (2D). Coding in Java is relatively new for me and hence I dont know all the specific details I need to address to achieve the objective. Could you guys please let me know how to proceed forward?
Many Thanks..!!!

Regards
Kinsuk
--
You received this message because you are subscribed to the Google Groups "netlogo-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to