openworm / org.geppetto

Geppetto is an open-source platform to build web-based applications to visualize and simulate neuroscience data and models.
http://geppetto.org
Other
209 stars 50 forks source link

Simple LEMS simulations not working #229

Closed borismarin closed 9 years ago

borismarin commented 9 years ago

These two G scritpts, which are supposed to run basic LEMS simulations, are not working properly neither from live.geppetto.org nor from a local dev version (thanks for checking that @adrianq):

https://raw.githubusercontent.com/borismarin/OpenSourceChaos/geppetto_tests/geppetto/peppetto.xml https://raw.githubusercontent.com/borismarin/OpenSourceChaos/geppetto_tests/geppetto/gep_silly.xml

In both cases, it seems that only the first integration time step is performed - i.e., the initial conditions (t=0) are fetched correctly, the state is updated once (t = 0 + dt), and there it stays. I came to this conclusion by looking at the plots and inspecting x.SimulationTree.y from the console.

Both LEMS scripts work properly when run locally with jLEMS (notice that jLEMS doesn't support url includes, so that part needs to be changed in order to run the script locally). I thought that these Include statements might be causing trouble, so I've written the second (silly) script which is self-contained - to no avail.

Am I making any silly mistake in the model definition files/scripts? Or is it a bug at the Geppetto/jLEMS integration level?

jrmartin commented 9 years ago

I ran this on my machine to debug, there's an infinite loop in the JLems Simulator trying to populate the visualization tree. The xml and scripts are fine.

The JLems Simulator has to be expanded to be able to load this kind of model, so far it only looks for a NeuroMLDocument to load, and this type of simulation has a ILEMSDocument model type

tarelli commented 9 years ago

@jrmartin thanks for debugging, @borismarin I will look into this.

jrmartin commented 9 years ago

@tarelli This is the method that needs to be expanded, needs to populate ILemsDocument https://github.com/openworm/org.geppetto.simulator.jlems/blob/development/src/main/java/org/geppetto/simulator/jlems/JLEMSSimulatorService.java#L189

jrmartin commented 9 years ago

@tarelli What branch has the fix for this? The issue Boris is having with the dual aspect simulation is the same as this, the visual tree for the lems is not being poulated as is not NeuroMLDocument.

tarelli commented 9 years ago

@jrmartin it's in dev already, the issue I fixed wasn't about the visual tree not being populated (as there's nothing to populate for a LEMS file in the visual tree and that's not a problem) but about geppetto assuming that there was going to be a visual tree all the time and reinitialising the simulation if there was not one.