diff --git a/core/src/com/mygdx/game/Game.java b/core/src/com/mygdx/game/Game.java
index f4bcf4e..35462dd 100644
--- a/core/src/com/mygdx/game/Game.java
+++ b/core/src/com/mygdx/game/Game.java
@@ -92,11 +92,16 @@ public class Game extends ApplicationAdapter {
renderer.begin(ShapeRenderer.ShapeType.Line);
try {
for (Element e : world.getElements()) {
+ if (e == null) {
+ // Yeah, the perks of multithreading I guess
+ continue;
+ }
try {
e.render(renderer);
} catch (ArrayIndexOutOfBoundsException ex) {
- // No idea why it happens, but it's rendering so meh
- //Log.log(Log.ERROR, ex+"");
+ // Render only half the elements because the list gets
+ // modified by another thread? Who cares, it's a simulation
+ // not some videogame
}
}
} catch (ConcurrentModificationException ex) {
@@ -109,7 +114,7 @@ public class Game extends ApplicationAdapter {
Creature c = world.getSelectedCreature();
renderer.setColor(1, 1, 1, 1);
// Draw selection rectangle
- renderer.rect(c.getX() - c.getSize(), c.getY() - c.getSize(), c.getSize()*2, c.getSize()*2);
+ renderer.rect(c.getX() - c.getSize(), c.getY() - c.getSize(), c.getSize() * 2, c.getSize() * 2);
// Draw brain
overlayRenderer.begin();
c.getBrain().render(overlayRenderer);
@@ -132,6 +137,8 @@ public class Game extends ApplicationAdapter {
public void setPaused(boolean paused) {
this.paused = paused;
- if(world != null) world.fire(Listener.PAUSED_OR_RESUMED);
+ if (world != null) {
+ world.fire(Listener.PAUSED_OR_RESUMED);
+ }
}
}
diff --git a/core/src/logic/World.java b/core/src/logic/World.java
index 6e7aceb..036cd49 100644
--- a/core/src/logic/World.java
+++ b/core/src/logic/World.java
@@ -24,6 +24,7 @@ import java.util.logging.Logger;
public class World implements Runnable {
private int width, height, nPlants, creatPerGen;
+ private float nMutatedBrains = 0.2f, nMutatedNeurons = 0.5f, nMutatedConnections = 0.5f, mutationFactor = 1f;
private int generation = 1;
private boolean multithreading, cmdLaunchNewGen = false, cmdRestart = false;
private int fpsLimit, fps = 0;
@@ -229,7 +230,9 @@ public class World implements Runnable {
Logger.getLogger(World.class.getName()).log(Level.SEVERE, null, ex);
}
Creature ne = spawnCreature(n);
- ne.getBrain().mutate(0.05f); // mutate children
+ if (Math.random() <= nMutatedBrains) {
+ ne.getBrain().mutate(nMutatedNeurons, nMutatedConnections, mutationFactor);
+ }
}
graveyard.clear();
fire(Listener.CREATURE_LIST_CHANGED);
@@ -253,6 +256,10 @@ public class World implements Runnable {
Creature.fov = Math.round(options.getOrDefault("creature_fov", (float) Math.PI / 2.5f));
Creature.sightRange = Math.round(options.getOrDefault("creature_sight_range", 100f));
Creature.hpDecay = options.getOrDefault("creature_hp_decay", 0.5f);
+ nMutatedBrains = options.getOrDefault("nMutatedBrains", 0.2f);
+ nMutatedNeurons = options.getOrDefault("nMutatedNeurons", 0.5f);
+ nMutatedConnections = options.getOrDefault("nMutatedConnections", 0.5f);
+ mutationFactor = options.getOrDefault("nMutationFactor", 1f);
}
private Element spawn(boolean isCreature, float[][][] brainMap) {
diff --git a/core/src/logic/neural/Brain.java b/core/src/logic/neural/Brain.java
index 6b992a0..0311744 100644
--- a/core/src/logic/neural/Brain.java
+++ b/core/src/logic/neural/Brain.java
@@ -104,7 +104,7 @@ public class Brain {
// Draw neuron links
float[] links = neurons[i][j].getWeights();
for (int f = 0; f < links.length; f++) {
- s.setColor(links[f] < 0 ? links[f]/2 * -1 : 0, links[f] > 0 ? links[f]/2 : 0, 0, 1);
+ s.setColor(links[f] < 0 ? links[f] / 2 * -1 : 0, links[f] > 0 ? links[f] / 2 : 0, 0, 1);
s.line(i * sepX + offset, j * sepY + offset, (i - 1) * sepX + offset, f * sepY + offset);
}
// Draw neuron
@@ -182,16 +182,22 @@ public class Brain {
* Get a map of this brain's mind.. with a mutation
*
* @param mutationFactor the higher this number, the bigger the mutation
+ * @param connectionMutationProbability the probability that determines how
+ * many connections mutate in a neuron (from 0 to 1)
+ * @param mutationProbability the higher this number the higher the amount
+ * of mutated neurons (range: from 0 to 1)
* @return a mutated brain map of this brain's mind
*/
- public float[][][] getMutatedMap(float mutationFactor) {
+ public float[][][] getMutatedMap(float mutationProbability, float connectionMutationProbability, float mutationFactor) {
float[][][] res = new float[neurons.length - 1][][];
for (int i = 1; i < neurons.length; i++) // layers (skip input layer)
{
res[i - 1] = new float[neurons[i].length][];
for (int j = 0; j < neurons[i].length; j++) // neurons per layer
{
- res[i - 1][j] = neurons[i][j].mutate(mutationFactor);
+ if (Math.random() <= mutationProbability) {
+ res[i - 1][j] = neurons[i][j].getMutatedWeights(connectionMutationProbability, mutationFactor);
+ }
}
}
return res;
@@ -200,14 +206,20 @@ public class Brain {
/**
* Apply a mutation to this brain
*
+ * @param connectionMutationProbability the probability that determines how
+ * many connections mutate in a neuron (from 0 to 1)
+ * @param mutationProbability the higher this number the higher the amount
+ * of mutated neurons (range: from 0 to 1)
* @param mutationFactor the higher this number, the bigger the mutation
*/
- public void mutate(float mutationFactor) {
+ public void mutate(float mutationProbability, float connectionMutationProbability, float mutationFactor) {
for (int i = 1; i < neurons.length; i++) // layers (skip input layer)
{
for (int j = 0; j < neurons[i].length; j++) // neurons per layer
{
- neurons[i][j].setWeights(neurons[i][j].mutate(mutationFactor));
+ if (Math.random() <= mutationProbability) {
+ neurons[i][j].setWeights(neurons[i][j].getMutatedWeights(connectionMutationProbability, mutationFactor));
+ }
}
}
}
diff --git a/core/src/logic/neural/Neuron.java b/core/src/logic/neural/Neuron.java
index cbee083..448a263 100644
--- a/core/src/logic/neural/Neuron.java
+++ b/core/src/logic/neural/Neuron.java
@@ -77,10 +77,14 @@ public class Neuron {
return res;
}
- public float[] mutate(float mutationFactor) {
+ public float[] getMutatedWeights(float mutationProbability, float mutationFactor) {
float[] mutatedWeights = new float[weights.length];
for (int i = 0; i < weights.length; i++) {
- mutatedWeights[i] = weights[i] + mutationFactor - mutationFactor / 2;
+ if (Math.random() <= mutationProbability) {
+ mutatedWeights[i] = weights[i] + (float) (Math.random() * mutationFactor) - mutationFactor / 2;
+ } else {
+ mutatedWeights[i] = weights[i];
+ }
}
return mutatedWeights;
}
diff --git a/desktop/src/gui/GUI.form b/desktop/src/gui/GUI.form
index 2d36eb5..eadfe07 100644
--- a/desktop/src/gui/GUI.form
+++ b/desktop/src/gui/GUI.form
@@ -87,10 +87,10 @@
-
+
-
+
@@ -168,13 +168,13 @@
-
+
-
+
@@ -269,15 +269,9 @@
-
+
-
-
-
-
-
-
@@ -349,7 +343,7 @@
-
+
@@ -362,6 +356,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -436,11 +468,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -684,6 +740,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/desktop/src/gui/GUI.java b/desktop/src/gui/GUI.java
index ac098dc..a621da3 100644
--- a/desktop/src/gui/GUI.java
+++ b/desktop/src/gui/GUI.java
@@ -117,6 +117,18 @@ public class GUI extends javax.swing.JFrame implements LogListener, Listener {
jButton1 = new javax.swing.JButton();
drawViewCones = new javax.swing.JCheckBox();
drawSightLines = new javax.swing.JCheckBox();
+ jLabel11 = new javax.swing.JLabel();
+ nMutatedBrainsSlider = new javax.swing.JSlider();
+ currentNMutatedBrains = new javax.swing.JLabel();
+ jLabel13 = new javax.swing.JLabel();
+ nMutatedNeuronsSlider = new javax.swing.JSlider();
+ currentNMutatedNeurons = new javax.swing.JLabel();
+ jLabel15 = new javax.swing.JLabel();
+ mutationFactorSlider = new javax.swing.JSlider();
+ currentMutationFactor = new javax.swing.JLabel();
+ jLabel12 = new javax.swing.JLabel();
+ nMutatedConnectionsSlider = new javax.swing.JSlider();
+ currentNMutatedConnections = new javax.swing.JLabel();
status = new javax.swing.JLabel();
menuBar = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
@@ -130,8 +142,8 @@ public class GUI extends javax.swing.JFrame implements LogListener, Listener {
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("AIrium");
- setMinimumSize(new java.awt.Dimension(530, 450));
- setPreferredSize(new java.awt.Dimension(530, 450));
+ setMinimumSize(new java.awt.Dimension(700, 700));
+ setPreferredSize(new java.awt.Dimension(700, 700));
logTextArea.setEditable(false);
logTextArea.setColumns(20);
@@ -161,12 +173,12 @@ public class GUI extends javax.swing.JFrame implements LogListener, Listener {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(logLevelBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
- .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 525, Short.MAX_VALUE)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 695, Short.MAX_VALUE)
);
logPaneLayout.setVerticalGroup(
logPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(logPaneLayout.createSequentialGroup()
- .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 490, Short.MAX_VALUE)
.addGap(10, 10, 10)
.addGroup(logPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
@@ -354,6 +366,50 @@ public class GUI extends javax.swing.JFrame implements LogListener, Listener {
}
});
+ jLabel11.setText("Probability of children mutation");
+
+ nMutatedBrainsSlider.addChangeListener(new javax.swing.event.ChangeListener() {
+ public void stateChanged(javax.swing.event.ChangeEvent evt) {
+ nMutatedBrainsSliderStateChanged(evt);
+ }
+ });
+
+ currentNMutatedBrains.setText("10%");
+
+ jLabel13.setText("Number of mutated neurons");
+
+ nMutatedNeuronsSlider.setValue(20);
+ nMutatedNeuronsSlider.addChangeListener(new javax.swing.event.ChangeListener() {
+ public void stateChanged(javax.swing.event.ChangeEvent evt) {
+ nMutatedNeuronsSliderStateChanged(evt);
+ }
+ });
+
+ currentNMutatedNeurons.setText("jLabel14");
+
+ jLabel15.setText("Mutation Factor");
+
+ mutationFactorSlider.setMajorTickSpacing(1);
+ mutationFactorSlider.setMaximum(200);
+ mutationFactorSlider.setValue(100);
+ mutationFactorSlider.addChangeListener(new javax.swing.event.ChangeListener() {
+ public void stateChanged(javax.swing.event.ChangeEvent evt) {
+ mutationFactorSliderStateChanged(evt);
+ }
+ });
+
+ currentMutationFactor.setText("jLabel16");
+
+ jLabel12.setText("Number of mutated synapsis");
+
+ nMutatedConnectionsSlider.addChangeListener(new javax.swing.event.ChangeListener() {
+ public void stateChanged(javax.swing.event.ChangeEvent evt) {
+ nMutatedConnectionsSliderStateChanged(evt);
+ }
+ });
+
+ currentNMutatedConnections.setText("jLabel14");
+
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
@@ -361,11 +417,6 @@ public class GUI extends javax.swing.JFrame implements LogListener, Listener {
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addComponent(drawViewCones)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(drawSightLines)
- .addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
@@ -426,7 +477,7 @@ public class GUI extends javax.swing.JFrame implements LogListener, Listener {
.addComponent(multithreadingCheckbox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(enableCorpsesCheckbox)))
- .addGap(0, 24, Short.MAX_VALUE)))
+ .addGap(0, 0, Short.MAX_VALUE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(currentHpDecay))
.addGroup(jPanel1Layout.createSequentialGroup()
@@ -434,7 +485,38 @@ public class GUI extends javax.swing.JFrame implements LogListener, Listener {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(maxTicksSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(currentMaxTicks)))
+ .addComponent(currentMaxTicks))
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addComponent(jLabel11)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(nMutatedBrainsSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(currentNMutatedBrains))
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addComponent(jLabel13)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(nMutatedNeuronsSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(currentNMutatedNeurons))
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addComponent(jLabel15)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(mutationFactorSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(currentMutationFactor))
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addComponent(jLabel12)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(nMutatedConnectionsSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 490, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(currentNMutatedConnections))
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addComponent(drawViewCones)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(drawSightLines)))
+ .addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
@@ -493,10 +575,30 @@ public class GUI extends javax.swing.JFrame implements LogListener, Listener {
.addComponent(maxTicksSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(currentMaxTicks, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+ .addComponent(nMutatedBrainsSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(currentNMutatedBrains, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+ .addComponent(nMutatedNeuronsSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(currentNMutatedNeurons, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jLabel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+ .addComponent(currentNMutatedConnections, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jLabel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(nMutatedConnectionsSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(mutationFactorSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(currentMutationFactor, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(drawViewCones)
.addComponent(drawSightLines))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(pauseButton)
.addComponent(jButton1))
@@ -709,11 +811,19 @@ public class GUI extends javax.swing.JFrame implements LogListener, Listener {
options.put("creature_sight_range", (float) sightRangeSlider.getValue());
options.put("creature_hp_decay", (float) hpDecaySlider.getValue() / 1000);
options.put("max_ticks", (float) maxTicksSlider.getValue());
- options.put("draw_view_cones",drawViewCones.isSelected()?1f:0);
- options.put("draw_sight_lines",drawSightLines.isSelected()?1f:0);
+ options.put("draw_view_cones", drawViewCones.isSelected() ? 1f : 0);
+ options.put("draw_sight_lines", drawSightLines.isSelected() ? 1f : 0);
currentMaxTicks.setText(maxTicksSlider.getValue() + "");
currentHpDecay.setText(hpDecaySlider.getValue() / 1000f + "");
currentSightRange.setText(sightRangeSlider.getValue() + "");
+ options.put("nMutatedBrains", (float) nMutatedBrainsSlider.getValue()/100);
+ currentNMutatedBrains.setText(String.format("%.2f", (float) nMutatedBrainsSlider.getValue()/100)+"%");
+ options.put("nMutatedNeurons", (float) nMutatedNeuronsSlider.getValue()/100);
+ currentNMutatedNeurons.setText(String.format("%.2f", (float) nMutatedNeuronsSlider.getValue()/100)+"%");
+ options.put("nMutatedConnections", (float) nMutatedConnectionsSlider.getValue()/100);
+ currentNMutatedConnections.setText(String.format("%.2f", (float) nMutatedConnectionsSlider.getValue()/100)+"%");
+ options.put("mutationFactor", (float) mutationFactorSlider.getValue()/100);
+ currentMutationFactor.setText(String.format("%.2f", (float) mutationFactorSlider.getValue()/100));
if (game != null) {
game.getWorld().reloadOptions();
}
@@ -831,6 +941,22 @@ public class GUI extends javax.swing.JFrame implements LogListener, Listener {
updateSettings();
}//GEN-LAST:event_drawSightLinesStateChanged
+ private void nMutatedNeuronsSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_nMutatedNeuronsSliderStateChanged
+ updateSettings();
+ }//GEN-LAST:event_nMutatedNeuronsSliderStateChanged
+
+ private void mutationFactorSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_mutationFactorSliderStateChanged
+ updateSettings();
+ }//GEN-LAST:event_mutationFactorSliderStateChanged
+
+ private void nMutatedBrainsSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_nMutatedBrainsSliderStateChanged
+ updateSettings();
+ }//GEN-LAST:event_nMutatedBrainsSliderStateChanged
+
+ private void nMutatedConnectionsSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_nMutatedConnectionsSliderStateChanged
+ updateSettings();
+ }//GEN-LAST:event_nMutatedConnectionsSliderStateChanged
+
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel container;
private javax.swing.JSlider corpseDecaySlider;
@@ -839,7 +965,11 @@ public class GUI extends javax.swing.JFrame implements LogListener, Listener {
private javax.swing.JLabel currentFpsLimit;
private javax.swing.JLabel currentHpDecay;
private javax.swing.JLabel currentMaxTicks;
+ private javax.swing.JLabel currentMutationFactor;
private javax.swing.JLabel currentNCreatures;
+ private javax.swing.JLabel currentNMutatedBrains;
+ private javax.swing.JLabel currentNMutatedConnections;
+ private javax.swing.JLabel currentNMutatedNeurons;
private javax.swing.JLabel currentNPlants;
private javax.swing.JLabel currentSightRange;
private javax.swing.JLabel currentTopSize;
@@ -853,6 +983,10 @@ public class GUI extends javax.swing.JFrame implements LogListener, Listener {
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
+ private javax.swing.JLabel jLabel11;
+ private javax.swing.JLabel jLabel12;
+ private javax.swing.JLabel jLabel13;
+ private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
@@ -875,7 +1009,11 @@ public class GUI extends javax.swing.JFrame implements LogListener, Listener {
private javax.swing.JSlider maxTicksSlider;
private javax.swing.JMenuBar menuBar;
private javax.swing.JCheckBox multithreadingCheckbox;
+ private javax.swing.JSlider mutationFactorSlider;
private javax.swing.JSlider nCreaturesSlider;
+ private javax.swing.JSlider nMutatedBrainsSlider;
+ private javax.swing.JSlider nMutatedConnectionsSlider;
+ private javax.swing.JSlider nMutatedNeuronsSlider;
private javax.swing.JSlider nPlantsSlider;
private javax.swing.JToggleButton pauseButton;
private javax.swing.JMenuItem pauseMenuButton;