@iyulab/u-metaheur 0.1.0 → 0.2.1
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/package.json +2 -2
- package/u_metaheur.d.ts +4 -4
- package/u_metaheur_bg.js +8 -8
- package/u_metaheur_bg.wasm +0 -0
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"iyulab"
|
|
6
6
|
],
|
|
7
7
|
"description": "Domain-agnostic metaheuristic optimization framework: GA, BRKGA, SA, ALNS.",
|
|
8
|
-
"version": "0.1
|
|
8
|
+
"version": "0.2.1",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -29,4 +29,4 @@
|
|
|
29
29
|
"metaheuristic",
|
|
30
30
|
"evolutionary"
|
|
31
31
|
]
|
|
32
|
-
}
|
|
32
|
+
}
|
package/u_metaheur.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Runs a Genetic Algorithm for TSP.
|
|
6
6
|
*
|
|
7
7
|
* # Arguments
|
|
8
|
-
* `
|
|
8
|
+
* `config` — native JS object with fields:
|
|
9
9
|
* - `nodes`: `[[x, y], ...]` (required)
|
|
10
10
|
* - `population_size`: integer (default 100)
|
|
11
11
|
* - `generations`: integer (default 200)
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* # Returns
|
|
15
15
|
* JS object with `best_distance`, `best_tour`, `generations_run`.
|
|
16
16
|
*/
|
|
17
|
-
export function run_ga(
|
|
17
|
+
export function run_ga(config: any): any;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Runs Simulated Annealing for TSP.
|
|
@@ -23,7 +23,7 @@ export function run_ga(config_json: any): any;
|
|
|
23
23
|
* Neighbour move: 2-opt segment reversal between two random positions.
|
|
24
24
|
*
|
|
25
25
|
* # Arguments
|
|
26
|
-
* `
|
|
26
|
+
* `config` — native JS object with fields:
|
|
27
27
|
* - `nodes`: `[[x, y], ...]` (required)
|
|
28
28
|
* - `initial_temp`: float (default 1000.0)
|
|
29
29
|
* - `cooling_rate`: float in (0, 1) (default 0.995)
|
|
@@ -32,4 +32,4 @@ export function run_ga(config_json: any): any;
|
|
|
32
32
|
* # Returns
|
|
33
33
|
* JS object with `best_distance`, `best_tour`, `iterations_run`.
|
|
34
34
|
*/
|
|
35
|
-
export function run_sa(
|
|
35
|
+
export function run_sa(config: any): any;
|
package/u_metaheur_bg.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Runs a Genetic Algorithm for TSP.
|
|
3
3
|
*
|
|
4
4
|
* # Arguments
|
|
5
|
-
* `
|
|
5
|
+
* `config` — native JS object with fields:
|
|
6
6
|
* - `nodes`: `[[x, y], ...]` (required)
|
|
7
7
|
* - `population_size`: integer (default 100)
|
|
8
8
|
* - `generations`: integer (default 200)
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
*
|
|
11
11
|
* # Returns
|
|
12
12
|
* JS object with `best_distance`, `best_tour`, `generations_run`.
|
|
13
|
-
* @param {any}
|
|
13
|
+
* @param {any} config
|
|
14
14
|
* @returns {any}
|
|
15
15
|
*/
|
|
16
|
-
export function run_ga(
|
|
17
|
-
const ret = wasm.run_ga(
|
|
16
|
+
export function run_ga(config) {
|
|
17
|
+
const ret = wasm.run_ga(config);
|
|
18
18
|
if (ret[2]) {
|
|
19
19
|
throw takeFromExternrefTable0(ret[1]);
|
|
20
20
|
}
|
|
@@ -28,7 +28,7 @@ export function run_ga(config_json) {
|
|
|
28
28
|
* Neighbour move: 2-opt segment reversal between two random positions.
|
|
29
29
|
*
|
|
30
30
|
* # Arguments
|
|
31
|
-
* `
|
|
31
|
+
* `config` — native JS object with fields:
|
|
32
32
|
* - `nodes`: `[[x, y], ...]` (required)
|
|
33
33
|
* - `initial_temp`: float (default 1000.0)
|
|
34
34
|
* - `cooling_rate`: float in (0, 1) (default 0.995)
|
|
@@ -36,11 +36,11 @@ export function run_ga(config_json) {
|
|
|
36
36
|
*
|
|
37
37
|
* # Returns
|
|
38
38
|
* JS object with `best_distance`, `best_tour`, `iterations_run`.
|
|
39
|
-
* @param {any}
|
|
39
|
+
* @param {any} config
|
|
40
40
|
* @returns {any}
|
|
41
41
|
*/
|
|
42
|
-
export function run_sa(
|
|
43
|
-
const ret = wasm.run_sa(
|
|
42
|
+
export function run_sa(config) {
|
|
43
|
+
const ret = wasm.run_sa(config);
|
|
44
44
|
if (ret[2]) {
|
|
45
45
|
throw takeFromExternrefTable0(ret[1]);
|
|
46
46
|
}
|
package/u_metaheur_bg.wasm
CHANGED
|
Binary file
|