Exporting structure for multiple static simulations from dynamic GroIMP model

Hi everyone,

I’m working with a dynamic crop model in GroIMP.

At a certain time point during growth, I’d like to pause the simulation and run a large number (a few thousand) of static simulations based on that plant structure—testing variations like different leaf shapes, angles, etc.

Since I’ll be running many of these, I cannot afford to run the dynamic model from scratch every time.
Is there a way to export the structure at that specific time point and then reload it independently for static simulations?

Any suggestions on how to best approach this would be greatly appreciated!

I understood that importing as XEG could be an option - but how can i do that?

I managed to install the plugin ExchangeGraph with the plugin manager, however I cannot see/understand how to export the .xeg in practice - I cannot find any button

Hi Michele,

You can export your graph in XEG the same way as you export the scene:

  • From the GUI: 3d view > view > export … > export complete scene (or sub graph) > . In the windows to select the file and type there should be a .xeg option.
  • From the rgg code with:
public void run ()
{
	export3DScene(getWD()+"test.xeg", "xeg");
}

If the .xeg format is not available it is probably because the plugin is wrongly installed (or the version is incompatible?). With the latest groimp and exchange graph version I could run the small example above for both export and import without issue.

To automatize a bit the setting up of your scene with the exported graph you could use load the graph and adds it to your scene from the code with:

protected void init ()
[
{ Node n = loadNodeFromFile(getWD()+"test.xeg", "model/vnd.xeg"); }
	Axiom ==> n;
]

Now, to save and reuse sub part of your project graph in a proper pipeline, I would not use .xeg. SecGraph from the Graph Explorer plugin sound more adapted. Tim should be writing some documentation on it soon. He will update when it’s ready.

1 Like

Hi,
if I understand you correctly you might want to have a look at the Secondary Graphs (I presented them in Wageningen). There is an embedded example that I think is quite similar to your Problem, you can find it in Project explorer (File/Example Projects) under Graph Explorer / SecGraphSaveAndLoadExample

1 Like

Ok thank you I am following that tutorial, however in my graph for some reason i don’t know I have 3 rggroot. how can I correct that?

also, when I upload a saved graph it doesn’t dynamically grow anymore

This is also true in the example: if you save and then load and then run within the same session then the growth rule will be applied to the A. However if you reset and load the saved graph, then the rules don’t work anymore on module A .