linny-r 1.6.6 → 1.6.7
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
CHANGED
@@ -295,7 +295,7 @@ module.exports = class MILPSolver {
|
|
295
295
|
vnr = parseInt(v.substring(1));
|
296
296
|
// Add zeros for unreported variables until column number matches.
|
297
297
|
while(col < vnr) {
|
298
|
-
x_values.push(
|
298
|
+
x_values.push(0);
|
299
299
|
col++;
|
300
300
|
}
|
301
301
|
x_values.push(x_dict[v]);
|
@@ -397,7 +397,7 @@ module.exports = class MILPSolver {
|
|
397
397
|
// Fill dictionary with variable name: value entries
|
398
398
|
while(i < output.length) {
|
399
399
|
const m = output[i].match(/^.*name="(X[^"]+)".*value="([^"]+)"/);
|
400
|
-
if(m !== null) x_dict[m[1]] = m[2];
|
400
|
+
if(m !== null) x_dict[m[1]] = parseFloat(m[2]);
|
401
401
|
i++;
|
402
402
|
}
|
403
403
|
// Fill the solution vector, adding 0 for missing columns
|
@@ -453,7 +453,7 @@ module.exports = class MILPSolver {
|
|
453
453
|
// Fill dictionary with variable name: value entries
|
454
454
|
while(i < output.length) {
|
455
455
|
const v = output[i].split(/\s+/);
|
456
|
-
x_dict[v[0]] = v[1];
|
456
|
+
x_dict[v[0]] = parseFloat(v[1]);
|
457
457
|
i++;
|
458
458
|
}
|
459
459
|
// Fill the solution vector, adding 0 for missing columns
|
@@ -485,7 +485,7 @@ module.exports = class MILPSolver {
|
|
485
485
|
// Fill dictionary with variable name: value entries
|
486
486
|
while(i < output.length) {
|
487
487
|
const v = output[i].split(/\s+/);
|
488
|
-
x_dict[v[0]] = v[1];
|
488
|
+
x_dict[v[0]] = parseFloat(v[1]);
|
489
489
|
i++;
|
490
490
|
}
|
491
491
|
// Fill the solution vector, adding 0 for missing columns
|
@@ -5,8 +5,8 @@ The Linny-R language and tool have been developed by Pieter Bots at Delft
|
|
5
5
|
University of Technology, starting in 2009. The project to develop a browser-
|
6
6
|
based version started in 2017. See https://linny-r.org for more information.
|
7
7
|
|
8
|
-
This JavaScript file (linny-r-classes.js) defines the object classes used in
|
9
|
-
Linny-R project.
|
8
|
+
This JavaScript file (linny-r-classes.js) defines the object classes used in
|
9
|
+
the Linny-R project.
|
10
10
|
*/
|
11
11
|
|
12
12
|
/*
|
@@ -7468,7 +7468,8 @@ class Node extends NodeBox {
|
|
7468
7468
|
}
|
7469
7469
|
|
7470
7470
|
actualLevel(t) {
|
7471
|
-
// Returns the production level c.q. stock level for this node in
|
7471
|
+
// Returns the production level c.q. stock level for this node in
|
7472
|
+
// time step t.
|
7472
7473
|
if(t < 0) return this.initial_level.result(1);
|
7473
7474
|
if(t < this.level.length) return this.level[t];
|
7474
7475
|
return VM.UNDEFINED;
|
@@ -7476,7 +7477,7 @@ class Node extends NodeBox {
|
|
7476
7477
|
|
7477
7478
|
nonZeroLevel(t) {
|
7478
7479
|
// Returns the level or 0 when level is negligible relative to the
|
7479
|
-
// bounds on the node
|
7480
|
+
// bounds on the node.
|
7480
7481
|
if(t < 0) return this.initial_level.result(1);
|
7481
7482
|
if(t < this.level.length) {
|
7482
7483
|
const l = this.level[t];
|