schrum2 / EvoCraft-SCOPE

0 stars 0 forks source link

Saving and loading novelty search archived shapes #63

Closed MuellMark closed 2 years ago

MuellMark commented 2 years ago

While novelty search is working, there isn't a way of saving or loading any of the generated shapes. However, because of how novelty search is, we want to be able to save and load the shapes in the archive as they are generated. The best was to do this is to save each shape individually as they are added to the archive. This way, even when the program is terminated, we have the archive that was slowly built up. Loading the archives will have to reflect this change too.

schrum2 commented 2 years ago

Make the save location be a subdirectory named "archive" that is inside of the directory defined by the BASE_DIR, EXPERIMENT_PREFIX, and the RANDOM_SEED.

MuellMark commented 2 years ago

The files are saved with pickle and are saved in directories based on BASE_DIR, EXPERIMENT_PREFIX, and the RANDOM_SEED. They are saved as "shape#" where # is the counter for how many shapes there are saved total. To load them, the directory is located and then all of the shape files in the directory "archive" are added into a list and then generated. There were some other small things that changed here, such as giving fitness functions its own parameter. On top of this, all generated shapes are cleared with all_blocks (similar to how it is done in fitness_functions). For loading, all blocks are added to one big list, which is returned, and then cleared with a user input. This takes care of rouge snakes that get generated but not cleared with our current clear function

Below are some images from the gallery of novel shapes 2022-06-01_09 51 35 2022-06-01_09 51 21 2022-06-01_09 50 39 2022-06-01_10 35 29