Improved brain mutation
This commit is contained in:
2
dist/js/bundle.js
vendored
2
dist/js/bundle.js
vendored
File diff suppressed because one or more lines are too long
3
dist/json/color_scheme.json
vendored
3
dist/json/color_scheme.json
vendored
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"hello": "world"
|
|
||||||
}
|
|
||||||
@@ -160,7 +160,18 @@ class Organism {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Math.random() * 100 <= prob) {
|
if (Math.random() * 100 <= prob) {
|
||||||
org.mutate();
|
if (org.is_mover && Math.random() * 100 <= 10) {
|
||||||
|
if (org.has_eyes) {
|
||||||
|
org.brain.mutate();
|
||||||
|
}
|
||||||
|
org.move_range += Math.floor(Math.random() * 4) - 2;
|
||||||
|
if (org.move_range <= 0){
|
||||||
|
org.move_range = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
org.mutate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -216,16 +227,6 @@ class Organism {
|
|||||||
mutated = this.removeCell(cell.loc_col, cell.loc_row);
|
mutated = this.removeCell(cell.loc_col, cell.loc_row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.is_mover && Math.random() * 100 <= 10) {
|
|
||||||
this.move_range += Math.floor(Math.random() * 4) - 2;
|
|
||||||
if (this.move_range <= 0){
|
|
||||||
this.move_range = 1;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (this.is_mover && this.has_eyes && Math.random() * 100 <= 10) {
|
|
||||||
this.brain.mutate();
|
|
||||||
}
|
|
||||||
return mutated;
|
return mutated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user