Commit 92d1a64
committed
Fix cycle creation in crossover for feed-forward networks
- Add cycle checking in DefaultGenome.configure_crossover when config.feed_forward=True
- Prevent inheritance of connections that would create cycles during crossover
- Remove outdated TODO comment in DefaultReproduction
- Uses existing creates_cycle function from neat.graphs for detection
- Maintains backward compatibility and all existing functionality
Fixes the issue where crossover could produce genomes with cycles even when
feed_forward=True was configured, which would cause errors when creating
FeedForwardNetwork instances.1 parent 5209176 commit 92d1a64
2 files changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
305 | 308 | | |
306 | 309 | | |
307 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
308 | 314 | | |
309 | 315 | | |
310 | 316 | | |
311 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
312 | 321 | | |
313 | 322 | | |
314 | 323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
274 | 273 | | |
275 | 274 | | |
276 | 275 | | |
| |||
0 commit comments