Add ability to edit mutation rate to organism editor
This commit is contained in:
4
dist/index.html
vendored
4
dist/index.html
vendored
@@ -143,6 +143,10 @@
|
||||
<label for="move-range-edit" title='The number of cells to move before randomly changing direction. Overriden by brain decisions.'>Move Range:</label>
|
||||
<input type="number" id="move-range-edit" min="1" max="100" value=3 step="1">
|
||||
</div>
|
||||
<div id='mutation-rate-cont'>
|
||||
<label for="mutation-rate-edit" title='The rate at which the organism mutates.'>Mutation Rate:</label>
|
||||
<input type="number" id="mutation-rate-edit" min="1" max="100" value=3 step="1">
|
||||
</div>
|
||||
<br>
|
||||
<div class='brain-details'>
|
||||
<h4>Brain</h4>
|
||||
|
||||
@@ -93,6 +93,10 @@ class EditorController extends CanvasController{
|
||||
$('#move-range-edit').change ( function() {
|
||||
this.env.organism.move_range = parseInt($('#move-range-edit').val());
|
||||
}.bind(this));
|
||||
|
||||
$('#mutation-rate-edit').change ( function() {
|
||||
this.env.organism.mutability = parseInt($('#mutation-rate-edit').val());
|
||||
}.bind(this));
|
||||
$('#observation-type-edit').change ( function() {
|
||||
this.setBrainEditorValues($('#observation-type-edit').val());
|
||||
this.setBrainDetails();
|
||||
@@ -117,11 +121,14 @@ class EditorController extends CanvasController{
|
||||
$('.cell-count').text("Cell count: "+org.anatomy.cells.length);
|
||||
$('#move-range').text("Move Range: "+org.move_range);
|
||||
$('#mutation-rate').text("Mutation Rate: "+org.mutability);
|
||||
if (Hyperparams.useGlobalMutability) {
|
||||
|
||||
if (Hyperparams.useGlobalMutability) {
|
||||
$('#mutation-rate').css('display', 'none');
|
||||
$('#mutation-rate-cont').css('display', 'none');
|
||||
}
|
||||
else {
|
||||
$('#mutation-rate').css('display', 'block');
|
||||
$('#mutation-rate-cont').css('display', 'block');
|
||||
}
|
||||
|
||||
this.setMoveRangeVisibility();
|
||||
@@ -141,6 +148,8 @@ class EditorController extends CanvasController{
|
||||
if (this.setMoveRangeVisibility()){
|
||||
$('#move-range-edit').val(org.move_range);
|
||||
}
|
||||
|
||||
$('#mutation-rate-edit').val(org.mutability);
|
||||
|
||||
if (this.setBrainPanelVisibility()){
|
||||
this.setBrainEditorValues($('#observation-type-edit').val());
|
||||
|
||||
Reference in New Issue
Block a user