linny-r 1.1.7 → 1.1.8

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
@@ -5,7 +5,8 @@
5
5
  <a href="https://en.wikipedia.org/wiki/Unit_commitment_problem_in_electrical_power_production" target="_blank">unit commitment problems</a> (UCP) and
6
6
  <a href="https://en.wikipedia.org/wiki/Generation_expansion_planning" target="_blank">generation expansion planning</a> (GEP).</p>
7
7
 
8
- The graphical language and WYSIWYG model editor are developed by **Pieter Bots** at Delft University of Technology.
8
+ The graphical language and WYSIWYG model editor are developed by **Pieter Bots** at
9
+ <a href="https://tudelft.nl" target="_blank">Delft University of Technology</a>.
9
10
 
10
11
  Originally implemented in Delphi Pascal, Linny-R is now developed in HTML+CSS+JavaScript
11
12
  so as to be platform-independent and 100% transparent open source (under the MIT license).
@@ -13,21 +14,21 @@ The software comprises a server that runs on Node.js, and a graphical user inter
13
14
 
14
15
  You can play with the most recent release of Linny-R on
15
16
  <a href="https://sysmod.tbm.tudelft.nl/linny-r" target="_blank">this server hosted at TU Delft</a>.
16
- Note that this server imposes restrictions on solver time and the total number of blocks it will solve per run.
17
+ Note that this server imposes restrictions on solver time and the total number of blocks it will solve per run.
17
18
  If you install Linny-R on your own machine, no such restrictions apply.
18
19
 
19
20
  Documentation for Linny-R is still scant, but it is growing. You can contribute yourself (in "wiki fashion")
20
- via the official documentation site https://linny-r.info.
21
+ via the official documentation site <a href="https://linny-r.info" target="_blank">https://linny-r.info</a>.
21
22
 
22
23
  ### Installing Node.js
23
24
 
24
25
  Linny-R is developed as a JavaScript package, and requires that **Node.js** is installed on your computer.
25
- Node.js can be downloaded from https://nodejs.org.
26
+ This software can be downloaded from <a href="https://nodejs.org" target="_blank">https://nodejs.org</a>.
26
27
  Make sure that you choose the correct installer for your computer.
27
- Linny-R is developed using the *current* release. Presently (October 2022) this is 18.10.0.
28
+ Linny-R is developed using the _current_ release. Presently (October 2022) this is 18.10.0.
28
29
 
29
30
  Run the installer and accept the default settings.
30
- There is **no** need to install the optional Tools for Native Modules.
31
+ There is **no** need to install the optional _Tools for Native Modules_.
31
32
 
32
33
  Open the Command Line Interface (CLI) of your computer.
33
34
  On macOS, this will be `Terminal`, on Windows `Command Prompt`.
@@ -101,13 +102,13 @@ and the sub-directory `static`. This `static` directory should contain three HTM
101
102
 
102
103
  It should also contain the style sheet `linny-r.css` required by the GUI.
103
104
 
104
- The subdirectories of `static` contain files that are served to the browser by the script
105
+ The sub-directories of `static` contain files that are served to the browser by the script
105
106
  `server.js` when it is running in Node.js.
106
107
 
107
108
  ### Configuring the MILP solver
108
109
 
109
110
  Linny-R presently supports two MILP solvers: Gurobi and LP_solve.
110
- Gurobi is *considerably* more powerful than the open source LP_solve solver that has powered Linny-R since 2009,
111
+ Gurobi is _considerably_ more powerful than the open source LP_solve solver that has powered Linny-R since 2009,
111
112
  but it requires a license.
112
113
  Academic licenses can be obtained by students and staff of eligible institutions.
113
114
 
