removed ancestor tracking
This commit is contained in:
@@ -41,7 +41,9 @@ const FossilRecord = {
|
|||||||
if (species.cumulative_pop < this.min_pop) {
|
if (species.cumulative_pop < this.min_pop) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.extinct_species.push(s);
|
// disabled for now, causes memory problems on long runs
|
||||||
|
// this.extinct_species.push(s);
|
||||||
|
|
||||||
// console.log("Extant species:", this.extant_species.length)
|
// console.log("Extant species:", this.extant_species.length)
|
||||||
// console.log("Extinct species:", this.extinct_species.length)
|
// console.log("Extinct species:", this.extinct_species.length)
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -3,17 +3,11 @@ const CellStates = require("../Organism/Cell/CellStates");
|
|||||||
class Species {
|
class Species {
|
||||||
constructor(anatomy, ancestor, start_tick) {
|
constructor(anatomy, ancestor, start_tick) {
|
||||||
this.anatomy = anatomy;
|
this.anatomy = anatomy;
|
||||||
this.ancestor = ancestor;
|
// this.ancestor = ancestor; // garbage collect ancestors to avoid memory problems
|
||||||
this.population = 1;
|
this.population = 1;
|
||||||
this.cumulative_pop = 1;
|
this.cumulative_pop = 1;
|
||||||
this.start_tick = start_tick;
|
this.start_tick = start_tick;
|
||||||
this.end_tick = -1;
|
this.end_tick = -1;
|
||||||
this.color = Math.floor(Math.random()*16777215).toString(16);
|
|
||||||
if (ancestor != null) {
|
|
||||||
// needs to be reworked, maybe removed
|
|
||||||
var mutator = Math.floor(Math.random()*16777215)-8000000;
|
|
||||||
this.color = (mutator + parseInt(ancestor.color, 16)).toString(16);
|
|
||||||
}
|
|
||||||
this.name = '_' + Math.random().toString(36).substr(2, 9);
|
this.name = '_' + Math.random().toString(36).substr(2, 9);
|
||||||
this.extinct = false;
|
this.extinct = false;
|
||||||
this.calcAnatomyDetails();
|
this.calcAnatomyDetails();
|
||||||
|
|||||||
Reference in New Issue
Block a user