Separated anatomy from org / made species tracker
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user