Files
lifeEngine/src/Hyperparameters.js
2021-12-18 15:05:35 -06:00

38 lines
889 B
JavaScript

const Neighbors = require("./Grid/Neighbors");
const Hyperparams = {
setDefaults: function() {
this.lifespanMultiplier = 100;
this.foodProdProb = 5;
this.killableNeighbors = Neighbors.adjacent;
this.edibleNeighbors = Neighbors.adjacent;
this.growableNeighbors = Neighbors.adjacent;
this.useGlobalMutability = false;
this.globalMutability = 5;
this.addProb = 33;
this.changeProb = 33;
this.removeProb = 33;
this.rotationEnabled = true;
this.foodBlocksReproduction = true;
this.moversCanProduce = false;
this.instaKill = false;
this.lookRange = 20;
this.foodDropProb = 0;
},
loadJsonObj(obj) {
for (let key in obj) {
this[key] = obj[key];
}
}
}
Hyperparams.setDefaults();
module.exports = Hyperparams;