Skip to content

Commit a7a9269

Browse files
committed
Fixed Bugs
1 parent 84b0907 commit a7a9269

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

NeuralBotMasterFramework/NeuralBotMasterFramework/Logic/Algorithms/GeneticAlgorithm.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private void AddNewNetworks(int amount)
4949

5050
private void AddNewNetwork()
5151
{
52-
NetworksAndFitness.Add(new WeightedNetwork(InputNodes, HiddenLayers, HiddenLayers, OutputNodes), 0);
52+
NetworksAndFitness.Add(new WeightedNetwork(InputNodes, HiddenLayers, HiddenNodes, OutputNodes), 0);
5353
}
5454

5555
public void SetupTest(double[][] input, double[][] expected = null)
@@ -126,8 +126,8 @@ private void RemoveUnneccessaryNetworks()
126126

127127
private void BreedNewNetworks()
128128
{
129-
AddNewNetworks(RandomNetworkAmount);
130129
List<IWeightedNetwork> networkAndLikelinesToBreed = GetBreedingPool();
130+
AddNewNetworks(RandomNetworkAmount);
131131
BreedNetworks(networkAndLikelinesToBreed);
132132
}
133133

NeuralBotMasterFramework/TestConsole/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ static void Main(string[] args)
2525
int outputNodes = totalNumberLength;
2626

2727
int networksToKeep = 100;
28+
int totalRandomNetworks = 100;
2829
double mutationRate = 0.2;
2930
double mutationChance = 0.4;
3031

@@ -40,6 +41,7 @@ static void Main(string[] args)
4041
algorithm.NetworksToKeep = networksToKeep;
4142
algorithm.MutationRate = mutationRate;
4243
algorithm.MutationChance = mutationChance;
44+
algorithm.RandomNetworkAmount = totalRandomNetworks;
4345

4446
Console.WriteLine("Initialization complete");
4547

0 commit comments

Comments
 (0)