Hi all,
I'm trying to *adapt* a simulation I found, by passing command line arguments to the simulation to change the behaviour of the simulation, instead of manually changing the code by hand each time I want to change the simulation parameters.
The simulation has 4 classes involved from what I can tell: the main class, which calls a simulation setup class (which sets up the 3d environment), that calls a mammal behaviour class, that in turn extends an animal behaviour class. (I appreciate extends is no longer used -- old simulation obviously!) Now I need to get the arguments out of the main class and into either the mammal or animal behvaour class -- any suggestions?
If I pass the arguments, they need to go through the simulation setup, and in turn into the behaviour class, which seems messy. Can I set the arguments I'm interested in as constants in main (do global variables exist in
Java?) and access them from the behaviour class?
Or can I create some kind of a getArgumentValue method in main, which the later classes can access? And if so, how do you reference the object created through the main method?
Hope this helps -- let me know if more info. is req'd!! Needless to say, I'm stumped, so any help you can provide would be of *great* help!
Cheers,
Ron