@anonympins/fingerprint 0.4.2 → 0.4.3
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/CHANGELOG.md +17 -0
- package/README.md +66 -60
- package/package.json +1 -1
- package/src/js/fingerprint.js +10 -2
- package/src/js/pow.solver.js +531 -497
- package/src/js/problem-manager.js +24 -0
- package/src/js/tests/fingerprint.test.js +2351 -2319
- package/src/js/tests/pow.solver.test.js +233 -197
- package/src/js/tests/problem-manager.test.js +358 -322
- package/src/php/FingerprintEngine.php +10 -2
- package/src/php/Optimization/FunctionRegistry.php +63 -62
- package/src/php/Optimization/OptimizationOperators.php +401 -304
- package/src/php/ProblemManager.php +29 -0
- package/src/php/Tests/FingerprintEngineTest.php +330 -299
- package/src/php/Tests/ProblemManagerTest.php +376 -296
- package/src/php/Tests/RequestUtilsTest.php +256 -253
- package/src/php/Tests/problems.config.json +3 -3
- package/src/php/Utils/RequestUtils.php +1 -1
|
@@ -133,6 +133,28 @@ class ProblemManager
|
|
|
133
133
|
$task['payload'] = $task['payload'] ?? [];
|
|
134
134
|
$task['initialSolution'] = $problem['state']['bestSolution'] ?? null;
|
|
135
135
|
break;
|
|
136
|
+
|
|
137
|
+
case 'genetic_algorithm_generations':
|
|
138
|
+
$baseGenerations = max(50, $problem['workUnit']['baseGenerations'] ?? 0);
|
|
139
|
+
$task['generations'] = $scalingFactor
|
|
140
|
+
? (int)floor($baseGenerations * pow($scalingFactor, $suspicionFactor))
|
|
141
|
+
: (int)floor($baseGenerations * (0.5 + $suspicionFactor));
|
|
142
|
+
if (isset($problem['payload'])) {
|
|
143
|
+
$task['payload'] = $problem['payload'];
|
|
144
|
+
}
|
|
145
|
+
$task['payload'] = $task['payload'] ?? [];
|
|
146
|
+
$task['initialPopulation'] = $problem['state']['population'] ?? null;
|
|
147
|
+
break;
|
|
148
|
+
|
|
149
|
+
case 'run_multiple_parallel':
|
|
150
|
+
$task['solverName'] = $problem['workUnit']['solverName'] ?? null;
|
|
151
|
+
$task['numCycles'] = $problem['workUnit']['numCycles'] ?? null;
|
|
152
|
+
$task['baseSolverArgs'] = $problem['payload']['baseSolverArgs'] ?? null;
|
|
153
|
+
$task['workerDataGenerator'] = $problem['payload']['workerDataGenerator'] ?? null;
|
|
154
|
+
$task['logProgress'] = $problem['payload']['logProgress'] ?? false;
|
|
155
|
+
$task['concurrency'] = $problem['payload']['concurrency'] ?? null;
|
|
156
|
+
break;
|
|
157
|
+
|
|
136
158
|
case 'multi_objective_genetic_algorithm':
|
|
137
159
|
$baseGenerationsMulti = max(30, $problem['workUnit']['baseGenerations'] ?? 0);
|
|
138
160
|
$task['generations'] = $scalingFactor
|
|
@@ -194,6 +216,13 @@ class ProblemManager
|
|
|
194
216
|
}
|
|
195
217
|
}
|
|
196
218
|
break;
|
|
219
|
+
case 'genetic_algorithm_generations':
|
|
220
|
+
if (isset($solutionData['population']) && is_array($solutionData['population'])) {
|
|
221
|
+
$problem['state']['population'] = $solutionData['population'];
|
|
222
|
+
$problem['state']['lastUpdate'] = (new \DateTime())->format(\DateTime::ATOM);
|
|
223
|
+
$stateChanged = true;
|
|
224
|
+
}
|
|
225
|
+
break;
|
|
197
226
|
case 'multi_objective_genetic_algorithm':
|
|
198
227
|
// Pour les algorithmes génétiques, on intègre le nouveau front de Pareto.
|
|
199
228
|
if (isset($solutionData['paretoFront']) && is_array($solutionData['paretoFront'])) {
|