diff --git a/dist/index.html b/dist/index.html index 6748fe2..31b123c 100644 --- a/dist/index.html +++ b/dist/index.html @@ -143,6 +143,10 @@ +
+ + +

Brain

diff --git a/src/Controllers/ControlPanel.js b/src/Controllers/ControlPanel.js index 141348b..a6096d3 100644 --- a/src/Controllers/ControlPanel.js +++ b/src/Controllers/ControlPanel.js @@ -143,9 +143,12 @@ class ControlPanel { $(tab).css('display', 'grid'); self.engine.organism_editor.is_active = (this.id == 'editor'); self.stats_panel.stopAutoRender(); - if (this.id == 'stats') { + if (this.id === 'stats') { self.stats_panel.startAutoRender(); } + else if (this.id === 'editor') { + self.editor_controller.refreshDetailsPanel(); + } self.tab_id = this.id; }); } diff --git a/src/Controllers/EditorController.js b/src/Controllers/EditorController.js index e7c2152..f0c101e 100644 --- a/src/Controllers/EditorController.js +++ b/src/Controllers/EditorController.js @@ -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(); @@ -110,6 +114,13 @@ class EditorController extends CanvasController{ $('#edit-organism-details').css('display', 'none'); } + refreshDetailsPanel() { + if (this.mode === Modes.Edit) + this.setEditorPanel(); + else + this.setDetailsPanel(); + } + setDetailsPanel() { this.clearDetailsPanel(); var org = this.env.organism; @@ -117,7 +128,8 @@ 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'); } else { @@ -141,6 +153,14 @@ class EditorController extends CanvasController{ if (this.setMoveRangeVisibility()){ $('#move-range-edit').val(org.move_range); } + + $('#mutation-rate-edit').val(org.mutability); + if (Hyperparams.useGlobalMutability) { + $('#mutation-rate-cont').css('display', 'none'); + } + else { + $('#mutation-rate-cont').css('display', 'block'); + } if (this.setBrainPanelVisibility()){ this.setBrainEditorValues($('#observation-type-edit').val()); diff --git a/src/Rendering/Renderer.js b/src/Rendering/Renderer.js index 647a9a8..41d04c5 100644 --- a/src/Rendering/Renderer.js +++ b/src/Rendering/Renderer.js @@ -105,8 +105,4 @@ class Renderer { } } -// $("body").mousemove(function(e) { -// console.log("hello"); -// }); - module.exports = Renderer;