@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
|
@@ -52,445 +52,484 @@ they reveal about the search?"
|
|
|
52
52
|
|
|
53
53
|
## neat/telemetry/metrics/telemetry.metrics.ts
|
|
54
54
|
|
|
55
|
-
###
|
|
55
|
+
### applyComplexityStatsMonoObjective
|
|
56
56
|
|
|
57
57
|
```ts
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
applyComplexityStatsMonoObjective(
|
|
59
|
+
telemetryContext: { _lastMeanNodes?: number | undefined; _lastMeanConns?: number | undefined; },
|
|
60
|
+
telemetryOptions: NeatOptions & TelemetryDiversityOptions,
|
|
61
|
+
populationSnapshot: GenomeDetailed[],
|
|
62
|
+
entry: TelemetryEntryRecord,
|
|
63
|
+
): void
|
|
62
64
|
```
|
|
63
65
|
|
|
64
|
-
|
|
65
|
-
generation.
|
|
66
|
+
Attach complexity stats for mono-objective mode.
|
|
66
67
|
|
|
67
68
|
Parameters:
|
|
68
|
-
- `
|
|
69
|
-
- `
|
|
70
|
-
|
|
71
|
-
Returns: Cached entropy number, or undefined when not available.
|
|
69
|
+
- `telemetryContext` - - Neat-like context with population state.
|
|
70
|
+
- `telemetryOptions` - - Options controlling complexity telemetry.
|
|
71
|
+
- `entry` - - Telemetry entry to update.
|
|
72
72
|
|
|
73
|
-
###
|
|
73
|
+
### applyComplexityStatsMultiObjective
|
|
74
74
|
|
|
75
75
|
```ts
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
applyComplexityStatsMultiObjective(
|
|
77
|
+
telemetryContext: { _lastMeanNodes?: number | undefined; _lastMeanConns?: number | undefined; },
|
|
78
|
+
telemetryOptions: NeatOptions & TelemetryDiversityOptions,
|
|
79
|
+
population: GenomeDetailed[],
|
|
80
|
+
entry: TelemetryEntryRecord,
|
|
81
|
+
): void
|
|
79
82
|
```
|
|
80
83
|
|
|
81
|
-
|
|
84
|
+
Attach complexity stats for multi-objective mode.
|
|
82
85
|
|
|
83
86
|
Parameters:
|
|
84
|
-
- `
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
- `telemetryContext` - - Neat-like context with population state.
|
|
88
|
+
- `telemetryOptions` - - Options controlling complexity telemetry.
|
|
89
|
+
- `population` - - Population snapshot.
|
|
90
|
+
- `entry` - - Telemetry entry to update.
|
|
87
91
|
|
|
88
|
-
###
|
|
92
|
+
### applyFastModeDefaults
|
|
89
93
|
|
|
90
94
|
```ts
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
applyFastModeDefaults(
|
|
96
|
+
telemetryContext: { _fastModeTuned?: boolean | undefined; },
|
|
97
|
+
telemetryOptions: NeatOptions & TelemetryDiversityOptions,
|
|
98
|
+
): void
|
|
94
99
|
```
|
|
95
100
|
|
|
96
|
-
|
|
101
|
+
Apply fast-mode tuning to diversity sampling and novelty defaults.
|
|
97
102
|
|
|
98
103
|
Parameters:
|
|
99
|
-
- `
|
|
100
|
-
|
|
101
|
-
Returns: Map degree -> number of nodes with that degree.
|
|
104
|
+
- `telemetryContext` - - Context object storing fast-mode tuning flag.
|
|
105
|
+
- `telemetryOptions` - - Options with diversity and novelty settings.
|
|
102
106
|
|
|
103
|
-
###
|
|
107
|
+
### applyHypervolumeTelemetry
|
|
104
108
|
|
|
105
109
|
```ts
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
applyHypervolumeTelemetry(
|
|
111
|
+
telemetryOptions: NeatOptions & TelemetryDiversityOptions,
|
|
112
|
+
hyperVolumeProxy: number,
|
|
113
|
+
entry: TelemetryEntryRecord,
|
|
114
|
+
): void
|
|
110
115
|
```
|
|
111
116
|
|
|
112
|
-
|
|
117
|
+
Attach hypervolume scalar when requested.
|
|
113
118
|
|
|
114
119
|
Parameters:
|
|
115
|
-
- `
|
|
116
|
-
- `
|
|
117
|
-
|
|
118
|
-
Returns: Entropy value (non-negative).
|
|
120
|
+
- `telemetryOptions` - - Options controlling telemetry fields.
|
|
121
|
+
- `hyperVolumeProxy` - - Hypervolume proxy value.
|
|
122
|
+
- `entry` - - Telemetry entry to update.
|
|
119
123
|
|
|
120
|
-
###
|
|
124
|
+
### applyLineageStatsMonoObjective
|
|
121
125
|
|
|
122
126
|
```ts
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
applyLineageStatsMonoObjective(
|
|
128
|
+
telemetryContext: { _lineageEnabled?: boolean | undefined; _getRNG?: (() => () => number) | undefined; _lastMeanDepth?: number | undefined; _prevInbreedingCount?: number | undefined; },
|
|
129
|
+
populationSnapshot: GenomeDetailed[],
|
|
130
|
+
entry: TelemetryEntryRecord,
|
|
127
131
|
): void
|
|
128
132
|
```
|
|
129
133
|
|
|
130
|
-
|
|
134
|
+
Apply lineage stats for mono-objective mode using sampled ancestors.
|
|
131
135
|
|
|
132
136
|
Parameters:
|
|
133
|
-
- `
|
|
134
|
-
- `
|
|
135
|
-
- `
|
|
137
|
+
- `telemetryContext` - - Neat-like context with lineage settings.
|
|
138
|
+
- `population` - - Population snapshot.
|
|
139
|
+
- `entry` - - Telemetry entry to update.
|
|
136
140
|
|
|
137
|
-
###
|
|
141
|
+
### applyLineageStatsMultiObjective
|
|
138
142
|
|
|
139
143
|
```ts
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
+
applyLineageStatsMultiObjective(
|
|
145
|
+
telemetryContext: { _lineageEnabled?: boolean | undefined; _getRNG?: (() => () => number) | undefined; _lastMeanDepth?: number | undefined; _prevInbreedingCount?: number | undefined; },
|
|
146
|
+
population: GenomeDetailed[],
|
|
147
|
+
entry: TelemetryEntryRecord,
|
|
148
|
+
): void
|
|
144
149
|
```
|
|
145
150
|
|
|
146
|
-
|
|
147
|
-
not mutate the source entry.
|
|
151
|
+
Apply lineage stats for multi-objective mode using ancestor uniqueness.
|
|
148
152
|
|
|
149
153
|
Parameters:
|
|
150
|
-
- `
|
|
151
|
-
- `
|
|
152
|
-
|
|
153
|
-
Returns: Shallow snapshot of core fields that exist on the entry.
|
|
154
|
+
- `telemetryContext` - - Neat-like context with lineage settings.
|
|
155
|
+
- `population` - - Population snapshot.
|
|
156
|
+
- `entry` - - Telemetry entry to update.
|
|
154
157
|
|
|
155
|
-
###
|
|
158
|
+
### applyObjectiveAges
|
|
156
159
|
|
|
157
160
|
```ts
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
): Record<string, unknown>
|
|
161
|
+
applyObjectiveAges(
|
|
162
|
+
telemetryContext: { _objectiveAges?: Map<string, number> | undefined; },
|
|
163
|
+
entry: TelemetryEntryRecord,
|
|
164
|
+
): void
|
|
163
165
|
```
|
|
164
166
|
|
|
165
|
-
|
|
166
|
-
Mutates the provided entry in-place for efficiency.
|
|
167
|
+
Apply objective age snapshots to the entry.
|
|
167
168
|
|
|
168
169
|
Parameters:
|
|
169
|
-
- `
|
|
170
|
-
- `
|
|
171
|
-
- `fields` - - Core telemetry field keys that must be preserved.
|
|
172
|
-
|
|
173
|
-
Returns: The same entry reference after filtering.
|
|
170
|
+
- `telemetryContext` - - Neat-like context with objective ages.
|
|
171
|
+
- `entry` - - Telemetry entry to update.
|
|
174
172
|
|
|
175
|
-
###
|
|
173
|
+
### applyObjectiveEvents
|
|
176
174
|
|
|
177
175
|
```ts
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
176
|
+
applyObjectiveEvents(
|
|
177
|
+
telemetryContext: { _pendingObjectiveAdds?: string[] | undefined; _pendingObjectiveRemoves?: string[] | undefined; _objectiveEvents?: ObjectiveEvent[] | undefined; },
|
|
178
|
+
entry: TelemetryEntryRecord,
|
|
179
|
+
generation: number,
|
|
180
|
+
): void
|
|
182
181
|
```
|
|
183
182
|
|
|
184
|
-
|
|
185
|
-
Mutates the entry so the caller keeps the original reference.
|
|
183
|
+
Apply and flush objective lifecycle events.
|
|
186
184
|
|
|
187
185
|
Parameters:
|
|
188
|
-
- `
|
|
189
|
-
- `
|
|
186
|
+
- `telemetryContext` - - Neat-like context holding objective events.
|
|
187
|
+
- `entry` - - Telemetry entry to update.
|
|
188
|
+
- `generation` - - Generation index for event records.
|
|
190
189
|
|
|
191
|
-
|
|
190
|
+
### applyObjectiveImportance
|
|
192
191
|
|
|
193
|
-
|
|
192
|
+
```ts
|
|
193
|
+
applyObjectiveImportance(
|
|
194
|
+
telemetryContext: { _lastObjImportance?: ObjImportance | undefined; },
|
|
195
|
+
entry: TelemetryEntryRecord,
|
|
196
|
+
): void
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Apply the most recent objective importance snapshot.
|
|
200
|
+
|
|
201
|
+
Parameters:
|
|
202
|
+
- `telemetryContext` - - Neat-like context with objective importance.
|
|
203
|
+
- `entry` - - Telemetry entry to update.
|
|
204
|
+
|
|
205
|
+
### applyObjectivesSnapshot
|
|
194
206
|
|
|
195
207
|
```ts
|
|
196
|
-
|
|
197
|
-
telemetryContext:
|
|
198
|
-
|
|
199
|
-
applyTelemetrySelectFn: (this: TContext, entry: Record<string, unknown>) => Record<string, unknown>,
|
|
208
|
+
applyObjectivesSnapshot(
|
|
209
|
+
telemetryContext: { _getObjectives?: (() => { key: string; }[]) | undefined; },
|
|
210
|
+
entry: TelemetryEntryRecord,
|
|
200
211
|
): void
|
|
201
212
|
```
|
|
202
213
|
|
|
203
|
-
Apply
|
|
214
|
+
Apply objectives list snapshot (keys only).
|
|
204
215
|
|
|
205
216
|
Parameters:
|
|
206
|
-
- `telemetryContext` - - Neat-like context with
|
|
207
|
-
- `
|
|
208
|
-
- `applyTelemetrySelectFn` - - Selection helper to invoke.
|
|
217
|
+
- `telemetryContext` - - Neat-like context with objective provider.
|
|
218
|
+
- `entry` - - Telemetry entry to update.
|
|
209
219
|
|
|
210
|
-
###
|
|
220
|
+
### applyPerformanceStats
|
|
211
221
|
|
|
212
222
|
```ts
|
|
213
|
-
|
|
214
|
-
telemetryContext: {
|
|
223
|
+
applyPerformanceStats(
|
|
224
|
+
telemetryContext: { _lastEvalDuration?: number | undefined; _lastEvolveDuration?: number | undefined; },
|
|
215
225
|
telemetryOptions: NeatOptions & TelemetryDiversityOptions,
|
|
226
|
+
entry: TelemetryEntryRecord,
|
|
216
227
|
): void
|
|
217
228
|
```
|
|
218
229
|
|
|
219
|
-
|
|
230
|
+
Attach performance stats when configured.
|
|
220
231
|
|
|
221
232
|
Parameters:
|
|
222
|
-
- `telemetryContext` - -
|
|
223
|
-
- `telemetryOptions` - - Options
|
|
233
|
+
- `telemetryContext` - - Neat-like context with performance data.
|
|
234
|
+
- `telemetryOptions` - - Options controlling performance telemetry.
|
|
235
|
+
- `entry` - - Telemetry entry to update.
|
|
224
236
|
|
|
225
|
-
###
|
|
237
|
+
### applyRngState
|
|
226
238
|
|
|
227
239
|
```ts
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
compatibilityDistance: ((a: TelemetryGenome, b: TelemetryGenome) => number) | undefined,
|
|
234
|
-
): { meanCompat: number; varCompat: number; }
|
|
240
|
+
applyRngState(
|
|
241
|
+
telemetryContext: { _rngState?: unknown; },
|
|
242
|
+
telemetryOptions: NeatOptions & TelemetryDiversityOptions,
|
|
243
|
+
entry: TelemetryEntryRecord,
|
|
244
|
+
): void
|
|
235
245
|
```
|
|
236
246
|
|
|
237
|
-
|
|
247
|
+
Attach RNG state when configured.
|
|
238
248
|
|
|
239
249
|
Parameters:
|
|
240
|
-
- `
|
|
241
|
-
- `
|
|
242
|
-
- `
|
|
243
|
-
- `rngFactoryFn` - - RNG factory returning a uniform random function.
|
|
244
|
-
- `compatibilityDistance` - - Optional compatibility distance function.
|
|
250
|
+
- `telemetryContext` - - Neat-like context with RNG state.
|
|
251
|
+
- `telemetryOptions` - - Options controlling RNG telemetry.
|
|
252
|
+
- `entry` - - Telemetry entry to update.
|
|
245
253
|
|
|
246
|
-
|
|
254
|
+
### applySpeciesAllocation
|
|
247
255
|
|
|
248
|
-
|
|
256
|
+
```ts
|
|
257
|
+
applySpeciesAllocation(
|
|
258
|
+
telemetryContext: { _lastOffspringAlloc?: SpeciesAlloc[] | undefined; },
|
|
259
|
+
entry: TelemetryEntryRecord,
|
|
260
|
+
): void
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Apply per-species offspring allocation snapshot.
|
|
264
|
+
|
|
265
|
+
Parameters:
|
|
266
|
+
- `telemetryContext` - - Neat-like context with allocation snapshot.
|
|
267
|
+
- `entry` - - Telemetry entry to update.
|
|
268
|
+
|
|
269
|
+
### buildComplexityEntry
|
|
249
270
|
|
|
250
271
|
```ts
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
272
|
+
buildComplexityEntry(
|
|
273
|
+
telemetryOptions: NeatOptions & TelemetryDiversityOptions,
|
|
274
|
+
meanCounts: { meanNodes: number; meanConns: number; },
|
|
275
|
+
maxCounts: { maxNodes: number; maxConns: number; },
|
|
276
|
+
meanEnabledRatio: number,
|
|
277
|
+
growthValues: { growthNodes: number; growthConns: number; },
|
|
278
|
+
): { meanNodes: number; meanConns: number; maxNodes: number; maxConns: number; meanEnabledRatio: number; growthNodes: number; growthConns: number; budgetMaxNodes: number; budgetMaxConns: number; }
|
|
255
279
|
```
|
|
256
280
|
|
|
257
|
-
|
|
281
|
+
Build the complexity entry payload for multi-objective mode.
|
|
258
282
|
|
|
259
283
|
Parameters:
|
|
260
|
-
- `
|
|
261
|
-
- `
|
|
284
|
+
- `telemetryOptions` - - Options controlling complexity telemetry.
|
|
285
|
+
- `meanCounts` - - Mean node/connection counts.
|
|
286
|
+
- `maxCounts` - - Max node/connection counts.
|
|
287
|
+
- `meanEnabledRatio` - - Mean enabled ratio.
|
|
288
|
+
- `growthValues` - - Growth deltas.
|
|
262
289
|
|
|
263
|
-
Returns:
|
|
290
|
+
Returns: Complexity entry payload.
|
|
264
291
|
|
|
265
|
-
###
|
|
292
|
+
### buildDegreeHistogram
|
|
266
293
|
|
|
267
294
|
```ts
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
graphletSampleCount: number,
|
|
272
|
-
rngFactoryFn: () => () => number,
|
|
273
|
-
): number
|
|
295
|
+
buildDegreeHistogram(
|
|
296
|
+
counts: Record<number, number>,
|
|
297
|
+
): Record<number, number>
|
|
274
298
|
```
|
|
275
299
|
|
|
276
|
-
|
|
300
|
+
Build a histogram of degree frequencies from a degree-count table.
|
|
277
301
|
|
|
278
302
|
Parameters:
|
|
279
|
-
- `
|
|
280
|
-
- `size` - - Population size.
|
|
281
|
-
- `graphletSampleCount` - - Number of graphlets to sample.
|
|
282
|
-
- `rngFactoryFn` - - RNG factory returning a uniform random function.
|
|
303
|
+
- `counts` - - Map geneId -> degree count.
|
|
283
304
|
|
|
284
|
-
Returns:
|
|
305
|
+
Returns: Map degree -> number of nodes with that degree.
|
|
285
306
|
|
|
286
|
-
###
|
|
307
|
+
### buildLineageContext
|
|
287
308
|
|
|
288
309
|
```ts
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
): number[]
|
|
310
|
+
buildLineageContext(
|
|
311
|
+
context: { _getRNG?: (() => () => number) | undefined; },
|
|
312
|
+
populationSnapshot: GenomeDetailed[],
|
|
313
|
+
): NeatLineageContext
|
|
294
314
|
```
|
|
295
315
|
|
|
296
|
-
|
|
316
|
+
Build a lineage helper context for ancestor operations.
|
|
297
317
|
|
|
298
318
|
Parameters:
|
|
299
|
-
- `
|
|
300
|
-
- `
|
|
301
|
-
- `rng` - - RNG function returning values in [0,1).
|
|
319
|
+
- `context` - - Neat-like context with RNG helpers.
|
|
320
|
+
- `populationSnapshot` - - Population snapshot.
|
|
302
321
|
|
|
303
|
-
Returns:
|
|
322
|
+
Returns: Lineage helper context.
|
|
304
323
|
|
|
305
|
-
###
|
|
324
|
+
### buildLineageEntry
|
|
306
325
|
|
|
307
326
|
```ts
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
327
|
+
buildLineageEntry(
|
|
328
|
+
context: { _prevInbreedingCount?: number | undefined; },
|
|
329
|
+
bestGenomeSnapshot: GenomeDetailed,
|
|
330
|
+
meanDepthValue: number,
|
|
331
|
+
ancestorUniquenessScore: number,
|
|
332
|
+
): { parents: number[]; depthBest: number; meanDepth: number; inbreeding: number; ancestorUniq: number; }
|
|
312
333
|
```
|
|
313
334
|
|
|
314
|
-
|
|
335
|
+
Build the lineage entry payload.
|
|
315
336
|
|
|
316
337
|
Parameters:
|
|
317
|
-
- `
|
|
318
|
-
- `
|
|
338
|
+
- `context` - - Neat-like context with lineage info.
|
|
339
|
+
- `bestGenomeSnapshot` - - Best genome snapshot.
|
|
340
|
+
- `meanDepthValue` - - Mean lineage depth.
|
|
341
|
+
- `ancestorUniquenessScore` - - Ancestor uniqueness score.
|
|
319
342
|
|
|
320
|
-
Returns:
|
|
343
|
+
Returns: Lineage entry payload.
|
|
321
344
|
|
|
322
|
-
###
|
|
345
|
+
### collectDepths
|
|
323
346
|
|
|
324
347
|
```ts
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
):
|
|
348
|
+
collectDepths(
|
|
349
|
+
populationSnapshot: GenomeDetailed[],
|
|
350
|
+
): number[]
|
|
328
351
|
```
|
|
329
352
|
|
|
330
|
-
|
|
353
|
+
Collect depth values for the current population.
|
|
331
354
|
|
|
332
355
|
Parameters:
|
|
333
|
-
- `
|
|
356
|
+
- `populationSnapshot` - - Population snapshot.
|
|
334
357
|
|
|
335
|
-
Returns:
|
|
358
|
+
Returns: Array of depth values (defaults to 0).
|
|
336
359
|
|
|
337
|
-
###
|
|
360
|
+
### collectPopulationCounts
|
|
338
361
|
|
|
339
362
|
```ts
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
): {
|
|
363
|
+
collectPopulationCounts(
|
|
364
|
+
populationSnapshot: GenomeDetailed[],
|
|
365
|
+
): { nodeCounts: number[]; connectionCounts: number[]; }
|
|
343
366
|
```
|
|
344
367
|
|
|
345
|
-
|
|
368
|
+
Collect node and connection counts for the population.
|
|
346
369
|
|
|
347
370
|
Parameters:
|
|
348
|
-
- `
|
|
371
|
+
- `populationSnapshot` - - Population snapshot.
|
|
349
372
|
|
|
350
|
-
Returns:
|
|
373
|
+
Returns: Node and connection counts arrays.
|
|
351
374
|
|
|
352
|
-
###
|
|
375
|
+
### computeAncestorUniquenessSampled
|
|
353
376
|
|
|
354
377
|
```ts
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
378
|
+
computeAncestorUniquenessSampled(
|
|
379
|
+
context: { _getRNG?: (() => () => number) | undefined; },
|
|
380
|
+
populationSnapshot: GenomeDetailed[],
|
|
358
381
|
): number
|
|
359
382
|
```
|
|
360
383
|
|
|
361
|
-
Compute
|
|
384
|
+
Compute ancestor uniqueness using sampled Jaccard distance.
|
|
362
385
|
|
|
363
386
|
Parameters:
|
|
364
|
-
- `
|
|
365
|
-
- `
|
|
387
|
+
- `context` - - Neat-like context with RNG helpers.
|
|
388
|
+
- `populationSnapshot` - - Population snapshot.
|
|
366
389
|
|
|
367
|
-
Returns:
|
|
390
|
+
Returns: Rounded ancestor uniqueness score.
|
|
368
391
|
|
|
369
|
-
###
|
|
392
|
+
### computeAndStoreGrowthValues
|
|
370
393
|
|
|
371
394
|
```ts
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
395
|
+
computeAndStoreGrowthValues(
|
|
396
|
+
context: { _lastMeanNodes?: number | undefined; _lastMeanConns?: number | undefined; },
|
|
397
|
+
meanCounts: { meanNodes: number; meanConns: number; },
|
|
398
|
+
): { growthNodes: number; growthConns: number; }
|
|
375
399
|
```
|
|
376
400
|
|
|
377
|
-
Compute
|
|
401
|
+
Compute growth values and store the latest means on the context.
|
|
378
402
|
|
|
379
403
|
Parameters:
|
|
380
|
-
- `
|
|
404
|
+
- `context` - - Neat-like context with previous mean values.
|
|
405
|
+
- `meanCounts` - - Current mean node/connection counts.
|
|
381
406
|
|
|
382
|
-
Returns:
|
|
407
|
+
Returns: Growth values for nodes and connections.
|
|
383
408
|
|
|
384
|
-
###
|
|
409
|
+
### computeCompatibilityStats
|
|
385
410
|
|
|
386
411
|
```ts
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
412
|
+
computeCompatibilityStats(
|
|
413
|
+
genomes: TelemetryGenome[],
|
|
414
|
+
size: number,
|
|
415
|
+
pairSampleCount: number,
|
|
416
|
+
rngFactoryFn: () => () => number,
|
|
417
|
+
compatibilityDistance: ((a: TelemetryGenome, b: TelemetryGenome) => number) | undefined,
|
|
418
|
+
): { meanCompat: number; varCompat: number; }
|
|
391
419
|
```
|
|
392
420
|
|
|
393
|
-
|
|
421
|
+
Compute pairwise compatibility statistics via sampling.
|
|
394
422
|
|
|
395
423
|
Parameters:
|
|
396
|
-
- `
|
|
397
|
-
- `
|
|
424
|
+
- `genomes` - - Population snapshot.
|
|
425
|
+
- `size` - - Population size.
|
|
426
|
+
- `pairSampleCount` - - Number of pairs to sample.
|
|
427
|
+
- `rngFactoryFn` - - RNG factory returning a uniform random function.
|
|
428
|
+
- `compatibilityDistance` - - Optional compatibility distance function.
|
|
398
429
|
|
|
399
|
-
|
|
430
|
+
Returns: Mean and variance of sampled compatibilities.
|
|
431
|
+
|
|
432
|
+
### computeDegreeCounts
|
|
400
433
|
|
|
401
434
|
```ts
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
): void
|
|
435
|
+
computeDegreeCounts(
|
|
436
|
+
entropyGraph: { nodes: { geneId: number; }[]; connections: { from: { geneId: number; }; to: { geneId: number; }; enabled: boolean; }[]; },
|
|
437
|
+
): Record<number, number>
|
|
406
438
|
```
|
|
407
439
|
|
|
408
|
-
|
|
440
|
+
Compute per-node degree counts for enabled connections.
|
|
409
441
|
|
|
410
442
|
Parameters:
|
|
411
|
-
- `
|
|
412
|
-
- `entry` - - Telemetry entry to update.
|
|
443
|
+
- `entropyGraph` - - Genome-like graph object.
|
|
413
444
|
|
|
414
|
-
|
|
445
|
+
Returns: Map geneId -> degree count.
|
|
446
|
+
|
|
447
|
+
### computeEnabledRatios
|
|
415
448
|
|
|
416
449
|
```ts
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
generation: number,
|
|
421
|
-
): void
|
|
450
|
+
computeEnabledRatios(
|
|
451
|
+
populationSnapshot: GenomeDetailed[],
|
|
452
|
+
): number[]
|
|
422
453
|
```
|
|
423
454
|
|
|
424
|
-
|
|
455
|
+
Compute enabled ratios per genome.
|
|
425
456
|
|
|
426
457
|
Parameters:
|
|
427
|
-
- `
|
|
428
|
-
- `entry` - - Telemetry entry to update.
|
|
429
|
-
- `generation` - - Generation index for event records.
|
|
458
|
+
- `populationSnapshot` - - Population snapshot.
|
|
430
459
|
|
|
431
|
-
|
|
460
|
+
Returns: Array of enabled ratios.
|
|
461
|
+
|
|
462
|
+
### computeEntropyFromHistogram
|
|
432
463
|
|
|
433
464
|
```ts
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
):
|
|
465
|
+
computeEntropyFromHistogram(
|
|
466
|
+
histogram: Record<number, number>,
|
|
467
|
+
totalNodes: number,
|
|
468
|
+
): number
|
|
438
469
|
```
|
|
439
470
|
|
|
440
|
-
|
|
471
|
+
Compute entropy from a degree-frequency histogram.
|
|
441
472
|
|
|
442
473
|
Parameters:
|
|
443
|
-
- `
|
|
444
|
-
- `
|
|
474
|
+
- `histogram` - - Map degree -> number of nodes.
|
|
475
|
+
- `totalNodes` - - Total node count used to normalize into probabilities.
|
|
445
476
|
|
|
446
|
-
|
|
477
|
+
Returns: Entropy value (non-negative).
|
|
478
|
+
|
|
479
|
+
### computeEntropyStats
|
|
447
480
|
|
|
448
481
|
```ts
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
):
|
|
482
|
+
computeEntropyStats(
|
|
483
|
+
genomes: TelemetryGenome[],
|
|
484
|
+
structuralEntropyFn: (genome: TelemetryGenome) => number,
|
|
485
|
+
): { meanEntropy: number; varEntropy: number; }
|
|
453
486
|
```
|
|
454
487
|
|
|
455
|
-
|
|
488
|
+
Compute structural entropy mean and variance across the population.
|
|
456
489
|
|
|
457
490
|
Parameters:
|
|
458
|
-
- `
|
|
459
|
-
- `
|
|
491
|
+
- `genomes` - - Population snapshot.
|
|
492
|
+
- `structuralEntropyFn` - - Function to compute entropy for a genome.
|
|
460
493
|
|
|
461
|
-
|
|
494
|
+
Returns: Mean and variance of entropy values.
|
|
495
|
+
|
|
496
|
+
### computeGraphletEntropy
|
|
462
497
|
|
|
463
498
|
```ts
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
499
|
+
computeGraphletEntropy(
|
|
500
|
+
genomes: TelemetryGenome[],
|
|
501
|
+
size: number,
|
|
502
|
+
graphletSampleCount: number,
|
|
503
|
+
rngFactoryFn: () => () => number,
|
|
504
|
+
): number
|
|
469
505
|
```
|
|
470
506
|
|
|
471
|
-
|
|
507
|
+
Sample graphlet motifs and compute entropy over their edge counts.
|
|
472
508
|
|
|
473
509
|
Parameters:
|
|
474
|
-
- `
|
|
475
|
-
- `
|
|
476
|
-
- `
|
|
510
|
+
- `genomes` - - Population snapshot.
|
|
511
|
+
- `size` - - Population size.
|
|
512
|
+
- `graphletSampleCount` - - Number of graphlets to sample.
|
|
513
|
+
- `rngFactoryFn` - - RNG factory returning a uniform random function.
|
|
477
514
|
|
|
478
|
-
|
|
515
|
+
Returns: Graphlet entropy value.
|
|
516
|
+
|
|
517
|
+
### computeHyperVolumeProxy
|
|
479
518
|
|
|
480
519
|
```ts
|
|
481
|
-
|
|
482
|
-
telemetryContext: { _rngState?: unknown; },
|
|
520
|
+
computeHyperVolumeProxy(
|
|
483
521
|
telemetryOptions: NeatOptions & TelemetryDiversityOptions,
|
|
484
|
-
|
|
485
|
-
):
|
|
522
|
+
population: GenomeDetailed[],
|
|
523
|
+
): number
|
|
486
524
|
```
|
|
487
525
|
|
|
488
|
-
|
|
526
|
+
Compute a hypervolume-like proxy for the Pareto front.
|
|
489
527
|
|
|
490
528
|
Parameters:
|
|
491
|
-
- `
|
|
492
|
-
- `
|
|
493
|
-
|
|
529
|
+
- `telemetryOptions` - - Options controlling complexity metric.
|
|
530
|
+
- `population` - - Population snapshot.
|
|
531
|
+
|
|
532
|
+
Returns: Hypervolume proxy value.
|
|
494
533
|
|
|
495
534
|
### computeLineageStats
|
|
496
535
|
|
|
@@ -515,71 +554,35 @@ Parameters:
|
|
|
515
554
|
|
|
516
555
|
Returns: Lineage mean depth and pairwise distance.
|
|
517
556
|
|
|
518
|
-
###
|
|
519
|
-
|
|
520
|
-
```ts
|
|
521
|
-
applyLineageStatsMultiObjective(
|
|
522
|
-
telemetryContext: { _lineageEnabled?: boolean | undefined; _getRNG?: (() => () => number) | undefined; _lastMeanDepth?: number | undefined; _prevInbreedingCount?: number | undefined; },
|
|
523
|
-
population: GenomeDetailed[],
|
|
524
|
-
entry: TelemetryEntryRecord,
|
|
525
|
-
): void
|
|
526
|
-
```
|
|
527
|
-
|
|
528
|
-
Apply lineage stats for multi-objective mode using ancestor uniqueness.
|
|
529
|
-
|
|
530
|
-
Parameters:
|
|
531
|
-
- `telemetryContext` - - Neat-like context with lineage settings.
|
|
532
|
-
- `population` - - Population snapshot.
|
|
533
|
-
- `entry` - - Telemetry entry to update.
|
|
534
|
-
|
|
535
|
-
### applyLineageStatsMonoObjective
|
|
536
|
-
|
|
537
|
-
```ts
|
|
538
|
-
applyLineageStatsMonoObjective(
|
|
539
|
-
telemetryContext: { _lineageEnabled?: boolean | undefined; _getRNG?: (() => () => number) | undefined; _lastMeanDepth?: number | undefined; _prevInbreedingCount?: number | undefined; },
|
|
540
|
-
populationSnapshot: GenomeDetailed[],
|
|
541
|
-
entry: TelemetryEntryRecord,
|
|
542
|
-
): void
|
|
543
|
-
```
|
|
544
|
-
|
|
545
|
-
Apply lineage stats for mono-objective mode using sampled ancestors.
|
|
546
|
-
|
|
547
|
-
Parameters:
|
|
548
|
-
- `telemetryContext` - - Neat-like context with lineage settings.
|
|
549
|
-
- `population` - - Population snapshot.
|
|
550
|
-
- `entry` - - Telemetry entry to update.
|
|
551
|
-
|
|
552
|
-
### isLineageEligible
|
|
557
|
+
### computeMaxCounts
|
|
553
558
|
|
|
554
559
|
```ts
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
): boolean
|
|
560
|
+
computeMaxCounts(
|
|
561
|
+
counts: { nodeCounts: number[]; connectionCounts: number[]; },
|
|
562
|
+
): { maxNodes: number; maxConns: number; }
|
|
559
563
|
```
|
|
560
564
|
|
|
561
|
-
|
|
565
|
+
Compute max node and connection counts.
|
|
562
566
|
|
|
563
567
|
Parameters:
|
|
564
|
-
- `
|
|
565
|
-
- `populationSnapshot` - - Population snapshot to validate.
|
|
568
|
+
- `counts` - - Node and connection counts arrays.
|
|
566
569
|
|
|
567
|
-
Returns:
|
|
570
|
+
Returns: Max node and connection counts.
|
|
568
571
|
|
|
569
|
-
###
|
|
572
|
+
### computeMeanCounts
|
|
570
573
|
|
|
571
574
|
```ts
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
): number
|
|
575
|
+
computeMeanCounts(
|
|
576
|
+
counts: { nodeCounts: number[]; connectionCounts: number[]; },
|
|
577
|
+
): { meanNodes: number; meanConns: number; }
|
|
575
578
|
```
|
|
576
579
|
|
|
577
|
-
|
|
580
|
+
Compute mean node and connection counts.
|
|
578
581
|
|
|
579
582
|
Parameters:
|
|
580
|
-
- `
|
|
583
|
+
- `counts` - - Node and connection counts arrays.
|
|
581
584
|
|
|
582
|
-
Returns:
|
|
585
|
+
Returns: Mean node and connection counts.
|
|
583
586
|
|
|
584
587
|
### computeMeanDepth
|
|
585
588
|
|
|
@@ -596,39 +599,35 @@ Parameters:
|
|
|
596
599
|
|
|
597
600
|
Returns: Mean depth value.
|
|
598
601
|
|
|
599
|
-
###
|
|
602
|
+
### computeMeanEnabledRatio
|
|
600
603
|
|
|
601
604
|
```ts
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
populationSnapshot: GenomeDetailed[],
|
|
605
|
+
computeMeanEnabledRatio(
|
|
606
|
+
enabledRatios: number[],
|
|
605
607
|
): number
|
|
606
608
|
```
|
|
607
609
|
|
|
608
|
-
Compute
|
|
610
|
+
Compute mean of enabled ratios.
|
|
609
611
|
|
|
610
612
|
Parameters:
|
|
611
|
-
- `
|
|
612
|
-
- `populationSnapshot` - - Population snapshot.
|
|
613
|
+
- `enabledRatios` - - Enabled ratios per genome.
|
|
613
614
|
|
|
614
|
-
Returns:
|
|
615
|
+
Returns: Mean enabled ratio.
|
|
615
616
|
|
|
616
|
-
###
|
|
617
|
+
### computeOperatorStatsSnapshot
|
|
617
618
|
|
|
618
619
|
```ts
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
): { firstIndex: number; secondIndex: number; }
|
|
620
|
+
computeOperatorStatsSnapshot(
|
|
621
|
+
operatorStats: OperatorStatsMap | undefined,
|
|
622
|
+
): { op: string; succ: number; att: number; }[]
|
|
623
623
|
```
|
|
624
624
|
|
|
625
|
-
|
|
625
|
+
Snapshot operator statistics into a telemetry-friendly array.
|
|
626
626
|
|
|
627
627
|
Parameters:
|
|
628
|
-
- `
|
|
629
|
-
- `populationSize` - - Population size for index bounds.
|
|
628
|
+
- `operatorStats` - - Operator stats map (opName -> success/attempts).
|
|
630
629
|
|
|
631
|
-
Returns:
|
|
630
|
+
Returns: Operator stats snapshot array.
|
|
632
631
|
|
|
633
632
|
### computePairJaccardDistance
|
|
634
633
|
|
|
@@ -651,22 +650,20 @@ Parameters:
|
|
|
651
650
|
|
|
652
651
|
Returns: Jaccard distance or undefined when both sets are empty.
|
|
653
652
|
|
|
654
|
-
###
|
|
655
|
-
|
|
656
|
-
```ts
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
): NeatLineageContext
|
|
653
|
+
### computeParetoFrontSizes
|
|
654
|
+
|
|
655
|
+
```ts
|
|
656
|
+
computeParetoFrontSizes(
|
|
657
|
+
population: GenomeDetailed[],
|
|
658
|
+
): number[]
|
|
661
659
|
```
|
|
662
660
|
|
|
663
|
-
|
|
661
|
+
Compute sizes of early Pareto fronts.
|
|
664
662
|
|
|
665
663
|
Parameters:
|
|
666
|
-
- `
|
|
667
|
-
- `populationSnapshot` - - Population snapshot.
|
|
664
|
+
- `population` - - Population snapshot.
|
|
668
665
|
|
|
669
|
-
Returns:
|
|
666
|
+
Returns: Array of front sizes (rank 0..4).
|
|
670
667
|
|
|
671
668
|
### countAncestorIntersection
|
|
672
669
|
|
|
@@ -685,195 +682,198 @@ Parameters:
|
|
|
685
682
|
|
|
686
683
|
Returns: Intersection count.
|
|
687
684
|
|
|
688
|
-
###
|
|
685
|
+
### countEnabledEdges
|
|
689
686
|
|
|
690
687
|
```ts
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
ancestorUniquenessScore: number,
|
|
696
|
-
): { parents: number[]; depthBest: number; meanDepth: number; inbreeding: number; ancestorUniq: number; }
|
|
688
|
+
countEnabledEdges(
|
|
689
|
+
genome: TelemetryGenome,
|
|
690
|
+
selectedNodes: NodeLike[],
|
|
691
|
+
): number
|
|
697
692
|
```
|
|
698
693
|
|
|
699
|
-
|
|
694
|
+
Count enabled edges between the selected nodes in a genome.
|
|
700
695
|
|
|
701
696
|
Parameters:
|
|
702
|
-
- `
|
|
703
|
-
- `
|
|
704
|
-
- `meanDepthValue` - - Mean lineage depth.
|
|
705
|
-
- `ancestorUniquenessScore` - - Ancestor uniqueness score.
|
|
697
|
+
- `genome` - - Genome with connections to inspect.
|
|
698
|
+
- `selectedNodes` - - Nodes forming the graphlet sample.
|
|
706
699
|
|
|
707
|
-
Returns:
|
|
700
|
+
Returns: Edge count capped at 3.
|
|
708
701
|
|
|
709
|
-
###
|
|
702
|
+
### getCachedEntropy
|
|
710
703
|
|
|
711
704
|
```ts
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
705
|
+
getCachedEntropy(
|
|
706
|
+
generation: number | undefined,
|
|
707
|
+
entropyGraph: Record<string, unknown>,
|
|
708
|
+
): number | undefined
|
|
715
709
|
```
|
|
716
710
|
|
|
717
|
-
|
|
711
|
+
Read a cached entropy value if it exists and belongs to the current
|
|
712
|
+
generation.
|
|
718
713
|
|
|
719
714
|
Parameters:
|
|
720
|
-
- `
|
|
715
|
+
- `generation` - - Current generation number.
|
|
716
|
+
- `entropyGraph` - - Genome-like graph object.
|
|
721
717
|
|
|
722
|
-
Returns:
|
|
718
|
+
Returns: Cached entropy number, or undefined when not available.
|
|
723
719
|
|
|
724
|
-
###
|
|
720
|
+
### getTelemetryCoreSnapshot
|
|
725
721
|
|
|
726
722
|
```ts
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
723
|
+
getTelemetryCoreSnapshot(
|
|
724
|
+
sourceEntry: Record<string, unknown>,
|
|
725
|
+
fields: TelemetryCoreFields,
|
|
726
|
+
): Partial<Record<string, unknown>>
|
|
730
727
|
```
|
|
731
728
|
|
|
732
|
-
|
|
729
|
+
Build a snapshot of the core telemetry fields present on the entry; does
|
|
730
|
+
not mutate the source entry.
|
|
733
731
|
|
|
734
732
|
Parameters:
|
|
735
|
-
- `
|
|
733
|
+
- `sourceEntry` - - Source telemetry object.
|
|
734
|
+
- `fields` - - Core telemetry field keys to preserve.
|
|
736
735
|
|
|
737
|
-
Returns:
|
|
736
|
+
Returns: Shallow snapshot of core fields that exist on the entry.
|
|
738
737
|
|
|
739
|
-
###
|
|
738
|
+
### isLineageEligible
|
|
740
739
|
|
|
741
740
|
```ts
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
741
|
+
isLineageEligible(
|
|
742
|
+
context: { _lineageEnabled?: boolean | undefined; },
|
|
743
|
+
populationSnapshot: GenomeDetailed[],
|
|
744
|
+
): boolean
|
|
745
745
|
```
|
|
746
746
|
|
|
747
|
-
|
|
747
|
+
Check whether lineage metrics should be computed.
|
|
748
748
|
|
|
749
749
|
Parameters:
|
|
750
|
-
- `
|
|
750
|
+
- `context` - - Neat-like context with lineage flag.
|
|
751
|
+
- `populationSnapshot` - - Population snapshot to validate.
|
|
751
752
|
|
|
752
|
-
Returns:
|
|
753
|
+
Returns: True when lineage stats should be computed.
|
|
753
754
|
|
|
754
|
-
###
|
|
755
|
+
### mergeTelemetryCoreFields
|
|
755
756
|
|
|
756
757
|
```ts
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
758
|
+
mergeTelemetryCoreFields(
|
|
759
|
+
sourceEntry: Record<string, unknown>,
|
|
760
|
+
coreSnapshot: Partial<Record<string, unknown>>,
|
|
761
|
+
): Record<string, unknown>
|
|
760
762
|
```
|
|
761
763
|
|
|
762
|
-
|
|
764
|
+
Re-attach core fields to the filtered entry.
|
|
765
|
+
Mutates the entry so the caller keeps the original reference.
|
|
763
766
|
|
|
764
767
|
Parameters:
|
|
765
|
-
- `
|
|
768
|
+
- `sourceEntry` - - Filtered telemetry entry to update.
|
|
769
|
+
- `coreSnapshot` - - Snapshot of core fields to ensure presence.
|
|
766
770
|
|
|
767
|
-
Returns:
|
|
771
|
+
Returns: The same entry reference with core fields restored.
|
|
768
772
|
|
|
769
|
-
###
|
|
773
|
+
### pickDistinctIndices
|
|
770
774
|
|
|
771
775
|
```ts
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
776
|
+
pickDistinctIndices(
|
|
777
|
+
upperBound: number,
|
|
778
|
+
count: number,
|
|
779
|
+
rng: () => number,
|
|
780
|
+
): number[]
|
|
775
781
|
```
|
|
776
782
|
|
|
777
|
-
|
|
783
|
+
Pick a fixed number of distinct random indices.
|
|
778
784
|
|
|
779
785
|
Parameters:
|
|
780
|
-
- `
|
|
786
|
+
- `upperBound` - - Exclusive upper bound for random indices.
|
|
787
|
+
- `count` - - Number of distinct indices to pick.
|
|
788
|
+
- `rng` - - RNG function returning values in [0,1).
|
|
781
789
|
|
|
782
|
-
Returns:
|
|
790
|
+
Returns: Array of distinct indices.
|
|
783
791
|
|
|
784
|
-
###
|
|
792
|
+
### pickDistinctPairIndices
|
|
785
793
|
|
|
786
794
|
```ts
|
|
787
|
-
|
|
788
|
-
context: {
|
|
789
|
-
|
|
790
|
-
): {
|
|
795
|
+
pickDistinctPairIndices(
|
|
796
|
+
context: { _getRNG?: (() => () => number) | undefined; },
|
|
797
|
+
populationSize: number,
|
|
798
|
+
): { firstIndex: number; secondIndex: number; }
|
|
791
799
|
```
|
|
792
800
|
|
|
793
|
-
|
|
801
|
+
Pick two distinct indices using the context RNG.
|
|
794
802
|
|
|
795
803
|
Parameters:
|
|
796
|
-
- `context` - - Neat-like context with
|
|
797
|
-
- `
|
|
804
|
+
- `context` - - Neat-like context with RNG factory.
|
|
805
|
+
- `populationSize` - - Population size for index bounds.
|
|
798
806
|
|
|
799
|
-
Returns:
|
|
807
|
+
Returns: Pair of distinct indices.
|
|
800
808
|
|
|
801
|
-
###
|
|
809
|
+
### readOperatorStats
|
|
802
810
|
|
|
803
811
|
```ts
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
maxCounts: { maxNodes: number; maxConns: number; },
|
|
808
|
-
meanEnabledRatio: number,
|
|
809
|
-
growthValues: { growthNodes: number; growthConns: number; },
|
|
810
|
-
): { meanNodes: number; meanConns: number; maxNodes: number; maxConns: number; meanEnabledRatio: number; growthNodes: number; growthConns: number; budgetMaxNodes: number; budgetMaxConns: number; }
|
|
812
|
+
readOperatorStats(
|
|
813
|
+
operatorStats: OperatorStatsMap | undefined,
|
|
814
|
+
): { name: string; success: number; attempts: number; }[]
|
|
811
815
|
```
|
|
812
816
|
|
|
813
|
-
|
|
817
|
+
Convert operator stats map into the public accessor shape.
|
|
814
818
|
|
|
815
819
|
Parameters:
|
|
816
|
-
- `
|
|
817
|
-
- `meanCounts` - - Mean node/connection counts.
|
|
818
|
-
- `maxCounts` - - Max node/connection counts.
|
|
819
|
-
- `meanEnabledRatio` - - Mean enabled ratio.
|
|
820
|
-
- `growthValues` - - Growth deltas.
|
|
820
|
+
- `operatorStats` - - Operator stats map stored on the host.
|
|
821
821
|
|
|
822
|
-
Returns:
|
|
822
|
+
Returns: Public operator summaries for dashboards and tests.
|
|
823
823
|
|
|
824
|
-
###
|
|
824
|
+
### safelyApplyTelemetrySelect
|
|
825
825
|
|
|
826
826
|
```ts
|
|
827
|
-
|
|
828
|
-
telemetryContext:
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
entry: TelemetryEntryRecord,
|
|
827
|
+
safelyApplyTelemetrySelect(
|
|
828
|
+
telemetryContext: TContext,
|
|
829
|
+
telemetryEntry: TelemetryEntry,
|
|
830
|
+
applyTelemetrySelectFn: (this: TContext, entry: Record<string, unknown>) => Record<string, unknown>,
|
|
832
831
|
): void
|
|
833
832
|
```
|
|
834
833
|
|
|
835
|
-
|
|
834
|
+
Apply telemetry selection while swallowing selection errors.
|
|
836
835
|
|
|
837
836
|
Parameters:
|
|
838
|
-
- `telemetryContext` - - Neat-like context with
|
|
839
|
-
- `
|
|
840
|
-
- `
|
|
841
|
-
- `entry` - - Telemetry entry to update.
|
|
837
|
+
- `telemetryContext` - - Neat-like context with telemetry selection.
|
|
838
|
+
- `telemetryEntry` - - Entry to filter in place.
|
|
839
|
+
- `applyTelemetrySelectFn` - - Selection helper to invoke.
|
|
842
840
|
|
|
843
|
-
###
|
|
841
|
+
### setCachedEntropy
|
|
844
842
|
|
|
845
843
|
```ts
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
entry: TelemetryEntryRecord,
|
|
844
|
+
setCachedEntropy(
|
|
845
|
+
generation: number | undefined,
|
|
846
|
+
entropyGraph: Record<string, unknown>,
|
|
847
|
+
entropyValue: number,
|
|
851
848
|
): void
|
|
852
849
|
```
|
|
853
850
|
|
|
854
|
-
|
|
851
|
+
Cache an entropy value for the current generation on the graph object.
|
|
855
852
|
|
|
856
853
|
Parameters:
|
|
857
|
-
- `
|
|
858
|
-
- `
|
|
859
|
-
- `
|
|
854
|
+
- `generation` - - Current generation number.
|
|
855
|
+
- `entropyGraph` - - Genome-like graph object.
|
|
856
|
+
- `entropyValue` - - Entropy value to cache.
|
|
860
857
|
|
|
861
|
-
###
|
|
858
|
+
### stripUnselectedTelemetryKeys
|
|
862
859
|
|
|
863
860
|
```ts
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
):
|
|
861
|
+
stripUnselectedTelemetryKeys(
|
|
862
|
+
sourceEntry: Record<string, unknown>,
|
|
863
|
+
selection: Set<string>,
|
|
864
|
+
fields: TelemetryCoreFields,
|
|
865
|
+
): Record<string, unknown>
|
|
869
866
|
```
|
|
870
867
|
|
|
871
|
-
|
|
868
|
+
Remove non-core keys that are not whitelisted by the selection set.
|
|
869
|
+
Mutates the provided entry in-place for efficiency.
|
|
872
870
|
|
|
873
871
|
Parameters:
|
|
874
|
-
- `
|
|
875
|
-
- `
|
|
876
|
-
- `
|
|
872
|
+
- `sourceEntry` - - Telemetry entry being filtered.
|
|
873
|
+
- `selection` - - Whitelist of additional telemetry keys.
|
|
874
|
+
- `fields` - - Core telemetry field keys that must be preserved.
|
|
875
|
+
|
|
876
|
+
Returns: The same entry reference after filtering.
|
|
877
877
|
|
|
878
878
|
## neat/telemetry/metrics/telemetry.metrics.rng.ts
|
|
879
879
|
|
|
@@ -896,53 +896,35 @@ Parameters:
|
|
|
896
896
|
|
|
897
897
|
## neat/telemetry/metrics/telemetry.metrics.entropy.ts
|
|
898
898
|
|
|
899
|
-
###
|
|
900
|
-
|
|
901
|
-
```ts
|
|
902
|
-
getCachedEntropy(
|
|
903
|
-
generation: number | undefined,
|
|
904
|
-
entropyGraph: Record<string, unknown>,
|
|
905
|
-
): number | undefined
|
|
906
|
-
```
|
|
907
|
-
|
|
908
|
-
Read a cached entropy value if it exists and belongs to the current
|
|
909
|
-
generation.
|
|
910
|
-
|
|
911
|
-
Parameters:
|
|
912
|
-
- `generation` - - Current generation number.
|
|
913
|
-
- `entropyGraph` - - Genome-like graph object.
|
|
914
|
-
|
|
915
|
-
Returns: Cached entropy number, or undefined when not available.
|
|
916
|
-
|
|
917
|
-
### computeDegreeCounts
|
|
899
|
+
### buildDegreeHistogram
|
|
918
900
|
|
|
919
901
|
```ts
|
|
920
|
-
|
|
921
|
-
|
|
902
|
+
buildDegreeHistogram(
|
|
903
|
+
counts: Record<number, number>,
|
|
922
904
|
): Record<number, number>
|
|
923
905
|
```
|
|
924
906
|
|
|
925
|
-
|
|
907
|
+
Build a histogram of degree frequencies from a degree-count table.
|
|
926
908
|
|
|
927
909
|
Parameters:
|
|
928
|
-
- `
|
|
910
|
+
- `counts` - - Map geneId -> degree count.
|
|
929
911
|
|
|
930
|
-
Returns: Map
|
|
912
|
+
Returns: Map degree -> number of nodes with that degree.
|
|
931
913
|
|
|
932
|
-
###
|
|
914
|
+
### computeDegreeCounts
|
|
933
915
|
|
|
934
916
|
```ts
|
|
935
|
-
|
|
936
|
-
|
|
917
|
+
computeDegreeCounts(
|
|
918
|
+
entropyGraph: { nodes: { geneId: number; }[]; connections: { from: { geneId: number; }; to: { geneId: number; }; enabled: boolean; }[]; },
|
|
937
919
|
): Record<number, number>
|
|
938
920
|
```
|
|
939
921
|
|
|
940
|
-
|
|
922
|
+
Compute per-node degree counts for enabled connections.
|
|
941
923
|
|
|
942
924
|
Parameters:
|
|
943
|
-
- `
|
|
925
|
+
- `entropyGraph` - - Genome-like graph object.
|
|
944
926
|
|
|
945
|
-
Returns: Map
|
|
927
|
+
Returns: Map geneId -> degree count.
|
|
946
928
|
|
|
947
929
|
### computeEntropyFromHistogram
|
|
948
930
|
|
|
@@ -961,6 +943,24 @@ Parameters:
|
|
|
961
943
|
|
|
962
944
|
Returns: Entropy value (non-negative).
|
|
963
945
|
|
|
946
|
+
### getCachedEntropy
|
|
947
|
+
|
|
948
|
+
```ts
|
|
949
|
+
getCachedEntropy(
|
|
950
|
+
generation: number | undefined,
|
|
951
|
+
entropyGraph: Record<string, unknown>,
|
|
952
|
+
): number | undefined
|
|
953
|
+
```
|
|
954
|
+
|
|
955
|
+
Read a cached entropy value if it exists and belongs to the current
|
|
956
|
+
generation.
|
|
957
|
+
|
|
958
|
+
Parameters:
|
|
959
|
+
- `generation` - - Current generation number.
|
|
960
|
+
- `entropyGraph` - - Genome-like graph object.
|
|
961
|
+
|
|
962
|
+
Returns: Cached entropy number, or undefined when not available.
|
|
963
|
+
|
|
964
964
|
### setCachedEntropy
|
|
965
965
|
|
|
966
966
|
```ts
|
|
@@ -980,28 +980,22 @@ Parameters:
|
|
|
980
980
|
|
|
981
981
|
## neat/telemetry/metrics/telemetry.metrics.lineage.ts
|
|
982
982
|
|
|
983
|
-
###
|
|
983
|
+
### applyLineageStatsMonoObjective
|
|
984
984
|
|
|
985
985
|
```ts
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
rngFactoryFn: () => () => number,
|
|
992
|
-
): { lineageMeanDepth: number; lineageMeanPairDist: number; }
|
|
986
|
+
applyLineageStatsMonoObjective(
|
|
987
|
+
telemetryContext: { _lineageEnabled?: boolean | undefined; _getRNG?: (() => () => number) | undefined; _lastMeanDepth?: number | undefined; _prevInbreedingCount?: number | undefined; },
|
|
988
|
+
populationSnapshot: GenomeDetailed[],
|
|
989
|
+
entry: TelemetryEntryRecord,
|
|
990
|
+
): void
|
|
993
991
|
```
|
|
994
992
|
|
|
995
|
-
|
|
993
|
+
Apply lineage stats for mono-objective mode using sampled ancestors.
|
|
996
994
|
|
|
997
995
|
Parameters:
|
|
998
|
-
- `
|
|
999
|
-
- `
|
|
1000
|
-
- `
|
|
1001
|
-
- `pairSampleCount` - - Number of pairs to sample.
|
|
1002
|
-
- `rngFactoryFn` - - RNG factory returning a uniform random function.
|
|
1003
|
-
|
|
1004
|
-
Returns: Lineage mean depth and pairwise distance.
|
|
996
|
+
- `telemetryContext` - - Neat-like context with lineage settings.
|
|
997
|
+
- `population` - - Population snapshot.
|
|
998
|
+
- `entry` - - Telemetry entry to update.
|
|
1005
999
|
|
|
1006
1000
|
### applyLineageStatsMultiObjective
|
|
1007
1001
|
|
|
@@ -1020,39 +1014,43 @@ Parameters:
|
|
|
1020
1014
|
- `population` - - Population snapshot.
|
|
1021
1015
|
- `entry` - - Telemetry entry to update.
|
|
1022
1016
|
|
|
1023
|
-
###
|
|
1017
|
+
### buildLineageContext
|
|
1024
1018
|
|
|
1025
1019
|
```ts
|
|
1026
|
-
|
|
1027
|
-
|
|
1020
|
+
buildLineageContext(
|
|
1021
|
+
context: { _getRNG?: (() => () => number) | undefined; },
|
|
1028
1022
|
populationSnapshot: GenomeDetailed[],
|
|
1029
|
-
|
|
1030
|
-
): void
|
|
1023
|
+
): NeatLineageContext
|
|
1031
1024
|
```
|
|
1032
1025
|
|
|
1033
|
-
|
|
1026
|
+
Build a lineage helper context for ancestor operations.
|
|
1034
1027
|
|
|
1035
1028
|
Parameters:
|
|
1036
|
-
- `
|
|
1037
|
-
- `
|
|
1038
|
-
- `entry` - - Telemetry entry to update.
|
|
1029
|
+
- `context` - - Neat-like context with RNG helpers.
|
|
1030
|
+
- `populationSnapshot` - - Population snapshot.
|
|
1039
1031
|
|
|
1040
|
-
|
|
1032
|
+
Returns: Lineage helper context.
|
|
1033
|
+
|
|
1034
|
+
### buildLineageEntry
|
|
1041
1035
|
|
|
1042
1036
|
```ts
|
|
1043
|
-
|
|
1044
|
-
context: {
|
|
1045
|
-
|
|
1046
|
-
|
|
1037
|
+
buildLineageEntry(
|
|
1038
|
+
context: { _prevInbreedingCount?: number | undefined; },
|
|
1039
|
+
bestGenomeSnapshot: GenomeDetailed,
|
|
1040
|
+
meanDepthValue: number,
|
|
1041
|
+
ancestorUniquenessScore: number,
|
|
1042
|
+
): { parents: number[]; depthBest: number; meanDepth: number; inbreeding: number; ancestorUniq: number; }
|
|
1047
1043
|
```
|
|
1048
1044
|
|
|
1049
|
-
|
|
1045
|
+
Build the lineage entry payload.
|
|
1050
1046
|
|
|
1051
1047
|
Parameters:
|
|
1052
|
-
- `context` - - Neat-like context with lineage
|
|
1053
|
-
- `
|
|
1048
|
+
- `context` - - Neat-like context with lineage info.
|
|
1049
|
+
- `bestGenomeSnapshot` - - Best genome snapshot.
|
|
1050
|
+
- `meanDepthValue` - - Mean lineage depth.
|
|
1051
|
+
- `ancestorUniquenessScore` - - Ancestor uniqueness score.
|
|
1054
1052
|
|
|
1055
|
-
Returns:
|
|
1053
|
+
Returns: Lineage entry payload.
|
|
1056
1054
|
|
|
1057
1055
|
### collectDepths
|
|
1058
1056
|
|
|
@@ -1069,21 +1067,6 @@ Parameters:
|
|
|
1069
1067
|
|
|
1070
1068
|
Returns: Array of depth values (defaults to 0).
|
|
1071
1069
|
|
|
1072
|
-
### computeMeanDepth
|
|
1073
|
-
|
|
1074
|
-
```ts
|
|
1075
|
-
computeMeanDepth(
|
|
1076
|
-
depthValues: number[],
|
|
1077
|
-
): number
|
|
1078
|
-
```
|
|
1079
|
-
|
|
1080
|
-
Compute the mean depth from a depth list.
|
|
1081
|
-
|
|
1082
|
-
Parameters:
|
|
1083
|
-
- `depthValues` - - Depth values to average.
|
|
1084
|
-
|
|
1085
|
-
Returns: Mean depth value.
|
|
1086
|
-
|
|
1087
1070
|
### computeAncestorUniquenessSampled
|
|
1088
1071
|
|
|
1089
1072
|
```ts
|
|
@@ -1101,22 +1084,43 @@ Parameters:
|
|
|
1101
1084
|
|
|
1102
1085
|
Returns: Rounded ancestor uniqueness score.
|
|
1103
1086
|
|
|
1104
|
-
###
|
|
1087
|
+
### computeLineageStats
|
|
1105
1088
|
|
|
1106
1089
|
```ts
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1090
|
+
computeLineageStats(
|
|
1091
|
+
lineageEnabled: boolean,
|
|
1092
|
+
genomes: TelemetryGenome[],
|
|
1093
|
+
size: number,
|
|
1094
|
+
pairSampleCount: number,
|
|
1095
|
+
rngFactoryFn: () => () => number,
|
|
1096
|
+
): { lineageMeanDepth: number; lineageMeanPairDist: number; }
|
|
1111
1097
|
```
|
|
1112
1098
|
|
|
1113
|
-
|
|
1099
|
+
Compute lineage depth and pairwise depth-distance statistics.
|
|
1114
1100
|
|
|
1115
1101
|
Parameters:
|
|
1116
|
-
- `
|
|
1117
|
-
- `
|
|
1102
|
+
- `lineageEnabled` - - Whether lineage metrics are enabled.
|
|
1103
|
+
- `genomes` - - Population snapshot.
|
|
1104
|
+
- `size` - - Population size.
|
|
1105
|
+
- `pairSampleCount` - - Number of pairs to sample.
|
|
1106
|
+
- `rngFactoryFn` - - RNG factory returning a uniform random function.
|
|
1118
1107
|
|
|
1119
|
-
Returns:
|
|
1108
|
+
Returns: Lineage mean depth and pairwise distance.
|
|
1109
|
+
|
|
1110
|
+
### computeMeanDepth
|
|
1111
|
+
|
|
1112
|
+
```ts
|
|
1113
|
+
computeMeanDepth(
|
|
1114
|
+
depthValues: number[],
|
|
1115
|
+
): number
|
|
1116
|
+
```
|
|
1117
|
+
|
|
1118
|
+
Compute the mean depth from a depth list.
|
|
1119
|
+
|
|
1120
|
+
Parameters:
|
|
1121
|
+
- `depthValues` - - Depth values to average.
|
|
1122
|
+
|
|
1123
|
+
Returns: Mean depth value.
|
|
1120
1124
|
|
|
1121
1125
|
### computePairJaccardDistance
|
|
1122
1126
|
|
|
@@ -1139,23 +1143,6 @@ Parameters:
|
|
|
1139
1143
|
|
|
1140
1144
|
Returns: Jaccard distance or undefined when both sets are empty.
|
|
1141
1145
|
|
|
1142
|
-
### buildLineageContext
|
|
1143
|
-
|
|
1144
|
-
```ts
|
|
1145
|
-
buildLineageContext(
|
|
1146
|
-
context: { _getRNG?: (() => () => number) | undefined; },
|
|
1147
|
-
populationSnapshot: GenomeDetailed[],
|
|
1148
|
-
): NeatLineageContext
|
|
1149
|
-
```
|
|
1150
|
-
|
|
1151
|
-
Build a lineage helper context for ancestor operations.
|
|
1152
|
-
|
|
1153
|
-
Parameters:
|
|
1154
|
-
- `context` - - Neat-like context with RNG helpers.
|
|
1155
|
-
- `populationSnapshot` - - Population snapshot.
|
|
1156
|
-
|
|
1157
|
-
Returns: Lineage helper context.
|
|
1158
|
-
|
|
1159
1146
|
### countAncestorIntersection
|
|
1160
1147
|
|
|
1161
1148
|
```ts
|
|
@@ -1173,26 +1160,39 @@ Parameters:
|
|
|
1173
1160
|
|
|
1174
1161
|
Returns: Intersection count.
|
|
1175
1162
|
|
|
1176
|
-
###
|
|
1163
|
+
### isLineageEligible
|
|
1177
1164
|
|
|
1178
1165
|
```ts
|
|
1179
|
-
|
|
1180
|
-
context: {
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
ancestorUniquenessScore: number,
|
|
1184
|
-
): { parents: number[]; depthBest: number; meanDepth: number; inbreeding: number; ancestorUniq: number; }
|
|
1166
|
+
isLineageEligible(
|
|
1167
|
+
context: { _lineageEnabled?: boolean | undefined; },
|
|
1168
|
+
populationSnapshot: GenomeDetailed[],
|
|
1169
|
+
): boolean
|
|
1185
1170
|
```
|
|
1186
1171
|
|
|
1187
|
-
|
|
1172
|
+
Check whether lineage metrics should be computed.
|
|
1188
1173
|
|
|
1189
1174
|
Parameters:
|
|
1190
|
-
- `context` - - Neat-like context with lineage
|
|
1191
|
-
- `
|
|
1192
|
-
- `meanDepthValue` - - Mean lineage depth.
|
|
1193
|
-
- `ancestorUniquenessScore` - - Ancestor uniqueness score.
|
|
1175
|
+
- `context` - - Neat-like context with lineage flag.
|
|
1176
|
+
- `populationSnapshot` - - Population snapshot to validate.
|
|
1194
1177
|
|
|
1195
|
-
Returns:
|
|
1178
|
+
Returns: True when lineage stats should be computed.
|
|
1179
|
+
|
|
1180
|
+
### pickDistinctPairIndices
|
|
1181
|
+
|
|
1182
|
+
```ts
|
|
1183
|
+
pickDistinctPairIndices(
|
|
1184
|
+
context: { _getRNG?: (() => () => number) | undefined; },
|
|
1185
|
+
populationSize: number,
|
|
1186
|
+
): { firstIndex: number; secondIndex: number; }
|
|
1187
|
+
```
|
|
1188
|
+
|
|
1189
|
+
Pick two distinct indices using the context RNG.
|
|
1190
|
+
|
|
1191
|
+
Parameters:
|
|
1192
|
+
- `context` - - Neat-like context with RNG factory.
|
|
1193
|
+
- `populationSize` - - Population size for index bounds.
|
|
1194
|
+
|
|
1195
|
+
Returns: Pair of distinct indices.
|
|
1196
1196
|
|
|
1197
1197
|
## neat/telemetry/metrics/telemetry.metrics.operator.ts
|
|
1198
1198
|
|
|
@@ -1304,6 +1304,23 @@ Parameters:
|
|
|
1304
1304
|
|
|
1305
1305
|
Returns: Graphlet entropy value.
|
|
1306
1306
|
|
|
1307
|
+
### countEnabledEdges
|
|
1308
|
+
|
|
1309
|
+
```ts
|
|
1310
|
+
countEnabledEdges(
|
|
1311
|
+
genome: TelemetryGenome,
|
|
1312
|
+
selectedNodes: NodeLike[],
|
|
1313
|
+
): number
|
|
1314
|
+
```
|
|
1315
|
+
|
|
1316
|
+
Count enabled edges between the selected nodes in a genome.
|
|
1317
|
+
|
|
1318
|
+
Parameters:
|
|
1319
|
+
- `genome` - - Genome with connections to inspect.
|
|
1320
|
+
- `selectedNodes` - - Nodes forming the graphlet sample.
|
|
1321
|
+
|
|
1322
|
+
Returns: Edge count capped at 3.
|
|
1323
|
+
|
|
1307
1324
|
### pickDistinctIndices
|
|
1308
1325
|
|
|
1309
1326
|
```ts
|
|
@@ -1323,23 +1340,6 @@ Parameters:
|
|
|
1323
1340
|
|
|
1324
1341
|
Returns: Array of distinct indices.
|
|
1325
1342
|
|
|
1326
|
-
### countEnabledEdges
|
|
1327
|
-
|
|
1328
|
-
```ts
|
|
1329
|
-
countEnabledEdges(
|
|
1330
|
-
genome: TelemetryGenome,
|
|
1331
|
-
selectedNodes: NodeLike[],
|
|
1332
|
-
): number
|
|
1333
|
-
```
|
|
1334
|
-
|
|
1335
|
-
Count enabled edges between the selected nodes in a genome.
|
|
1336
|
-
|
|
1337
|
-
Parameters:
|
|
1338
|
-
- `genome` - - Genome with connections to inspect.
|
|
1339
|
-
- `selectedNodes` - - Nodes forming the graphlet sample.
|
|
1340
|
-
|
|
1341
|
-
Returns: Edge count capped at 3.
|
|
1342
|
-
|
|
1343
1343
|
## neat/telemetry/metrics/telemetry.metrics.selection.ts
|
|
1344
1344
|
|
|
1345
1345
|
### getTelemetryCoreSnapshot
|
|
@@ -1358,27 +1358,7 @@ Parameters:
|
|
|
1358
1358
|
- `sourceEntry` - - Source telemetry object.
|
|
1359
1359
|
- `fields` - - Core telemetry field keys to preserve.
|
|
1360
1360
|
|
|
1361
|
-
Returns: Shallow snapshot of core fields that exist on the entry.
|
|
1362
|
-
|
|
1363
|
-
### stripUnselectedTelemetryKeys
|
|
1364
|
-
|
|
1365
|
-
```ts
|
|
1366
|
-
stripUnselectedTelemetryKeys(
|
|
1367
|
-
sourceEntry: Record<string, unknown>,
|
|
1368
|
-
selection: Set<string>,
|
|
1369
|
-
fields: TelemetryCoreFields,
|
|
1370
|
-
): Record<string, unknown>
|
|
1371
|
-
```
|
|
1372
|
-
|
|
1373
|
-
Remove non-core keys that are not whitelisted by the selection set.
|
|
1374
|
-
Mutates the provided entry in-place for efficiency.
|
|
1375
|
-
|
|
1376
|
-
Parameters:
|
|
1377
|
-
- `sourceEntry` - - Telemetry entry being filtered.
|
|
1378
|
-
- `selection` - - Whitelist of additional telemetry keys.
|
|
1379
|
-
- `fields` - - Core telemetry field keys that must be preserved.
|
|
1380
|
-
|
|
1381
|
-
Returns: The same entry reference after filtering.
|
|
1361
|
+
Returns: Shallow snapshot of core fields that exist on the entry.
|
|
1382
1362
|
|
|
1383
1363
|
### mergeTelemetryCoreFields
|
|
1384
1364
|
|
|
@@ -1415,82 +1395,102 @@ Parameters:
|
|
|
1415
1395
|
- `telemetryEntry` - - Entry to filter in place.
|
|
1416
1396
|
- `applyTelemetrySelectFn` - - Selection helper to invoke.
|
|
1417
1397
|
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
### collectPopulationCounts
|
|
1398
|
+
### stripUnselectedTelemetryKeys
|
|
1421
1399
|
|
|
1422
1400
|
```ts
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1401
|
+
stripUnselectedTelemetryKeys(
|
|
1402
|
+
sourceEntry: Record<string, unknown>,
|
|
1403
|
+
selection: Set<string>,
|
|
1404
|
+
fields: TelemetryCoreFields,
|
|
1405
|
+
): Record<string, unknown>
|
|
1426
1406
|
```
|
|
1427
1407
|
|
|
1428
|
-
|
|
1408
|
+
Remove non-core keys that are not whitelisted by the selection set.
|
|
1409
|
+
Mutates the provided entry in-place for efficiency.
|
|
1429
1410
|
|
|
1430
1411
|
Parameters:
|
|
1431
|
-
- `
|
|
1412
|
+
- `sourceEntry` - - Telemetry entry being filtered.
|
|
1413
|
+
- `selection` - - Whitelist of additional telemetry keys.
|
|
1414
|
+
- `fields` - - Core telemetry field keys that must be preserved.
|
|
1432
1415
|
|
|
1433
|
-
Returns:
|
|
1416
|
+
Returns: The same entry reference after filtering.
|
|
1434
1417
|
|
|
1435
|
-
|
|
1418
|
+
## neat/telemetry/metrics/telemetry.metrics.complexity.ts
|
|
1419
|
+
|
|
1420
|
+
### applyComplexityStatsMonoObjective
|
|
1436
1421
|
|
|
1437
1422
|
```ts
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1423
|
+
applyComplexityStatsMonoObjective(
|
|
1424
|
+
telemetryContext: { _lastMeanNodes?: number | undefined; _lastMeanConns?: number | undefined; },
|
|
1425
|
+
telemetryOptions: NeatOptions & TelemetryDiversityOptions,
|
|
1426
|
+
populationSnapshot: GenomeDetailed[],
|
|
1427
|
+
entry: TelemetryEntryRecord,
|
|
1428
|
+
): void
|
|
1441
1429
|
```
|
|
1442
1430
|
|
|
1443
|
-
|
|
1431
|
+
Attach complexity stats for mono-objective mode.
|
|
1444
1432
|
|
|
1445
1433
|
Parameters:
|
|
1446
|
-
- `
|
|
1447
|
-
|
|
1448
|
-
|
|
1434
|
+
- `telemetryContext` - - Neat-like context with population state.
|
|
1435
|
+
- `telemetryOptions` - - Options controlling complexity telemetry.
|
|
1436
|
+
- `entry` - - Telemetry entry to update.
|
|
1449
1437
|
|
|
1450
|
-
###
|
|
1438
|
+
### applyComplexityStatsMultiObjective
|
|
1451
1439
|
|
|
1452
1440
|
```ts
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1441
|
+
applyComplexityStatsMultiObjective(
|
|
1442
|
+
telemetryContext: { _lastMeanNodes?: number | undefined; _lastMeanConns?: number | undefined; },
|
|
1443
|
+
telemetryOptions: NeatOptions & TelemetryDiversityOptions,
|
|
1444
|
+
population: GenomeDetailed[],
|
|
1445
|
+
entry: TelemetryEntryRecord,
|
|
1446
|
+
): void
|
|
1456
1447
|
```
|
|
1457
1448
|
|
|
1458
|
-
|
|
1449
|
+
Attach complexity stats for multi-objective mode.
|
|
1459
1450
|
|
|
1460
1451
|
Parameters:
|
|
1461
|
-
- `
|
|
1462
|
-
|
|
1463
|
-
|
|
1452
|
+
- `telemetryContext` - - Neat-like context with population state.
|
|
1453
|
+
- `telemetryOptions` - - Options controlling complexity telemetry.
|
|
1454
|
+
- `population` - - Population snapshot.
|
|
1455
|
+
- `entry` - - Telemetry entry to update.
|
|
1464
1456
|
|
|
1465
|
-
###
|
|
1457
|
+
### buildComplexityEntry
|
|
1466
1458
|
|
|
1467
1459
|
```ts
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1460
|
+
buildComplexityEntry(
|
|
1461
|
+
telemetryOptions: NeatOptions & TelemetryDiversityOptions,
|
|
1462
|
+
meanCounts: { meanNodes: number; meanConns: number; },
|
|
1463
|
+
maxCounts: { maxNodes: number; maxConns: number; },
|
|
1464
|
+
meanEnabledRatio: number,
|
|
1465
|
+
growthValues: { growthNodes: number; growthConns: number; },
|
|
1466
|
+
): { meanNodes: number; meanConns: number; maxNodes: number; maxConns: number; meanEnabledRatio: number; growthNodes: number; growthConns: number; budgetMaxNodes: number; budgetMaxConns: number; }
|
|
1471
1467
|
```
|
|
1472
1468
|
|
|
1473
|
-
|
|
1469
|
+
Build the complexity entry payload for multi-objective mode.
|
|
1474
1470
|
|
|
1475
1471
|
Parameters:
|
|
1476
|
-
- `
|
|
1472
|
+
- `telemetryOptions` - - Options controlling complexity telemetry.
|
|
1473
|
+
- `meanCounts` - - Mean node/connection counts.
|
|
1474
|
+
- `maxCounts` - - Max node/connection counts.
|
|
1475
|
+
- `meanEnabledRatio` - - Mean enabled ratio.
|
|
1476
|
+
- `growthValues` - - Growth deltas.
|
|
1477
1477
|
|
|
1478
|
-
Returns:
|
|
1478
|
+
Returns: Complexity entry payload.
|
|
1479
1479
|
|
|
1480
|
-
###
|
|
1480
|
+
### collectPopulationCounts
|
|
1481
1481
|
|
|
1482
1482
|
```ts
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
): number
|
|
1483
|
+
collectPopulationCounts(
|
|
1484
|
+
populationSnapshot: GenomeDetailed[],
|
|
1485
|
+
): { nodeCounts: number[]; connectionCounts: number[]; }
|
|
1486
1486
|
```
|
|
1487
1487
|
|
|
1488
|
-
|
|
1488
|
+
Collect node and connection counts for the population.
|
|
1489
1489
|
|
|
1490
1490
|
Parameters:
|
|
1491
|
-
- `
|
|
1491
|
+
- `populationSnapshot` - - Population snapshot.
|
|
1492
1492
|
|
|
1493
|
-
Returns:
|
|
1493
|
+
Returns: Node and connection counts arrays.
|
|
1494
1494
|
|
|
1495
1495
|
### computeAndStoreGrowthValues
|
|
1496
1496
|
|
|
@@ -1509,113 +1509,83 @@ Parameters:
|
|
|
1509
1509
|
|
|
1510
1510
|
Returns: Growth values for nodes and connections.
|
|
1511
1511
|
|
|
1512
|
-
###
|
|
1512
|
+
### computeEnabledRatios
|
|
1513
1513
|
|
|
1514
1514
|
```ts
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
maxCounts: { maxNodes: number; maxConns: number; },
|
|
1519
|
-
meanEnabledRatio: number,
|
|
1520
|
-
growthValues: { growthNodes: number; growthConns: number; },
|
|
1521
|
-
): { meanNodes: number; meanConns: number; maxNodes: number; maxConns: number; meanEnabledRatio: number; growthNodes: number; growthConns: number; budgetMaxNodes: number; budgetMaxConns: number; }
|
|
1515
|
+
computeEnabledRatios(
|
|
1516
|
+
populationSnapshot: GenomeDetailed[],
|
|
1517
|
+
): number[]
|
|
1522
1518
|
```
|
|
1523
1519
|
|
|
1524
|
-
|
|
1520
|
+
Compute enabled ratios per genome.
|
|
1525
1521
|
|
|
1526
1522
|
Parameters:
|
|
1527
|
-
- `
|
|
1528
|
-
- `meanCounts` - - Mean node/connection counts.
|
|
1529
|
-
- `maxCounts` - - Max node/connection counts.
|
|
1530
|
-
- `meanEnabledRatio` - - Mean enabled ratio.
|
|
1531
|
-
- `growthValues` - - Growth deltas.
|
|
1523
|
+
- `populationSnapshot` - - Population snapshot.
|
|
1532
1524
|
|
|
1533
|
-
Returns:
|
|
1525
|
+
Returns: Array of enabled ratios.
|
|
1534
1526
|
|
|
1535
|
-
###
|
|
1527
|
+
### computeMaxCounts
|
|
1536
1528
|
|
|
1537
1529
|
```ts
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
population: GenomeDetailed[],
|
|
1542
|
-
entry: TelemetryEntryRecord,
|
|
1543
|
-
): void
|
|
1530
|
+
computeMaxCounts(
|
|
1531
|
+
counts: { nodeCounts: number[]; connectionCounts: number[]; },
|
|
1532
|
+
): { maxNodes: number; maxConns: number; }
|
|
1544
1533
|
```
|
|
1545
1534
|
|
|
1546
|
-
|
|
1535
|
+
Compute max node and connection counts.
|
|
1547
1536
|
|
|
1548
1537
|
Parameters:
|
|
1549
|
-
- `
|
|
1550
|
-
- `telemetryOptions` - - Options controlling complexity telemetry.
|
|
1551
|
-
- `population` - - Population snapshot.
|
|
1552
|
-
- `entry` - - Telemetry entry to update.
|
|
1538
|
+
- `counts` - - Node and connection counts arrays.
|
|
1553
1539
|
|
|
1554
|
-
|
|
1540
|
+
Returns: Max node and connection counts.
|
|
1541
|
+
|
|
1542
|
+
### computeMeanCounts
|
|
1555
1543
|
|
|
1556
1544
|
```ts
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
populationSnapshot: GenomeDetailed[],
|
|
1561
|
-
entry: TelemetryEntryRecord,
|
|
1562
|
-
): void
|
|
1545
|
+
computeMeanCounts(
|
|
1546
|
+
counts: { nodeCounts: number[]; connectionCounts: number[]; },
|
|
1547
|
+
): { meanNodes: number; meanConns: number; }
|
|
1563
1548
|
```
|
|
1564
1549
|
|
|
1565
|
-
|
|
1550
|
+
Compute mean node and connection counts.
|
|
1566
1551
|
|
|
1567
1552
|
Parameters:
|
|
1568
|
-
- `
|
|
1569
|
-
- `telemetryOptions` - - Options controlling complexity telemetry.
|
|
1570
|
-
- `entry` - - Telemetry entry to update.
|
|
1553
|
+
- `counts` - - Node and connection counts arrays.
|
|
1571
1554
|
|
|
1572
|
-
|
|
1555
|
+
Returns: Mean node and connection counts.
|
|
1573
1556
|
|
|
1574
|
-
###
|
|
1557
|
+
### computeMeanEnabledRatio
|
|
1575
1558
|
|
|
1576
1559
|
```ts
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
population: GenomeDetailed[],
|
|
1560
|
+
computeMeanEnabledRatio(
|
|
1561
|
+
enabledRatios: number[],
|
|
1580
1562
|
): number
|
|
1581
1563
|
```
|
|
1582
1564
|
|
|
1583
|
-
Compute
|
|
1565
|
+
Compute mean of enabled ratios.
|
|
1584
1566
|
|
|
1585
1567
|
Parameters:
|
|
1586
|
-
- `
|
|
1587
|
-
- `population` - - Population snapshot.
|
|
1588
|
-
|
|
1589
|
-
Returns: Hypervolume proxy value.
|
|
1590
|
-
|
|
1591
|
-
### computeParetoFrontSizes
|
|
1592
|
-
|
|
1593
|
-
```ts
|
|
1594
|
-
computeParetoFrontSizes(
|
|
1595
|
-
population: GenomeDetailed[],
|
|
1596
|
-
): number[]
|
|
1597
|
-
```
|
|
1598
|
-
|
|
1599
|
-
Compute sizes of early Pareto fronts.
|
|
1568
|
+
- `enabledRatios` - - Enabled ratios per genome.
|
|
1600
1569
|
|
|
1601
|
-
|
|
1602
|
-
- `population` - - Population snapshot.
|
|
1570
|
+
Returns: Mean enabled ratio.
|
|
1603
1571
|
|
|
1604
|
-
|
|
1572
|
+
## neat/telemetry/metrics/telemetry.metrics.objectives.ts
|
|
1605
1573
|
|
|
1606
|
-
###
|
|
1574
|
+
### applyHypervolumeTelemetry
|
|
1607
1575
|
|
|
1608
1576
|
```ts
|
|
1609
|
-
|
|
1610
|
-
|
|
1577
|
+
applyHypervolumeTelemetry(
|
|
1578
|
+
telemetryOptions: NeatOptions & TelemetryDiversityOptions,
|
|
1579
|
+
hyperVolumeProxy: number,
|
|
1611
1580
|
entry: TelemetryEntryRecord,
|
|
1612
1581
|
): void
|
|
1613
1582
|
```
|
|
1614
1583
|
|
|
1615
|
-
|
|
1584
|
+
Attach hypervolume scalar when requested.
|
|
1616
1585
|
|
|
1617
1586
|
Parameters:
|
|
1618
|
-
- `
|
|
1587
|
+
- `telemetryOptions` - - Options controlling telemetry fields.
|
|
1588
|
+
- `hyperVolumeProxy` - - Hypervolume proxy value.
|
|
1619
1589
|
- `entry` - - Telemetry entry to update.
|
|
1620
1590
|
|
|
1621
1591
|
### applyObjectiveAges
|
|
@@ -1650,19 +1620,19 @@ Parameters:
|
|
|
1650
1620
|
- `entry` - - Telemetry entry to update.
|
|
1651
1621
|
- `generation` - - Generation index for event records.
|
|
1652
1622
|
|
|
1653
|
-
###
|
|
1623
|
+
### applyObjectiveImportance
|
|
1654
1624
|
|
|
1655
1625
|
```ts
|
|
1656
|
-
|
|
1657
|
-
telemetryContext: {
|
|
1626
|
+
applyObjectiveImportance(
|
|
1627
|
+
telemetryContext: { _lastObjImportance?: ObjImportance | undefined; },
|
|
1658
1628
|
entry: TelemetryEntryRecord,
|
|
1659
1629
|
): void
|
|
1660
1630
|
```
|
|
1661
1631
|
|
|
1662
|
-
Apply
|
|
1632
|
+
Apply the most recent objective importance snapshot.
|
|
1663
1633
|
|
|
1664
1634
|
Parameters:
|
|
1665
|
-
- `telemetryContext` - - Neat-like context with
|
|
1635
|
+
- `telemetryContext` - - Neat-like context with objective importance.
|
|
1666
1636
|
- `entry` - - Telemetry entry to update.
|
|
1667
1637
|
|
|
1668
1638
|
### applyObjectivesSnapshot
|
|
@@ -1680,23 +1650,53 @@ Parameters:
|
|
|
1680
1650
|
- `telemetryContext` - - Neat-like context with objective provider.
|
|
1681
1651
|
- `entry` - - Telemetry entry to update.
|
|
1682
1652
|
|
|
1683
|
-
###
|
|
1653
|
+
### applySpeciesAllocation
|
|
1684
1654
|
|
|
1685
1655
|
```ts
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
hyperVolumeProxy: number,
|
|
1656
|
+
applySpeciesAllocation(
|
|
1657
|
+
telemetryContext: { _lastOffspringAlloc?: SpeciesAlloc[] | undefined; },
|
|
1689
1658
|
entry: TelemetryEntryRecord,
|
|
1690
1659
|
): void
|
|
1691
1660
|
```
|
|
1692
1661
|
|
|
1693
|
-
|
|
1662
|
+
Apply per-species offspring allocation snapshot.
|
|
1694
1663
|
|
|
1695
1664
|
Parameters:
|
|
1696
|
-
- `
|
|
1697
|
-
- `hyperVolumeProxy` - - Hypervolume proxy value.
|
|
1665
|
+
- `telemetryContext` - - Neat-like context with allocation snapshot.
|
|
1698
1666
|
- `entry` - - Telemetry entry to update.
|
|
1699
1667
|
|
|
1668
|
+
### computeHyperVolumeProxy
|
|
1669
|
+
|
|
1670
|
+
```ts
|
|
1671
|
+
computeHyperVolumeProxy(
|
|
1672
|
+
telemetryOptions: NeatOptions & TelemetryDiversityOptions,
|
|
1673
|
+
population: GenomeDetailed[],
|
|
1674
|
+
): number
|
|
1675
|
+
```
|
|
1676
|
+
|
|
1677
|
+
Compute a hypervolume-like proxy for the Pareto front.
|
|
1678
|
+
|
|
1679
|
+
Parameters:
|
|
1680
|
+
- `telemetryOptions` - - Options controlling complexity metric.
|
|
1681
|
+
- `population` - - Population snapshot.
|
|
1682
|
+
|
|
1683
|
+
Returns: Hypervolume proxy value.
|
|
1684
|
+
|
|
1685
|
+
### computeParetoFrontSizes
|
|
1686
|
+
|
|
1687
|
+
```ts
|
|
1688
|
+
computeParetoFrontSizes(
|
|
1689
|
+
population: GenomeDetailed[],
|
|
1690
|
+
): number[]
|
|
1691
|
+
```
|
|
1692
|
+
|
|
1693
|
+
Compute sizes of early Pareto fronts.
|
|
1694
|
+
|
|
1695
|
+
Parameters:
|
|
1696
|
+
- `population` - - Population snapshot.
|
|
1697
|
+
|
|
1698
|
+
Returns: Array of front sizes (rank 0..4).
|
|
1699
|
+
|
|
1700
1700
|
## neat/telemetry/metrics/telemetry.metrics.performance.ts
|
|
1701
1701
|
|
|
1702
1702
|
### applyPerformanceStats
|