File tree Expand file tree Collapse file tree 3 files changed +41
-0
lines changed
NeuralBotMasterFramework/NeuralBotMasterFramework Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Linq ;
4
+ using System . Text ;
5
+ using System . Threading . Tasks ;
6
+
7
+ namespace NeuralBotMasterFramework . Interfaces
8
+ {
9
+ public interface IBreedingPoolGenerator
10
+ {
11
+ List < IWeightedNetwork > GenerateBreedingPool ( Dictionary < IWeightedNetwork , double > networksAndFitness ) ;
12
+ }
13
+ }
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Linq ;
4
+ using System . Text ;
5
+ using System . Threading . Tasks ;
6
+ using NeuralBotMasterFramework . Interfaces ;
7
+
8
+ namespace NeuralBotMasterFramework . Logic . PoolGenerators
9
+ {
10
+ public class IndexBasedPoolGenerator : IBreedingPoolGenerator
11
+ {
12
+ public List < IWeightedNetwork > GenerateBreedingPool ( Dictionary < IWeightedNetwork , double > networksAndFitness )
13
+ {
14
+ List < IWeightedNetwork > poolList = new List < IWeightedNetwork > ( ) ;
15
+ for ( int networkIndex = 0 ; networkIndex < networksAndFitness . Count ; ++ networkIndex )
16
+ {
17
+ IWeightedNetwork currentNetwork = networksAndFitness . Keys . ElementAt ( networkIndex ) ;
18
+ for ( int i = 0 ; i < networksAndFitness . Count - networkIndex ; ++ i )
19
+ {
20
+ poolList . Add ( currentNetwork ) ;
21
+ }
22
+ }
23
+ return poolList ;
24
+ }
25
+ }
26
+ }
Original file line number Diff line number Diff line change 43
43
<ItemGroup >
44
44
<Compile Include =" Helper\RandomNumberGenerator.cs" />
45
45
<Compile Include =" Interfaces\IBaseLayer.cs" />
46
+ <Compile Include =" Interfaces\IBreedingPoolGenerator.cs" />
46
47
<Compile Include =" Interfaces\IGeneticAlgorithm.cs" />
47
48
<Compile Include =" Interfaces\ILayer.cs" />
48
49
<Compile Include =" Interfaces\INetwork.cs" />
52
53
<Compile Include =" Interfaces\INode.cs" />
53
54
<Compile Include =" Logic\Algorithms\GeneticAlgorithm.cs" />
54
55
<Compile Include =" Logic\Networks\WeightedNetwork.cs" />
56
+ <Compile Include =" Logic\PoolGenerators\IndexBasedPoolGenerator.cs" />
55
57
<Compile Include =" Models\Layer.cs" />
56
58
<Compile Include =" Models\Node.cs" />
57
59
<Compile Include =" Models\WeightedLayer.cs" />
You can’t perform that action at this time.
0 commit comments