File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,7 @@ fn fitness(g: &AgentDNA) -> f32 {
27
27
let n = rng. gen :: < f32 > ( ) ;
28
28
let n2 = rng. gen :: < f32 > ( ) ;
29
29
30
- let expected = if ( n + n2) / 2. >= 0.5 {
31
- 0
32
- } else {
33
- 1
34
- } ;
30
+ let expected = if ( n + n2) / 2. >= 0.5 { 0 } else { 1 } ;
35
31
36
32
let result = network. predict ( [ n, n2] ) ;
37
33
network. flush_state ( ) ;
@@ -73,20 +69,16 @@ fn main() {
73
69
let mut sim = GeneticSim :: new (
74
70
#[ cfg( not( feature = "rayon" ) ) ]
75
71
Vec :: gen_random ( & mut rng, 100 ) ,
76
-
77
72
#[ cfg( feature = "rayon" ) ]
78
73
Vec :: gen_random ( 100 ) ,
79
-
80
74
fitness,
81
-
82
75
#[ cfg( not( feature = "serde" ) ) ]
83
76
division_pruning_nextgen,
84
-
85
77
#[ cfg( feature = "serde" ) ]
86
78
serde_nextgen,
87
79
) ;
88
80
89
81
for _ in 0 ..200 {
90
82
sim. next_generation ( ) ;
91
83
}
92
- }
84
+ }
You can’t perform that action at this time.
0 commit comments