Skip to content

Resaving Models in the Newest Release

Connor Bain edited this page Dec 24, 2020 · 4 revisions

Resave models in the library with the latest NetLogo version

This step requires that the NetLogo version you just cloned be identified as the version we are about to release, not as the previous one. You can check that by running NetLogo (nl$ ./sbt run) and looking at the About item in the Help menu or by running:

nl$ head -1 resources/system/version.txt

If the version number is not updated yet, ask someone from the dev team.

The original motivation for this step was that the version number saved in the model file appears on the Modeling Commons website and it looked weird to have most model from the NetLogo Model Library appear to have been saved with various older earlier versions of NetLogo.

This step is handled by a ModelResaver object in the org.nlogo.tools package. To run it, fire up sbt:

nl$ ./sbt

This will take you to the sbt command prompt, indicated by a >. Now run the ModelResaver:

> netlogo/test:runMain org.nlogo.tools.ModelResaver

It opens and saves all models in the library, excluding 3D models. To resave the 3D models, you will need to run it again separately, starting sbt with ./sbt -Dorg.nlogo.is3d=true.

It's possible that you see some error message during the process (e.g., "MIDI is not available") but those should not interfere with the process. If some models truly fail, you should get a list of FAILED MODELS: at the end.

Assuming the model repo was clean when you started (it should be), you can check what the script actually did to your model files by going back to the models repo and running:

nl/models$ git diff

If all looks well, just commit everything:

nl/models$ git add -A
nl/models$ git commit -m "update model version numbers"

Resaving all the models like that with require regenerating all the model checksums, which is the next step in the process anyway.