Skip to content

Add library to save/restore snapshots of the model world

Adam Reichold requested to merge save-restore-world into master

@mlange As hinted at, this adds a library to save/restore snapshots of the world using heaps of unsafe code.

  • This follows abomonation in just dumping memory contents without making any concessions for portability across machines or schema evolution.
  • It also side-steps the issue of keeping CGS pointer internals consistent by making the whole process unsafe which means validity of the on-disk file contents has to be ensured by the user.
  • Finally, it allows restoring things like &'static preferences by threading a context parameter through the restore methods which is used to retrieve parameter values during the restoration of e.g. Forager components.

A bit of review and/or any suggestions for making this less hideous would be greatly appreciated!

Merge request reports