I would like to save a run and share it to someone else so they can reproduce it on their machine, how should we proceed?
Short answer is yes! However, some of the steps have to be done from the Gomboc command line.To save all the data from a run, you need to save it as a GDF file. In the Gomboc GUI, go to ‘File’ -> ‘Save Last Run…’ You can then share this file to anyone, as long as they have the same model on their machine.To replay a run from another machine, first open the same model and select the configuration used to record the run. Then go to ‘File’ -> ‘Load Data…’ and select the GDF file. Finally, you can use the following commands to replay the full run. Please have a look at the ReplayController.js file in the Runtime folder to see the definition of animate().
uuid = Runs.list()[0]; // Get the id of the first runReplayController(uuid).animate(0) // to run the animation from time = 0
Going further: To load the last state of the run, you can follow the commands below:
uuid = Runs.list()[0]; // Get the id of the first run
time = Runs.channelValues(uuid, “Time”);
Runs.setSolution(uuid, time.length-1); // Set the last sample
To replay a run from the same machine, the following call will automatically load the bocfile and switch to the correct config (it fails on other machines because of absolute path of boc file):
Runs.loadSolution(uuid, time.length-1); // Set the last sample
Note: Each Gomboc run has a unique corresponding UUID number (see section JavaScript API / Global Objects / Runs of the manual for more details). Also, you cannot have 2 identical UUID coexisting in the same Gomboc instance.