@@ -167,7 +168,7 @@ Open the Command Line Interface (CLI) of your computer, change to your `WORKING_
167
168
  This response should be something similar to:
168
169
 
169
170
  <pre>
170
- Node.js server for Linny-R version 1.0
171
+ Node.js server for Linny-R version 1.1.8
171
172
  Node.js version: v18.10.0
172
173
  ... etc.
173
174
  </pre>
@@ -191,7 +192,7 @@ stating the name of the solver.
191
192
  You can then test the GUI by creating a simple model.
192
193
  Make one that has at least one process that outputs a product,
193
194
  and this product must have a price or a set lower bound, otherwise the model will have no objective function.
194
- Then click on the *Solve* button at the bottom of the left-hand tool bar.
195
+ Then click on the _Solve_ button at the bottom of the left-hand tool bar.
195
196
  The Linny-R icon in the upper left corner should start rotating, while the status bar at the bottom should display:
196
197
 
197
198
  <pre>
@@ -211,10 +212,10 @@ Solve block 1 a
211
212
  The user workspace is created when the server is run for the first time.
212
213
  The sub-directories of this directory `user` are used by Linny-R to store files.
213
214
 
214
- * `channel` and `callback` will be used to interact with Linny-R via its *Receiver*
215
+ * `channel` and `callback` will be used to interact with Linny-R via its _Receiver_
215
216
  * `diagrams` will be used to render Scalable Vector Graphics (SVG) files as
216
217
  Portable Network Graphics (PNG) using Inkscape (if installed)
217
- * `modules` will contain models stored in the `local host` *repository*
218
+ * `modules` will contain models stored in the `local host` _repository_
218
219
  * `solver` will contain the files that are exchanged with the Mixed Integer Linear Programming (MILP) solver
219
220
  (the names of the files that will appear in this directory may vary, depending on the MILP-solver you use)
220
221
 
@@ -239,7 +240,7 @@ When you download a diagram, it will be saved as a .svg file.
239
240
  These files can be viewed and edited using Inkscape, an open source vector graphics editor.
240
241
 
241
242
  As it may be tedious to first save a diagram as SVG and then render it manually as a bitmap image,
242
- Linny-R features a *Render diagram as bitmap* button on the top toolbar, and on the bottom toolbar of the *Chart manager*.
243
+ Linny-R features a *Render diagram as bitmap* button on the top toolbar, and on the bottom toolbar of the _Chart manager_.
243
244
  When you click it, Linny-R will send the image as SVG to the server.
244
245
  The server script will save the SVG in the `user/diagrams` sub-directory,
245
246
  and then try to execute an Inkscape command that will convert this SVG to a PNG image file in the same directory.
@@ -261,8 +262,8 @@ so you need to do this yourself.
261
262
  To facilitate start-up, you can create a shortcut icon on your desktop.
262
263
 
263
264
  On a Windows machine, change to your Linny-R folder, right-click on the batch file `linny-r.bat`,
264
- and select the *Create shortcut* option.
265
- Then right-click on the shortcut file to edit its properties, and click the *Change Icon* button.
265
+ and select the _Create shortcut_ option.
266
+ Then right-click on the shortcut file to edit its properties, and click the _Change Icon_ button.
266
267
  The dialog that then appears will allow you to go to the sub-folder `node_modules\linny-r\static\images`,
267
268
  where you should select the file `linny-r.ico`.
268
269
  Finally, rename the shortcut to `Linny-R` and move or copy it to your desktop.
@@ -281,8 +282,7 @@ and from there drag/drop the file `linny-r.icns` on the icon shown in the top le
281
282
 
282
283
  If you have not configured a "click-start" icon as described above,
283
284
  you must start a modeling session with Linny-R by opening a CLI box,
284
- then change to the Linny-R directory, type `node server`,
285
- open your browser, and then navigate to http://127.0.0.1:5050
285
+ then change to the Linny-R directory and type `linny-r`.
286
286
 
287
287
  To shut down the server, click on the local host icon in the upper right corner of the Linny-R GUI in your browser.
288
288
  Alternatively, you can stop the server by repeatedly pressing ``Ctrl+C`` in the CLI box.
@@ -306,7 +306,8 @@ you will see the command line options that allow you to run models in various wa
306
306
  ### Troubleshooting problems
307
307
 
308
308
  If during any of the steps above you encounter problems, please try to diagnose them and resolve them yourself.
309
- You can find a lot of useful information on the Linny-R documentatio website: https://linny-r.info
309
+ You can find a lot of useful information on the Linny-R documentatio website:
310
+ <a href="https://linny-r.info" target="_blank">https://linny-r.info</a>.
310
311
 
311
312
  To diagnose a problem, always look in the CLI box where Node.js is running,
312
313
  as informative server-side error messages will appear there.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linny-r",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "Executable graphical language with WYSIWYG editor for MILP models",
5
5
  "main": "server.js",
6
6
  "scripts": {
package/post-install.js CHANGED
@@ -52,21 +52,24 @@ const
52
52
  path = require('path'),
53
53
  os = require('os'),
54
54
  PLATFORM = os.platform(),
55
- WORKING_DIRECTORY = process.cwd(),
55
+ mod_dir = path.join('node_modules', 'linny-r'),
56
+ // NOTE: working directory for this script is the *module* directory,
57
+ // which is two levels deeper than the actual working directory
58
+ WORKING_DIRECTORY = process.cwd().replace(path.sep + mod_dir, ''),
56
59
  lines = [
57
60
  '# The first line (without the comment symbol #) should be like this:',
58
61
  '# cd ',
59
62
  '',
60
63
  '# Then this command to launch the Linny-R server should work:',
61
- 'node ' + path.join('node_modules', 'linny-r', 'server') + ' launch'
64
+ `node ${mod_dir}${path.sep}server launch`
62
65
  ];
63
66
  let sp;
64
67
  if(PLATFORM.startsWith('win')) {
65
68
  sp = path.join(WORKING_DIRECTORY, 'linny-r.bat');
66
- lines[1] += 'C:\\path\\to\\main\\Linny-R\\directory';
69
+ lines[1] += 'C:\\path\\to\\\\your\\Linny-R\\directory';
67
70
  } else {
68
71
  sp = path.join(WORKING_DIRECTORY, 'linny-r.command');
69
- lines[1] += '/path/to/main/Linny-R/directory';
72
+ lines[1] += '/path/to/your/Linny-R/directory';
70
73
  }
71
74
  lines[2] = 'cd ' + WORKING_DIRECTORY;
72
75
  try {
package/server.js CHANGED
@@ -208,7 +208,7 @@ const SHUTDOWN_MESSAGE = `<!DOCTYPE html>
208
208
  <p>&nbsp;&nbsp;<tt>npm update linny-r</tt><p>
209
209
  to upgrade to Linny-R version ${VERSION_INFO.latest}, and then`) +
210
210
  ` type:</p>
211
- <p>&nbsp;&nbsp;<tt>node node_modules\linny-r\server</tt></p>
211
+ <p>&nbsp;&nbsp;<tt>node node_modules\\linny-r\\server</tt></p>
212
212
  <p>
213
213
  Then switch back to this window, and click
214
214
  <button type="button"