Separated anatomy from org / made species tracker

This commit is contained in:
Max Robinson
2021-02-04 17:27:47 -07:00
parent 56b27c65b6
commit d26f195100
15 changed files with 707 additions and 147 deletions

View File

@@ -10,8 +10,8 @@ class BodyCell{
this.loc_row = loc_row;
var distance = Math.max(Math.abs(loc_row)*2 + 2, Math.abs(loc_col)*2 + 2);
if (this.org.birth_distance < distance) {
this.org.birth_distance = distance;
if (this.org.anatomy.birth_distance < distance) {
this.org.anatomy.birth_distance = distance;
}
}

View File

@@ -7,7 +7,7 @@ const Observation = require("../../Perception/Observation")
class EyeCell extends BodyCell{
constructor(org, loc_col, loc_row){
super(CellStates.eye, org, loc_col, loc_row);
this.org.has_eyes = true;
this.org.anatomy.has_eyes = true;
}
initInherit(parent) {

View File

@@ -4,7 +4,7 @@ const BodyCell = require("./BodyCell");
class MoverCell extends BodyCell{
constructor(org, loc_col, loc_row){
super(CellStates.mover, org, loc_col, loc_row);
this.org.is_mover = true;
this.org.anatomy.is_mover = true;
}
}

View File

@@ -5,11 +5,11 @@ const Hyperparams = require("../../../Hyperparameters");
class ProducerCell extends BodyCell{
constructor(org, loc_col, loc_row){
super(CellStates.producer, org, loc_col, loc_row);
this.org.is_producer = true;
this.org.anatomy.is_producer = true;
}
performFunction() {
if (this.org.is_mover && !Hyperparams.moversCanProduce)
if (this.org.anatomy.is_mover && !Hyperparams.moversCanProduce)
return;
var env = this.org.env;
var prob = Hyperparams.foodProdProb;