@reicek/neataptic-ts 0.1.25 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/copilot-instructions.md +11 -0
- package/.github/skills/trace-analyzer-extension/SKILL.md +3 -3
- package/.github/skills/trace-analyzer-extension/assets/extension-checklist.md +1 -1
- package/.github/skills/trace-analyzer-extension/references/analyzer-extension-workflow.md +1 -1
- package/.github/skills/trace-audit-reporting/SKILL.md +3 -3
- package/.github/skills/trace-audit-reporting/references/trace-analysis-workflow.md +1 -1
- package/package.json +19 -13
- package/plans/Flappy_Bird_Folder_Documentation_Pass.md +4 -4
- package/plans/README.md +24 -0
- package/plans/Roadmap.md +62 -40
- package/plans/analyze-trace-solid-split.plans.md +66 -0
- package/plans/architecture-solid-split.plans.md +9 -15
- package/plans/asciiMaze-typescript-repair.plans.md +1 -1
- package/plans/generate-docs-solid-split.plans.md +87 -0
- package/plans/methods-docs.plans.md +25 -1
- package/plans/methods-solid-split.plans.md +14 -14
- package/plans/neat-docs.plans.md +9 -1
- package/plans/neat-test-surface-repair.plans.md +1 -1
- package/plans/render-docs-html-solid-split.plans.md +68 -0
- package/plans/src-no-explicit-any-cleanup.plans.md +1 -1
- package/plans/utils-docs.plans.md +6 -1
- package/scripts/analyze-trace/analyze-trace.analysis.ts +479 -0
- package/scripts/analyze-trace/analyze-trace.constants.ts +35 -0
- package/scripts/analyze-trace/analyze-trace.io.ts +69 -0
- package/scripts/analyze-trace/analyze-trace.report.ts +100 -0
- package/scripts/analyze-trace/analyze-trace.shared.ts +116 -0
- package/scripts/analyze-trace/analyze-trace.ts +45 -0
- package/scripts/analyze-trace/analyze-trace.types.ts +72 -0
- package/scripts/assets/theme.css +80 -23
- package/scripts/copy-examples.ts +239 -0
- package/scripts/export-onnx.ts +223 -0
- package/scripts/generate-bench-tables.ts +378 -37
- package/scripts/generate-docs/generate-docs.constants.ts +107 -0
- package/scripts/generate-docs/generate-docs.order.ts +355 -0
- package/scripts/generate-docs/generate-docs.state.ts +31 -0
- package/scripts/generate-docs/generate-docs.targets.ts +165 -0
- package/scripts/generate-docs/generate-docs.ts +63 -0
- package/scripts/generate-docs/generate-docs.types.ts +112 -0
- package/scripts/generate-docs/output/generate-docs.output.folder-index.utils.ts +167 -0
- package/scripts/generate-docs/output/generate-docs.output.ordering.utils.ts +353 -0
- package/scripts/generate-docs/output/generate-docs.output.readme.utils.ts +420 -0
- package/scripts/generate-docs/output/generate-docs.output.ts +123 -0
- package/scripts/generate-docs/output/generate-docs.output.warnings.utils.ts +219 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.collection.utils.ts +365 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.jsdoc.utils.ts +373 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.normalize.utils.ts +155 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.render.utils.ts +149 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.signature.utils.ts +289 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.ts +11 -0
- package/scripts/mermaid-cli.mjs +102 -22
- package/scripts/mermaid-cli.ts +736 -0
- package/scripts/render-docs-html/render-docs-html.assets.ts +54 -0
- package/scripts/render-docs-html/render-docs-html.mermaid.ts +245 -0
- package/scripts/{render-docs-html.sidebar.ts → render-docs-html/render-docs-html.navigation.ts} +141 -144
- package/scripts/render-docs-html/render-docs-html.pages.ts +333 -0
- package/scripts/render-docs-html/render-docs-html.shared.ts +333 -0
- package/scripts/render-docs-html/render-docs-html.types.ts +42 -0
- package/scripts/render-docs-html.ts +23 -587
- package/scripts/run-docs.ts +238 -0
- package/scripts/write-dist-docs-pkg.ts +40 -0
- package/src/README.md +75 -75
- package/src/architecture/connection/README.md +5 -5
- package/src/architecture/layer/README.md +508 -508
- package/src/architecture/network/README.md +1458 -1458
- package/src/architecture/network/activate/README.md +694 -694
- package/src/architecture/network/bootstrap/README.md +77 -77
- package/src/architecture/network/connect/README.md +74 -74
- package/src/architecture/network/deterministic/README.md +135 -135
- package/src/architecture/network/evolve/README.md +364 -364
- package/src/architecture/network/gating/README.md +130 -130
- package/src/architecture/network/genetic/README.md +399 -399
- package/src/architecture/network/mutate/README.md +897 -897
- package/src/architecture/network/onnx/README.md +720 -720
- package/src/architecture/network/onnx/export/README.md +728 -728
- package/src/architecture/network/onnx/export/layers/README.md +450 -450
- package/src/architecture/network/onnx/import/README.md +618 -618
- package/src/architecture/network/onnx/schema/README.md +32 -32
- package/src/architecture/network/prune/README.md +245 -245
- package/src/architecture/network/remove/README.md +135 -135
- package/src/architecture/network/runtime/README.md +106 -106
- package/src/architecture/network/serialize/README.md +542 -542
- package/src/architecture/network/slab/README.md +608 -608
- package/src/architecture/network/standalone/README.md +212 -212
- package/src/architecture/network/stats/README.md +84 -84
- package/src/architecture/network/topology/README.md +465 -465
- package/src/architecture/network/training/README.md +200 -200
- package/src/architecture/node/README.md +5 -5
- package/src/architecture/nodePool/README.md +14 -14
- package/src/methods/README.md +99 -99
- package/src/methods/activation/README.md +189 -189
- package/src/methods/cost/README.md +131 -131
- package/src/methods/rate/README.md +86 -86
- package/src/multithreading/README.md +77 -77
- package/src/multithreading/workers/browser/README.md +8 -8
- package/src/multithreading/workers/node/README.md +8 -8
- package/src/neat/README.md +148 -148
- package/src/neat/adaptive/README.md +120 -120
- package/src/neat/adaptive/acceptance/README.md +40 -40
- package/src/neat/adaptive/complexity/README.md +137 -137
- package/src/neat/adaptive/core/README.md +197 -197
- package/src/neat/adaptive/lineage/README.md +90 -90
- package/src/neat/adaptive/mutation/README.md +284 -284
- package/src/neat/compat/README.md +43 -43
- package/src/neat/compat/core/README.md +90 -90
- package/src/neat/diversity/README.md +35 -35
- package/src/neat/diversity/core/README.md +88 -88
- package/src/neat/evaluate/README.md +85 -85
- package/src/neat/evaluate/auto-distance/README.md +75 -75
- package/src/neat/evaluate/entropy-compat/README.md +37 -37
- package/src/neat/evaluate/entropy-sharing/README.md +43 -43
- package/src/neat/evaluate/fitness/README.md +23 -23
- package/src/neat/evaluate/novelty/README.md +120 -120
- package/src/neat/evaluate/objectives/README.md +17 -17
- package/src/neat/evaluate/shared/README.md +94 -94
- package/src/neat/evolve/README.md +96 -96
- package/src/neat/evolve/adaptive/README.md +60 -60
- package/src/neat/evolve/objectives/README.md +63 -63
- package/src/neat/evolve/offspring/README.md +56 -56
- package/src/neat/evolve/population/README.md +171 -171
- package/src/neat/evolve/runtime/README.md +79 -79
- package/src/neat/evolve/speciation/README.md +74 -74
- package/src/neat/evolve/warnings/README.md +10 -10
- package/src/neat/export/README.md +114 -114
- package/src/neat/helpers/README.md +50 -50
- package/src/neat/init/README.md +9 -9
- package/src/neat/lineage/core/README.md +101 -101
- package/src/neat/multiobjective/category/README.md +74 -74
- package/src/neat/multiobjective/crowding/README.md +272 -272
- package/src/neat/multiobjective/dominance/README.md +171 -171
- package/src/neat/multiobjective/fronts/README.md +68 -68
- package/src/neat/multiobjective/metrics/README.md +43 -43
- package/src/neat/multiobjective/objectives/README.md +31 -31
- package/src/neat/multiobjective/shared/README.md +27 -27
- package/src/neat/mutation/README.md +97 -97
- package/src/neat/mutation/add-conn/README.md +115 -115
- package/src/neat/mutation/add-node/README.md +126 -126
- package/src/neat/mutation/flow/README.md +149 -149
- package/src/neat/mutation/repair/README.md +185 -185
- package/src/neat/mutation/select/README.md +117 -117
- package/src/neat/mutation/shared/README.md +32 -32
- package/src/neat/objectives/README.md +25 -25
- package/src/neat/objectives/core/README.md +67 -67
- package/src/neat/pruning/README.md +40 -40
- package/src/neat/pruning/core/README.md +171 -171
- package/src/neat/pruning/facade/README.md +32 -32
- package/src/neat/rng/README.md +104 -104
- package/src/neat/rng/core/README.md +137 -137
- package/src/neat/rng/facade/README.md +50 -50
- package/src/neat/selection/README.md +111 -111
- package/src/neat/selection/core/README.md +227 -227
- package/src/neat/selection/facade/README.md +61 -61
- package/src/neat/shared/README.md +163 -163
- package/src/neat/speciation/README.md +31 -31
- package/src/neat/speciation/threshold/README.md +35 -35
- package/src/neat/species/README.md +25 -25
- package/src/neat/species/core/README.md +20 -20
- package/src/neat/species/core/shared/README.md +18 -18
- package/src/neat/species/history/context/README.md +22 -22
- package/src/neat/telemetry/accessors/README.md +58 -58
- package/src/neat/telemetry/exports/README.md +233 -233
- package/src/neat/telemetry/facade/README.md +252 -252
- package/src/neat/telemetry/facade/archive/README.md +57 -57
- package/src/neat/telemetry/facade/buffer/README.md +43 -43
- package/src/neat/telemetry/facade/lineage/README.md +12 -12
- package/src/neat/telemetry/facade/objectives/README.md +44 -44
- package/src/neat/telemetry/facade/runtime/README.md +26 -26
- package/src/neat/telemetry/facade/species/README.md +27 -27
- package/src/neat/telemetry/metrics/README.md +696 -696
- package/src/neat/telemetry/recorder/README.md +57 -57
- package/src/neat/telemetry/types/README.md +32 -32
- package/src/neat/topology-intent/README.md +75 -75
- package/src/utils/README.md +193 -193
- package/test/examples/asciiMaze/browser-entry/README.md +92 -92
- package/test/examples/asciiMaze/dashboardManager/README.md +109 -109
- package/test/examples/asciiMaze/dashboardManager/telemetry/README.md +28 -28
- package/test/examples/asciiMaze/evolutionEngine/README.md +1527 -1527
- package/test/examples/asciiMaze/mazeMovement/README.md +105 -105
- package/test/examples/asciiMaze/mazeMovement/finalization/README.md +16 -16
- package/test/examples/asciiMaze/mazeMovement/policy/README.md +57 -57
- package/test/examples/asciiMaze/mazeMovement/runtime/README.md +52 -52
- package/test/examples/asciiMaze/mazeMovement/shaping/README.md +46 -46
- package/test/examples/flappy_bird/browser-entry/README.md +508 -508
- package/test/examples/flappy_bird/browser-entry/host/README.md +101 -101
- package/test/examples/flappy_bird/browser-entry/host/resize/README.md +144 -144
- package/test/examples/flappy_bird/browser-entry/network-view/README.md +194 -194
- package/test/examples/flappy_bird/browser-entry/playback/README.md +278 -278
- package/test/examples/flappy_bird/browser-entry/playback/background/README.md +129 -129
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/README.md +502 -502
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/README.md +139 -139
- package/test/examples/flappy_bird/browser-entry/playback/snapshot/README.md +10 -10
- package/test/examples/flappy_bird/browser-entry/playback/trail/README.md +43 -43
- package/test/examples/flappy_bird/browser-entry/playback/worker-channel/README.md +30 -30
- package/test/examples/flappy_bird/browser-entry/runtime/README.md +59 -59
- package/test/examples/flappy_bird/browser-entry/visualization/README.md +276 -276
- package/test/examples/flappy_bird/browser-entry/worker-channel/README.md +16 -16
- package/test/examples/flappy_bird/constants/README.md +1070 -1070
- package/test/examples/flappy_bird/environment/README.md +22 -22
- package/test/examples/flappy_bird/evaluation/README.md +32 -32
- package/test/examples/flappy_bird/evaluation/rollout/README.md +141 -141
- package/test/examples/flappy_bird/flappy-evolution-worker/README.md +425 -425
- package/test/examples/flappy_bird/simulation-shared/README.md +170 -170
- package/test/examples/flappy_bird/simulation-shared/observation/README.md +109 -109
- package/test/examples/flappy_bird/trainer/README.md +325 -325
- package/test/examples/flappy_bird/trainer/evaluation/README.md +74 -74
- package/scripts/analyze-trace.ts +0 -590
- package/scripts/copy-examples.mjs +0 -114
- package/scripts/export-onnx.mjs +0 -86
- package/scripts/generate-bench-tables.mjs +0 -182
- package/scripts/generate-docs.ts +0 -2900
- package/scripts/write-dist-docs-pkg.mjs +0 -16
|
@@ -39,46 +39,48 @@ flowchart TD
|
|
|
39
39
|
|
|
40
40
|
## neat/evolve/adaptive/evolve.adaptive.utils.ts
|
|
41
41
|
|
|
42
|
-
###
|
|
42
|
+
### adaptReenableProbability
|
|
43
43
|
|
|
44
44
|
```ts
|
|
45
|
-
|
|
45
|
+
adaptReenableProbability(
|
|
46
46
|
internal: NeatControllerForEvolution,
|
|
47
|
-
|
|
47
|
+
config: { minSamples: number; target: number; min: number; max: number; deltaScale: number; },
|
|
48
|
+
): void
|
|
48
49
|
```
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
Adapt the re-enable probability based on recent success ratios.
|
|
51
52
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
Re-enable adaptation turns the last generation's connection-revival outcomes
|
|
54
|
+
into one controller-level probability update for the next generation. It
|
|
55
|
+
aggregates success and attempt counters across the whole population, resets
|
|
56
|
+
those per-genome counters once consumed, and only adjusts the shared
|
|
57
|
+
probability when the sample size is large enough to be meaningful.
|
|
57
58
|
|
|
58
59
|
Parameters:
|
|
59
60
|
- `internal` - - NEAT controller instance.
|
|
60
61
|
|
|
61
|
-
Returns:
|
|
62
|
+
Returns: Nothing.
|
|
62
63
|
|
|
63
|
-
###
|
|
64
|
+
### applyAdaptiveComplexityControllers
|
|
64
65
|
|
|
65
66
|
```ts
|
|
66
|
-
|
|
67
|
+
applyAdaptiveComplexityControllers(
|
|
67
68
|
internal: NeatControllerForEvolution,
|
|
68
69
|
): Promise<void>
|
|
69
70
|
```
|
|
70
71
|
|
|
71
|
-
Apply
|
|
72
|
+
Apply adaptive complexity controllers if available.
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
This helper is the evolve bridge into the root adaptive complexity policies.
|
|
75
|
+
It keeps both optional calls together because they rewrite controller-level
|
|
76
|
+
structure policy rather than one single genome: budget scheduling can change
|
|
77
|
+
allowed network size, and phased complexity can flip the controller between
|
|
78
|
+
growth and simplification modes.
|
|
77
79
|
|
|
78
80
|
Parameters:
|
|
79
81
|
- `internal` - - NEAT controller instance.
|
|
80
82
|
|
|
81
|
-
Returns: A promise that resolves after
|
|
83
|
+
Returns: A promise that resolves after optional complexity controllers have run.
|
|
82
84
|
|
|
83
85
|
### applyAncestorUniqAdaptiveSafe
|
|
84
86
|
|
|
@@ -128,6 +130,46 @@ Parameters:
|
|
|
128
130
|
|
|
129
131
|
Returns: Nothing.
|
|
130
132
|
|
|
133
|
+
### applyMinimalCriterionAdaptiveSafe
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
applyMinimalCriterionAdaptiveSafe(
|
|
137
|
+
internal: NeatControllerForEvolution,
|
|
138
|
+
): Promise<void>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Apply minimal criterion adaptive controller if available.
|
|
142
|
+
|
|
143
|
+
Minimal criterion adaptation is one of the few adaptive policies that can
|
|
144
|
+
rewrite the current generation's score landscape immediately. Keeping it in a
|
|
145
|
+
safe wrapper lets evolve apply that pressure when configured without forcing
|
|
146
|
+
every runtime surface to include the full adaptive subtree.
|
|
147
|
+
|
|
148
|
+
Parameters:
|
|
149
|
+
- `internal` - - NEAT controller instance.
|
|
150
|
+
|
|
151
|
+
Returns: A promise that resolves after the optional acceptance controller runs.
|
|
152
|
+
|
|
153
|
+
### applyOperatorAdaptationSafe
|
|
154
|
+
|
|
155
|
+
```ts
|
|
156
|
+
applyOperatorAdaptationSafe(
|
|
157
|
+
internal: NeatControllerForEvolution,
|
|
158
|
+
): Promise<void>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Apply operator adaptation if available.
|
|
162
|
+
|
|
163
|
+
Operator adaptation is another best-effort policy-maintenance bridge. It
|
|
164
|
+
decays long-running operator statistics so later mutation choices weight more
|
|
165
|
+
recent evidence without forcing evolve to know the details of the adaptive
|
|
166
|
+
operator-selection subsystem.
|
|
167
|
+
|
|
168
|
+
Parameters:
|
|
169
|
+
- `internal` - - NEAT controller instance.
|
|
170
|
+
|
|
171
|
+
Returns: A promise that resolves after optional operator-stat decay runs.
|
|
172
|
+
|
|
131
173
|
### applyPruningAndMutation
|
|
132
174
|
|
|
133
175
|
```ts
|
|
@@ -175,45 +217,3 @@ Parameters:
|
|
|
175
217
|
- `internal` - - NEAT controller instance.
|
|
176
218
|
|
|
177
219
|
Returns: Nothing.
|
|
178
|
-
|
|
179
|
-
### adaptReenableProbability
|
|
180
|
-
|
|
181
|
-
```ts
|
|
182
|
-
adaptReenableProbability(
|
|
183
|
-
internal: NeatControllerForEvolution,
|
|
184
|
-
config: { minSamples: number; target: number; min: number; max: number; deltaScale: number; },
|
|
185
|
-
): void
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
Adapt the re-enable probability based on recent success ratios.
|
|
189
|
-
|
|
190
|
-
Re-enable adaptation turns the last generation's connection-revival outcomes
|
|
191
|
-
into one controller-level probability update for the next generation. It
|
|
192
|
-
aggregates success and attempt counters across the whole population, resets
|
|
193
|
-
those per-genome counters once consumed, and only adjusts the shared
|
|
194
|
-
probability when the sample size is large enough to be meaningful.
|
|
195
|
-
|
|
196
|
-
Parameters:
|
|
197
|
-
- `internal` - - NEAT controller instance.
|
|
198
|
-
|
|
199
|
-
Returns: Nothing.
|
|
200
|
-
|
|
201
|
-
### applyOperatorAdaptationSafe
|
|
202
|
-
|
|
203
|
-
```ts
|
|
204
|
-
applyOperatorAdaptationSafe(
|
|
205
|
-
internal: NeatControllerForEvolution,
|
|
206
|
-
): Promise<void>
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
Apply operator adaptation if available.
|
|
210
|
-
|
|
211
|
-
Operator adaptation is another best-effort policy-maintenance bridge. It
|
|
212
|
-
decays long-running operator statistics so later mutation choices weight more
|
|
213
|
-
recent evidence without forcing evolve to know the details of the adaptive
|
|
214
|
-
operator-selection subsystem.
|
|
215
|
-
|
|
216
|
-
Parameters:
|
|
217
|
-
- `internal` - - NEAT controller instance.
|
|
218
|
-
|
|
219
|
-
Returns: A promise that resolves after optional operator-stat decay runs.
|
|
@@ -31,51 +31,34 @@ flowchart TD
|
|
|
31
31
|
|
|
32
32
|
## neat/evolve/objectives/evolve.objectives.utils.ts
|
|
33
33
|
|
|
34
|
-
###
|
|
34
|
+
### applyDynamicObjectiveSchedule
|
|
35
35
|
|
|
36
36
|
```ts
|
|
37
|
-
|
|
37
|
+
applyDynamicObjectiveSchedule(
|
|
38
38
|
internal: NeatControllerForEvolution,
|
|
39
|
+
currentObjectiveKeys: string[],
|
|
40
|
+
config: { autoEntropyAddAt: number; },
|
|
39
41
|
): void
|
|
40
42
|
```
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Objective reads are intentionally cached elsewhere because the resolved list
|
|
45
|
-
is reused across several helpers. Whenever evolve-time policy adds, removes,
|
|
46
|
-
or suppresses an objective, this cache must be cleared so the next
|
|
47
|
-
`_getObjectives()` read reflects the updated configuration rather than the
|
|
48
|
-
earlier generation's list.
|
|
49
|
-
|
|
50
|
-
Parameters:
|
|
51
|
-
- `internal` - - NEAT controller instance.
|
|
52
|
-
|
|
53
|
-
Returns: void.
|
|
54
|
-
|
|
55
|
-
### updateObjectiveScheduleAndAges
|
|
56
|
-
|
|
57
|
-
```ts
|
|
58
|
-
updateObjectiveScheduleAndAges(
|
|
59
|
-
internal: NeatControllerForEvolution,
|
|
60
|
-
helpers: { applyDynamicObjectiveSchedule: (currentObjectiveKeys: string[]) => void; },
|
|
61
|
-
): Promise<void>
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Update objective schedule, pending adds/removes, and objective ages.
|
|
44
|
+
Apply dynamic objective scheduling and entropy rules.
|
|
65
45
|
|
|
66
|
-
This is the
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
46
|
+
This helper is the main generation-time policy switchboard for objectives.
|
|
47
|
+
When dynamic scheduling is enabled, it decides when to add scheduled
|
|
48
|
+
objectives such as complexity or entropy and then hands off to the entropy
|
|
49
|
+
drop or re-add rules. When dynamic scheduling is disabled but auto-entropy is
|
|
50
|
+
enabled, it applies the simpler fallback rule that adds entropy after a
|
|
51
|
+
configured generation threshold.
|
|
70
52
|
|
|
71
|
-
The
|
|
72
|
-
|
|
73
|
-
|
|
53
|
+
The helper mutates controller policy state in place by registering
|
|
54
|
+
objectives, updating pending-add queues, and delegating entropy maintenance.
|
|
55
|
+
Callers should therefore treat it as a policy update step rather than a pure
|
|
56
|
+
read.
|
|
74
57
|
|
|
75
58
|
Parameters:
|
|
76
59
|
- `internal` - - NEAT controller instance.
|
|
77
|
-
- `
|
|
78
|
-
- `
|
|
60
|
+
- `currentObjectiveKeys` - - Keys of active objectives.
|
|
61
|
+
- `config` - - Scheduling constants.
|
|
79
62
|
|
|
80
63
|
Returns: void.
|
|
81
64
|
|
|
@@ -120,36 +103,25 @@ Parameters:
|
|
|
120
103
|
|
|
121
104
|
Returns: void.
|
|
122
105
|
|
|
123
|
-
###
|
|
106
|
+
### createEntropyAccessor
|
|
124
107
|
|
|
125
108
|
```ts
|
|
126
|
-
|
|
109
|
+
createEntropyAccessor(
|
|
127
110
|
internal: NeatControllerForEvolution,
|
|
128
|
-
|
|
129
|
-
config: { autoEntropyAddAt: number; },
|
|
130
|
-
): void
|
|
111
|
+
): (genome: GenomeWithMetadata) => number
|
|
131
112
|
```
|
|
132
113
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
This helper is the main generation-time policy switchboard for objectives.
|
|
136
|
-
When dynamic scheduling is enabled, it decides when to add scheduled
|
|
137
|
-
objectives such as complexity or entropy and then hands off to the entropy
|
|
138
|
-
drop or re-add rules. When dynamic scheduling is disabled but auto-entropy is
|
|
139
|
-
enabled, it applies the simpler fallback rule that adds entropy after a
|
|
140
|
-
configured generation threshold.
|
|
114
|
+
Build the entropy accessor used by dynamic objective scheduling.
|
|
141
115
|
|
|
142
|
-
The
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
116
|
+
The evolve controller already advertises `_structuralEntropy` as an optional
|
|
117
|
+
hook. This helper centralizes the non-null assertion so the scheduling logic
|
|
118
|
+
can stay declarative while preserving the existing expectation that entropy
|
|
119
|
+
scheduling only makes sense on hosts exposing that hook.
|
|
146
120
|
|
|
147
121
|
Parameters:
|
|
148
122
|
- `internal` - - NEAT controller instance.
|
|
149
|
-
- `currentObjectiveKeys` - - Keys of active objectives.
|
|
150
|
-
- `config` - - Scheduling constants.
|
|
151
123
|
|
|
152
|
-
Returns:
|
|
124
|
+
Returns: Accessor that reads structural entropy from one genome.
|
|
153
125
|
|
|
154
126
|
### handleEntropyDropAndReadd
|
|
155
127
|
|
|
@@ -183,22 +155,50 @@ Parameters:
|
|
|
183
155
|
|
|
184
156
|
Returns: void.
|
|
185
157
|
|
|
186
|
-
###
|
|
158
|
+
### resetObjectivesCache
|
|
187
159
|
|
|
188
160
|
```ts
|
|
189
|
-
|
|
161
|
+
resetObjectivesCache(
|
|
190
162
|
internal: NeatControllerForEvolution,
|
|
191
|
-
):
|
|
163
|
+
): void
|
|
192
164
|
```
|
|
193
165
|
|
|
194
|
-
|
|
166
|
+
Clear cached objectives so dynamic schedules can rebuild them.
|
|
195
167
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
168
|
+
Objective reads are intentionally cached elsewhere because the resolved list
|
|
169
|
+
is reused across several helpers. Whenever evolve-time policy adds, removes,
|
|
170
|
+
or suppresses an objective, this cache must be cleared so the next
|
|
171
|
+
`_getObjectives()` read reflects the updated configuration rather than the
|
|
172
|
+
earlier generation's list.
|
|
200
173
|
|
|
201
174
|
Parameters:
|
|
202
175
|
- `internal` - - NEAT controller instance.
|
|
203
176
|
|
|
204
|
-
Returns:
|
|
177
|
+
Returns: void.
|
|
178
|
+
|
|
179
|
+
### updateObjectiveScheduleAndAges
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
updateObjectiveScheduleAndAges(
|
|
183
|
+
internal: NeatControllerForEvolution,
|
|
184
|
+
helpers: { applyDynamicObjectiveSchedule: (currentObjectiveKeys: string[]) => void; },
|
|
185
|
+
): Promise<void>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Update objective schedule, pending adds/removes, and objective ages.
|
|
189
|
+
|
|
190
|
+
This is the small orchestration entrypoint for evolve-time objective
|
|
191
|
+
maintenance. It reads the currently resolved objective keys, applies the
|
|
192
|
+
caller-provided scheduling policy, then updates the age bookkeeping that
|
|
193
|
+
later telemetry or policy helpers may inspect.
|
|
194
|
+
|
|
195
|
+
The whole pass is wrapped in a best-effort guard because dynamic objective
|
|
196
|
+
tracking is useful metadata, not a requirement for the rest of evolution to
|
|
197
|
+
continue.
|
|
198
|
+
|
|
199
|
+
Parameters:
|
|
200
|
+
- `internal` - - NEAT controller instance.
|
|
201
|
+
- `helpers` - - Helper callbacks used by scheduling logic.
|
|
202
|
+
- `helpers` - - Dynamic objective scheduler.
|
|
203
|
+
|
|
204
|
+
Returns: void.
|
|
@@ -18,13 +18,12 @@ Read this chapter when you want to understand:
|
|
|
18
18
|
|
|
19
19
|
## neat/evolve/offspring/evolve.offspring.constants.ts
|
|
20
20
|
|
|
21
|
-
###
|
|
21
|
+
### LINEAGE_BASE_DEPTH
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Baseline lineage depth when parent depth metadata is missing.
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
rescue.
|
|
25
|
+
This keeps lineage annotation tolerant of older or narrower runtime surfaces
|
|
26
|
+
that do not carry full parent-depth metadata.
|
|
28
27
|
|
|
29
28
|
### LINEAGE_DEPTH_INCREMENT
|
|
30
29
|
|
|
@@ -33,15 +32,41 @@ Depth increment applied when deriving a child from its parents.
|
|
|
33
32
|
Offspring depth is always one generation deeper than the deepest available
|
|
34
33
|
parent depth so shallow lineage summaries remain monotonic.
|
|
35
34
|
|
|
36
|
-
###
|
|
35
|
+
### OFFSPRING_FALLBACK_INDEX
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
Index used when falling back to the first genome in the population.
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
The fallback stays explicit so parent selection failure still produces a
|
|
40
|
+
deterministic recovery path before the helper tries more permissive random
|
|
41
|
+
rescue.
|
|
42
42
|
|
|
43
43
|
## neat/evolve/offspring/evolve.offspring.utils.ts
|
|
44
44
|
|
|
45
|
+
### annotateOffspringMetadata
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
annotateOffspringMetadata(
|
|
49
|
+
context: OffspringContext,
|
|
50
|
+
offspring: default,
|
|
51
|
+
parentOne: default,
|
|
52
|
+
parentTwo: default,
|
|
53
|
+
): void
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Attach runtime metadata to a newly crossed child.
|
|
57
|
+
|
|
58
|
+
The metadata step keeps offspring creation compatible with later lineage,
|
|
59
|
+
telemetry, and inbreeding reads without forcing the crossover call itself to
|
|
60
|
+
know about controller-level bookkeeping.
|
|
61
|
+
|
|
62
|
+
Parameters:
|
|
63
|
+
- `context` - - NEAT-like host containing population and options.
|
|
64
|
+
- `offspring` - - Newly crossed child genome.
|
|
65
|
+
- `parentOne` - - First selected parent.
|
|
66
|
+
- `parentTwo` - - Second selected parent.
|
|
67
|
+
|
|
68
|
+
Returns: Nothing.
|
|
69
|
+
|
|
45
70
|
### createOffspring
|
|
46
71
|
|
|
47
72
|
```ts
|
|
@@ -65,6 +90,28 @@ Parameters:
|
|
|
65
90
|
|
|
66
91
|
Returns: A newly created offspring genome ready for later mutation and scoring.
|
|
67
92
|
|
|
93
|
+
### enforceOffspringInvariants
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
enforceOffspringInvariants(
|
|
97
|
+
context: OffspringContext,
|
|
98
|
+
offspring: default,
|
|
99
|
+
): void
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Reapply minimum structural invariants after crossover.
|
|
103
|
+
|
|
104
|
+
Crossover can produce a child that is technically valid for heredity but still
|
|
105
|
+
missing the controller's minimum hidden-node or dead-end guarantees. This
|
|
106
|
+
helper keeps that cleanup local to offspring creation so later population code
|
|
107
|
+
can treat returned children as already normalized.
|
|
108
|
+
|
|
109
|
+
Parameters:
|
|
110
|
+
- `context` - - NEAT-like host containing population and options.
|
|
111
|
+
- `offspring` - - Newly crossed child genome.
|
|
112
|
+
|
|
113
|
+
Returns: Nothing.
|
|
114
|
+
|
|
68
115
|
### OffspringContext
|
|
69
116
|
|
|
70
117
|
Minimal surface needed for offspring generation.
|
|
@@ -96,50 +143,3 @@ Parameters:
|
|
|
96
143
|
- `populationFallback` - - Optional alternate population to read from.
|
|
97
144
|
|
|
98
145
|
Returns: A parent genome chosen from the preferred or fallback path.
|
|
99
|
-
|
|
100
|
-
### annotateOffspringMetadata
|
|
101
|
-
|
|
102
|
-
```ts
|
|
103
|
-
annotateOffspringMetadata(
|
|
104
|
-
context: OffspringContext,
|
|
105
|
-
offspring: default,
|
|
106
|
-
parentOne: default,
|
|
107
|
-
parentTwo: default,
|
|
108
|
-
): void
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
Attach runtime metadata to a newly crossed child.
|
|
112
|
-
|
|
113
|
-
The metadata step keeps offspring creation compatible with later lineage,
|
|
114
|
-
telemetry, and inbreeding reads without forcing the crossover call itself to
|
|
115
|
-
know about controller-level bookkeeping.
|
|
116
|
-
|
|
117
|
-
Parameters:
|
|
118
|
-
- `context` - - NEAT-like host containing population and options.
|
|
119
|
-
- `offspring` - - Newly crossed child genome.
|
|
120
|
-
- `parentOne` - - First selected parent.
|
|
121
|
-
- `parentTwo` - - Second selected parent.
|
|
122
|
-
|
|
123
|
-
Returns: Nothing.
|
|
124
|
-
|
|
125
|
-
### enforceOffspringInvariants
|
|
126
|
-
|
|
127
|
-
```ts
|
|
128
|
-
enforceOffspringInvariants(
|
|
129
|
-
context: OffspringContext,
|
|
130
|
-
offspring: default,
|
|
131
|
-
): void
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
Reapply minimum structural invariants after crossover.
|
|
135
|
-
|
|
136
|
-
Crossover can produce a child that is technically valid for heredity but still
|
|
137
|
-
missing the controller's minimum hidden-node or dead-end guarantees. This
|
|
138
|
-
helper keeps that cleanup local to offspring creation so later population code
|
|
139
|
-
can treat returned children as already normalized.
|
|
140
|
-
|
|
141
|
-
Parameters:
|
|
142
|
-
- `context` - - NEAT-like host containing population and options.
|
|
143
|
-
- `offspring` - - Newly crossed child genome.
|
|
144
|
-
|
|
145
|
-
Returns: Nothing.
|