schrum2 / EvoCraft-SCOPE

0 stars 0 forks source link

Generalize distance metrics #65

Closed MuellMark closed 2 years ago

MuellMark commented 2 years ago

Currently, we have the Euclidean distance hard coded into the novelty search file in two places. First, this needs to be refactored to avoid code repetition and so that we can change the distance metrics easily. Once that's refactored, we can then look into adding in new distance metrics, such as the hamming or the modified hamming distance (where we add 1 if one vector has a block and the other has air, or ,05 if there are two blocks that are different.)

MuellMark commented 2 years ago

I have reworked the Euclidean distance so that it is no longer repeated, and I added it to a file with both the hamming and the custom hamming distance we came up with. I made unit tests (#70) and have tested the three that we came up with to verify that they work. From what I could tell, the distance calculations are correct.