linny-r 1.1.20 → 1.1.21

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/README.md CHANGED
@@ -25,7 +25,7 @@ Technical documentation will be developed on GitHub: https://github.com/pwgbots/
25
25
  Linny-R is developed as a JavaScript package, and requires that **Node.js** is installed on your computer.
26
26
  This software can be downloaded from <a href="https://nodejs.org" target="_blank">https://nodejs.org</a>.
27
27
  Make sure that you choose the correct installer for your computer.
28
- Linny-R is developed using the _current_ release. Presently (October 2022) this is 19.0.0.
28
+ Linny-R is developed using the _current_ release. Presently (February 2023) this is 19.6.0.
29
29
 
30
30
  Run the installer and accept the default settings.
31
31
  There is **no** need to install the optional _Tools for Native Modules_.
@@ -36,7 +36,7 @@ Verify the installation by typing:
36
36
 
37
37
  ``node --version``
38
38
 
39
- The response should be the version number of Node.js, for example: v19.0.0.
39
+ The response should be the version number of Node.js, for example: v19.6.0.
40
40
 
41
41
  ## Installing Linny-R
42
42
  It is advisable to install Linny-R in a directory on your computer, not in a cloud.
@@ -169,8 +169,8 @@ Open the Command Line Interface (CLI) of your computer, change to your `WORKING_
169
169
  This response should be something similar to:
170
170
 
171
171
  <pre>
172
- Node.js server for Linny-R version 1.1.14
173
- Node.js version: v19.0.0
172
+ Node.js server for Linny-R version 1.1.21
173
+ Node.js version: v19.6.0
174
174
  ... etc.
175
175
  </pre>
176
176
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linny-r",
3
- "version": "1.1.20",
3
+ "version": "1.1.21",
4
4
  "description": "Executable graphical language with WYSIWYG editor for MILP models",
5
5
  "main": "server.js",
6
6
  "scripts": {
@@ -6739,9 +6739,14 @@ NOTE: Grouping groups results in a single group, e.g., (1;2);(3;4;5) evaluates a
6739
6739
  options.push('<option selected disabled value="-1"></option>');
6740
6740
  const d = MODEL.equations_dataset;
6741
6741
  if(d) {
6742
+ const slist = [];
6742
6743
  for(let m in d.modifiers) if(d.modifiers.hasOwnProperty(m)) {
6743
- const s = d.modifiers[m].selector;
6744
- options.push(`<option value="${s}">${s}</option>`);
6744
+ slist.push(d.modifiers[m].selector);
6745
+ }
6746
+ // Sort to present equations in alphabetical order
6747
+ slist.sort();
6748
+ for(let i = 0; i < slist.length; i++) {
6749
+ options.push(`<option value="${slist[i]}">${slist[i]}</option>`);
6745
6750
  }
6746
6751
  }
6747
6752
  va.innerHTML = options.join('');
@@ -9819,6 +9824,12 @@ class GUIChartManager extends ChartManager {
9819
9824
  } else if(this.chart_index >= 0) {
9820
9825
  // Only accept when all conditions are met
9821
9826
  ev.preventDefault();
9827
+ if(obj instanceof DatasetModifier) {
9828
+ // Equations can be added directly as chart variable
9829
+ this.addVariable(obj.name);
9830
+ return;
9831
+ }
9832
+ // For other entities, the attribute must be specified
9822
9833
  this.add_variable_modal.show();
9823
9834
  const
9824
9835
  tn = VM.object_types.indexOf(obj.type),
@@ -1047,7 +1047,7 @@ class ExpressionParser {
1047
1047
  // NOTE: + and - operators are special case, since they may also
1048
1048
  // be part of a floating point number, hence the more elaborate check
1049
1049
  while(pl <= this.eot && (SEPARATOR_CHARS.indexOf(cpl) < 0 ||
1050
- ('+-'.indexOf(cpl) >= 0 && digs && pcpl === 'e'))) {
1050
+ ('+-'.indexOf(cpl) >= 0 && digs && pcpl.toLowerCase() === 'e'))) {
1051
1051
  digs = digs || '0123456789'.indexOf(cpl) >= 0;
1052
1052
  this.los++;
1053
1053
  pl++;
@@ -6249,6 +6249,8 @@ function VMI_set_const_bounds(args) {
6249
6249
  // if this is the first round
6250
6250
  if(VM.current_round) {
6251
6251
  l = vbl.actualLevel(VM.t);
6252
+ //PATCH!!
6253
+ if(l < 0.0005) l = 0;
6252
6254
  } else {
6253
6255
  l = 0;
6254
6256
  }