My model needs to import a certain amount of patch-related information (via import-world
) when setting up and it takes around 10 seconds to do that.
When using Behavior Space, these seconds add up very quickly and increase greatly the time needed to run experiments.
I need to shorten this time so I wanted to set things in a way that, when launching Behavior Space, the import-world
command is run only on the first run, while all the other times it can be avoided.
If something like that was possible, I could arrange my code in such a way that those 10 seconds would be needed only once each time Behavior Space is launched.
However, as far as I am aware, Behavior Space only asks you for a setup
command to be run at the beginning of each run.
I might be able to work out some ways to achieve what I want, but I only have in mind things that would look a bit error-prone or bad coding style (e.g. not using clear-all
upon setup but clearing "manually", at the end of my code, one by one the things that I want to clear, which would allow me to not clear the imported patch data, and then use if
upon setup to check if that data already exists, and if it exists then do not import it).
However, I would like to hear if there is a better way to achieve my goal here.