linny-r 1.9.3 → 2.0.2

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.
Files changed (39) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +172 -126
  3. package/console.js +2 -1
  4. package/package.json +1 -1
  5. package/post-install.js +93 -37
  6. package/server.js +73 -29
  7. package/static/images/eq-negated.png +0 -0
  8. package/static/images/power.png +0 -0
  9. package/static/images/tex.png +0 -0
  10. package/static/index.html +226 -11
  11. package/static/linny-r.css +458 -8
  12. package/static/scripts/linny-r-ctrl.js +6 -4
  13. package/static/scripts/linny-r-gui-actor-manager.js +1 -1
  14. package/static/scripts/linny-r-gui-chart-manager.js +20 -13
  15. package/static/scripts/linny-r-gui-constraint-editor.js +410 -50
  16. package/static/scripts/linny-r-gui-controller.js +138 -21
  17. package/static/scripts/linny-r-gui-dataset-manager.js +28 -20
  18. package/static/scripts/linny-r-gui-documentation-manager.js +11 -3
  19. package/static/scripts/linny-r-gui-equation-manager.js +1 -1
  20. package/static/scripts/linny-r-gui-experiment-manager.js +1 -1
  21. package/static/scripts/linny-r-gui-expression-editor.js +7 -1
  22. package/static/scripts/linny-r-gui-file-manager.js +63 -19
  23. package/static/scripts/linny-r-gui-finder.js +1 -1
  24. package/static/scripts/linny-r-gui-model-autosaver.js +1 -1
  25. package/static/scripts/linny-r-gui-monitor.js +1 -1
  26. package/static/scripts/linny-r-gui-paper.js +108 -25
  27. package/static/scripts/linny-r-gui-power-grid-manager.js +529 -0
  28. package/static/scripts/linny-r-gui-receiver.js +1 -1
  29. package/static/scripts/linny-r-gui-repository-browser.js +1 -1
  30. package/static/scripts/linny-r-gui-scale-unit-manager.js +1 -1
  31. package/static/scripts/linny-r-gui-sensitivity-analysis.js +1 -1
  32. package/static/scripts/linny-r-gui-tex-manager.js +110 -0
  33. package/static/scripts/linny-r-gui-undo-redo.js +1 -1
  34. package/static/scripts/linny-r-milp.js +1 -1
  35. package/static/scripts/linny-r-model.js +982 -123
  36. package/static/scripts/linny-r-utils.js +3 -3
  37. package/static/scripts/linny-r-vm.js +731 -252
  38. package/static/show-diff.html +1 -1
  39. package/static/show-png.html +1 -1
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022 Delft University of Technology
3
+ Copyright (c) 2024 Delft University of Technology
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,39 +1,46 @@
1
- <img src="https://sysmod.tbm.tudelft.nl/linny-r/images/logo.png" height="55px" alt="Linny-R">
1
+ <img src="https://sysmod.tbm.tudelft.nl/linny-r/images/logo.png"
2
+ height="55px" alt="Linny-R">
2
3
 
3
4
  Linny-R is an executable graphical specification language for mixed integer
4
- <a href="https://en.wikipedia.org/wiki/Linear_programming" target="_blank">linear programming</a>
5
- (MILP) problems, especially
5
+ <a href="https://en.wikipedia.org/wiki/Linear_programming"
6
+ target="_blank">linear programming</a> (MILP) problems, especially
6
7
  <a href="https://en.wikipedia.org/wiki/Unit_commitment_problem_in_electrical_power_production"
7
8
  target="_blank">unit commitment problems</a>
8
9
  (UCP) and
9
10
  <a href="https://en.wikipedia.org/wiki/Generation_expansion_planning"
10
11
  target="_blank">generation expansion planning</a> (GEP).
11
12
 
12
- The graphical language and WYSIWYG model editor are developed by **Pieter Bots** at
13
- <a href="https://tudelft.nl" target="_blank">Delft University of Technology</a>.
13
+ The graphical language and WYSIWYG model editor are developed by **Pieter Bots**
14
+ at <a href="https://tudelft.nl" target="_blank">Delft University of Technology</a>.
14
15
 
15
- Originally implemented in Delphi Pascal, Linny-R is now developed in HTML+CSS+JavaScript
16
- so as to be platform-independent and 100% transparent open source (under the MIT license).
17
- The software comprises a server that runs on **Node.js**,
18
- and a graphical user interface (GUI) that runs in any modern browser.
19
-
20
- These <a href="https://sysmod.tbm.tudelft.nl/linny-r/docs/?68" target="_blank">instruction videos</a>
21
- published on YouTube give an idea of what Linny-R can do.
22
-
23
- User documentation for Linny-R is still scant, but it is growing. You can contribute yourself
24
- (in "wiki fashion") via the official user documentation site
16
+ Originally implemented in Delphi Pascal, Linny-R is now developed in
17
+ HTML+CSS+JavaScript so as to be platform-independent and 100% transparent
18
+ open source (under the MIT license). The software comprises a server that
19
+ runs on **Node.js**, and a graphical user interface (GUI) that runs in any
20
+ modern browser.
21
+
22
+ These <a href="https://sysmod.tbm.tudelft.nl/linny-r/docs/?68"
23
+ target="_blank">instruction videos</a> published on YouTube give
24
+ an idea of what Linny-R can do.
25
+
26
+ User documentation for Linny-R is still scant. A book "Modeling and
27
+ simulation with Linny-R" will be published by TU Delft OPEN in 2024.
28
+ Meanwhile, you can consult the official user documentation site
25
29
  <a href="https://linny-r.info" target="_blank">https://linny-r.info</a>.
26
- Technical documentation will be developed on GitHub: https://github.com/pwgbots/linny-r/wiki
30
+ Technical documentation will be developed in due time on GitHub:
31
+ https://github.com/pwgbots/linny-r/wiki
27
32
 
28
33
  ## Installing Node.js
29
34
 
30
- Linny-R is developed as a JavaScript package, and requires that **Node.js** is installed on your computer.
31
- This software can be downloaded from <a href="https://nodejs.org" target="_blank">https://nodejs.org</a>.
35
+ Linny-R is developed as a JavaScript package, and requires that **Node.js**
36
+ is installed on your computer. This software can be downloaded from
37
+ <a href="https://nodejs.org" target="_blank">https://nodejs.org</a>.
32
38
  Make sure that you choose the correct installer for your computer.
33
- Linny-R is developed using the _current_ release. Presently (November 2023) this is 21.2.0.
39
+ Linny-R is developed using the _current_ release. Presently (June 2024)
40
+ this is 22.2.0.
34
41
 
35
42
  Run the installer and accept the default settings.
36
- There is **no** need to install the optional _Tools for Native Modules_.
43
+ There is <u>**no**</u> need to install the optional _Tools for Native Modules_.
37
44
 
38
45
  Open the Command Line Interface (CLI) of your computer.
39
46
  On macOS, this will be `Terminal`, on Windows `Command Prompt`.
@@ -41,16 +48,19 @@ Verify the installation by typing:
41
48
 
42
49
  ``node --version``
43
50
 
44
- The response should be the version number of Node.js, for example: v21.2.0.
51
+ The response should be the version number of Node.js, for example: v22.2.0.
45
52
 
46
53
  ## Installing Linny-R
47
- It is advisable to install Linny-R in a directory on your computer, not in a cloud.
54
+ It is advisable to install Linny-R in a directory on your computer, **not**
55
+ in a cloud.
56
+
48
57
  In this installation guide, the path to this directory is denoted by `Linny-R`,
49
58
  so in all commands you should replace this with the actual directory path.
50
59
  On a Windows machine the suggested path is `C:\Users\(your user name)\Documents\Linny-R`,
51
60
  and on a macOS machine `/Users/(your user name)/Linny-R`.
52
61
 
53
- To install Linny-R in this directory, first change to the parent directory like so:
62
+ To install Linny-R in this directory, first change to the parent directory
63
+ like so:
54
64
 
55
65
  ``cd /Users/(your user name)``
56
66
 
@@ -69,7 +79,8 @@ and then type at the command line prompt:
69
79
  > [!IMPORTANT]
70
80
  > The spacing around the dot is essential. Type the command in lower case.
71
81
 
72
- After installation has completed, `Linny-R` should have this directory tree structure:
82
+ After installation has completed, `Linny-R` should have this directory tree
83
+ structure:
73
84
 
74
85
  <pre>
75
86
  Linny-R
@@ -92,22 +103,12 @@ Linny-R
92
103
  </pre>
93
104
 
94
105
  `Linny-R` should contain two JSON files `package.json` and `package-lock.json`
95
- that should **not** be removed, or you will have to re-install Linny-R. It should also contain
96
- a script file to facilitate (single click) launch: on a macOS machine the shell script `linny-r.command`,
97
- on a Windows machine the batch script `linny-r.bat`. By default, this script file contains
98
- two commands: first change to the Linny-R directory and then tell Node.js to launch the
99
- start the Linny-R server.
100
-
101
- > [!NOTE]
102
- > When configuring Linny-R for a network environment where individual users
103
- > each have their personal work space (e.g., a virtual drive U:), you must edit this script file,
104
- > adding the argument `workspace=path/to/workspace` to the `node` command.
105
- > This will instruct Linny-R to create the `user` directory in this workspace directory
106
- > instead of the Linny-R directory.
106
+ that should **not** be removed, or you will have to re-install Linny-R.
107
107
 
108
- The `linny-r` directory should contain this file `README.md`,
108
+ The `linny-r` directory should also contain this file `README.md`,
109
109
  the files `server.js` and `console.js` that will be run by Node.js,
110
- and the sub-directory `static`. This `static` directory should contain three HTML files:
110
+ and the sub-directory `static`. This `static` directory should contain three
111
+ HTML files:
111
112
 
112
113
  * `index.html` (the browser-based GUI)
113
114
  * `show-png.html` (to render SVG diagrams as PNG images)
@@ -115,29 +116,30 @@ and the sub-directory `static`. This `static` directory should contain three HTM
115
116
 
116
117
  It should also contain the style sheet `linny-r.css` required by the GUI.
117
118
 
118
- The sub-directories of `static` contain files that are served to the browser by the script
119
- `server.js` when it is running in Node.js.
119
+ The sub-directories of `static` contain files that are served to the browser
120
+ by the script `server.js` when it is running in Node.js.
120
121
 
121
122
  #### Installing and using an earlier version of Linny-R
122
123
 
123
124
  By default, **npm** will install the latest release of the Linny-R software.
124
- As this software is developed as part of academic research, new features are added
125
- without rigorous testing. Although much effort is dedicated to maintaining upward
126
- and downward compatibility, you may find that the latest version does not work as
127
- well for you as some earlier version. To re-install an earlier release, for example
128
- version 1.4.0, open the CLI, change to your `Linny-R` directory, and then type:
125
+ As this software is developed as part of academic research, new features
126
+ are added without rigorous testing. Although much effort is dedicated to
127
+ maintaining upward and downward compatibility, you may find that the latest
128
+ version does not work as well for you as some earlier version. To re-install
129
+ an earlier release, for example version 1.9.3, open the CLI, change to your
130
+ `Linny-R` directory, and then type:
129
131
 
130
- ``npm install linny-r@1.4.0``
132
+ ``npm install linny-r@1.9.3``
131
133
 
132
134
  > [!NOTE]
133
135
  > This will overwrite the contents of the `node_modules` directory, but
134
136
  > it will not affect the files in your user space.
135
137
 
136
- If you prefer to have different versions of Linny-R on your computer, you can
137
- create a separate directory for a specific version, then change to this
138
+ If you prefer to have different versions of Linny-R on your computer, you
139
+ can create a separate directory for a specific version, then change to this
138
140
  directory and type:
139
141
 
140
- ``npm install --prefix . linny-r@1.4.0``
142
+ ``npm install --prefix . linny-r@1.9.3``
141
143
 
142
144
  > [!NOTE]
143
145
  > To run a specific version in your browser, you must start the server from
@@ -147,10 +149,11 @@ directory and type:
147
149
 
148
150
  ## Configuring the MILP solver
149
151
 
150
- Linny-R presently supports five MILP solvers: Gurobi, MOSEK, CPLEX, SCIP and LP_solve.
151
- Gurobi, MOSEK and CPLEX are _considerably_ more powerful than the open source solvers SCIP and LP_solve,
152
- but they require a license.
153
- Academic licenses can be obtained by students and staff of eligible institutions.
152
+ Linny-R presently supports five MILP solvers: Gurobi, MOSEK, CPLEX, SCIP
153
+ and LP_solve. Gurobi, MOSEK and CPLEX are _considerably_ more powerful than
154
+ the open source solvers SCIP and LP_solve, but they require a license.
155
+ Academic licenses can be obtained by students and staff of eligible
156
+ institutions.
154
157
 
155
158
  > [!IMPORTANT]
156
159
  > When installing a solver, it is advisable to accept the default file
@@ -166,8 +169,9 @@ Gurobi on your computer can be obtained via this URL:
166
169
  <a href="https://www.gurobi.com/academia/academic-program-and-licenses/"
167
170
  target="_blank">https://www.gurobi.com/academia/academic-program-and-licenses/</a>
168
171
 
169
- When running a model, Linny-R will try to execute the command line application `gurobi_cl`.
170
- It will look for this application in the directory specified in the environment variable PATH on your computer.
172
+ When running a model, Linny-R will try to execute the command line application
173
+ `gurobi_cl`. It will look for this application in the directory specified in
174
+ the environment variable PATH on your computer.
171
175
 
172
176
  #### Installing CPLEX
173
177
 
@@ -177,10 +181,11 @@ CPLEX on your computer can be obtained via this URL:
177
181
  <a href="https://www.ibm.com/products/ilog-cplex-optimization-studio"
178
182
  target="_blank">https://www.ibm.com/products/ilog-cplex-optimization-studio</a>
179
183
 
180
- When running a model, Linny-R will try to execute the command line application `cplex`.
181
- It will look for this application in the directory specified in the environment variable PATH
182
- or more specifically in the environment variable CPLEX_STUDIO_BINARIES<em>nnnn</em>
183
- (where _nnnn_ denotes the CPLEX version number) on your computer.
184
+ When running a model, Linny-R will try to execute the command line application
185
+ `cplex`. It will look for this application in the directory specified in the
186
+ environment variable PATH or more specifically in the environment variable
187
+ CPLEX_STUDIO_BINARIES<em>nnnn</em> (where _nnnn_ denotes the CPLEX version
188
+ number) on your computer.
184
189
 
185
190
  #### Installing MOSEK
186
191
 
@@ -190,35 +195,43 @@ MOSEK on your computer can be obtained via this URL:
190
195
  <a href="https://www.mosek.com/resources/getting-started/"
191
196
  target="_blank">https://www.mosek.com/resources/getting-started/</a>
192
197
 
193
- When running a model, Linny-R will try to execute the command line application `mosek`.
194
- It will look for this application in the directory specified in the environment variable PATH on your computer.
198
+ When running a model, Linny-R will try to execute the command line application
199
+ `mosek`. It will look for this application in the directory specified in the
200
+ environment variable PATH on your computer.
195
201
 
196
202
  #### Installing SCIP
197
203
 
198
- The SCIP software is open source. Instructions for installation can be found via this URL:
199
- <a href="https://scipopt.org/doc/html/INSTALL.php" target="_blank">https://scipopt.org/doc/html/INSTALL.php</a>
204
+ The SCIP software is open source. Instructions for installation can be found
205
+ via this URL: <a href="https://scipopt.org/doc/html/INSTALL.php"
206
+ target="_blank">https://scipopt.org/doc/html/INSTALL.php</a>
200
207
 
201
- When running a model, Linny-R will try to execute the command line application `scip`.
202
- It will look for this application in the directory specified in the environment variable PATH on your computer.
208
+ When running a model, Linny-R will try to execute the command line application
209
+ `scip`. It will look for this application in the directory specified in the
210
+ environment variable PATH on your computer.
203
211
 
204
212
  #### Installing LP_solve
205
213
 
206
214
  The LP_solve software is open source and can be downloaded via this URL:
207
- <a href="https://sourceforge.net/projects/lpsolve" target="_blank">https://sourceforge.net/projects/lpsolve</a>
208
-
209
- To facilitate installation, the executable files for Windows and macOS can be downloaded from the Linny-R website
210
- at Delft University of Technology:
211
- <a href="https://sysmod.tbm.tudelft.nl/linny-r/lp_solve" target="_blank">https://sysmod.tbm.tudelft.nl/linny-r/lp_solve</a>
212
-
213
- There you will find links to download LP_solve applications that have been compiled for different platforms.
214
- If you do not know which platform to choose, run Linny-R as described below, and the platform will be listed in its output.
215
- If no matching LP_solve version is listed, you can try to compile the software from its source.
216
- How to do this is explained on the page "Installing LP_solve on a Mac" on the Linny-R documentation site:
215
+ <a href="https://sourceforge.net/projects/lpsolve"
216
+ target="_blank">https://sourceforge.net/projects/lpsolve</a>
217
+
218
+ To facilitate installation, the executable files for Windows and macOS can
219
+ be downloaded from the Linny-R website at Delft University of Technology:
220
+ <a href="https://sysmod.tbm.tudelft.nl/linny-r/lp_solve"
221
+ target="_blank">https://sysmod.tbm.tudelft.nl/linny-r/lp_solve</a>
222
+
223
+ There you will find links to download LP_solve applications that have been
224
+ compiled for different platforms. If you do not know which platform to choose,
225
+ run Linny-R as described below, and the platform will be listed in its output.
226
+ If no matching LP_solve version is listed, you can try to compile the software
227
+ from its source. How to do this is explained on the page "Installing LP_solve
228
+ on a Mac" on the Linny-R documentation site:
217
229
  <a href="https://linny-r.info" target="_blank">https://linny-r.info</a>
218
230
 
219
- When you have downloaded the file (just `lp_solve` for macOS, `lp_solve.exe` for Windows),
220
- you must copy or move this file to your `Linny-R` directory,
221
- as this is where Linny-R will look for it when it does not find one of the other solvers.
231
+ When you have downloaded the file (just `lp_solve` for macOS, `lp_solve.exe`
232
+ for Windows), you must copy or move this file to your `Linny-R` directory,
233
+ as this is where Linny-R will look for it when it does not find one of the
234
+ other solvers.
222
235
 
223
236
  On a macOS machine, you must then make the file `lp_solve` executable.
224
237
  Open Terminal and change to your Linny-R directory, and then type:
@@ -230,30 +243,32 @@ When you then type:
230
243
  ``./lp_solve -h``
231
244
 
232
245
  a window may appear that warns you that the software may be malicious.
233
- To allow running LP_solve, you must then go to Security & Privacy (via System Preferences)
234
- and there click the Open Anyway button in the General pane to confirm that you wish to use LP_solve.
235
- Then return to Terminal and once more type `./lp_solve -h`.
236
- The response should then be a listing of all the command line options of LP_solve.
237
- If you reach this stage, Linny-R will be able to run LP_solve.
246
+ To allow running LP_solve, you must then go to Security & Privacy (via
247
+ System Preferences) and there click the Open Anyway button in the General
248
+ pane to confirm that you wish to use LP_solve. Then return to Terminal
249
+ and once more type `./lp_solve -h`. The response should then be a listing
250
+ of all the command line options of LP_solve. If you reach this stage,
251
+ Linny-R will be able to run LP_solve.
238
252
 
239
253
  ## Running Linny-R
240
254
 
241
- Open the Command Line Interface (CLI) of your computer, change to your Linny-R directory and type:
255
+ Open the Command Line Interface (CLI) of your computer, change to your
256
+ Linny-R directory and type:
242
257
 
243
258
  ``node node_modules/linny-r/server launch``
244
259
 
245
260
  This response should be something similar to:
246
261
 
247
262
  <pre>
248
- Node.js server for Linny-R version 1.7.4
249
- Node.js version: v21.2.0
263
+ Node.js server for Linny-R version 2.0.0
264
+ Node.js version: v22.2.0
250
265
  ... etc.
251
266
  </pre>
252
267
 
253
- Meanwhile, your default web browser should have opened a tab for the local server URL,
254
- which by default will be http://127.0.0.1:5050.
255
- The Linny-R GUI should show in your browser window,
256
- while in the CLI you should see a long series of server log messages like:
268
+ Meanwhile, your default web browser should have opened a tab for the local
269
+ server URL, which by default will be http://127.0.0.1:5050.
270
+ The Linny-R GUI should show in your browser window, while in the CLI you
271
+ should see a long series of server log messages like:
257
272
 
258
273
  <pre>
259
274
  [2023-11-19 22:55:17] Static file: /index.html
@@ -269,13 +284,13 @@ while in the CLI you should see a long series of server log messages like:
269
284
  > Linny-R from a new CLI.
270
285
 
271
286
  After loading into the browser, Linny-R will try to connect to the solver.
272
- If successful, a notification (blue background) will appear on the status bar
273
- at the bottom of the window, stating the name of the solver.
287
+ If successful, a notification (blue background) will appear on the status
288
+ bar at the bottom of the window, stating the name of the solver.
274
289
 
275
290
  You can then test the GUI by creating a simple model.
276
291
  Make one that has at least one process that outputs a product,
277
- and this product must have a price or a set lower bound, otherwise the model
278
- will have no objective function.
292
+ and this product must have a price or a set lower bound, otherwise the
293
+ model will have no objective function.
279
294
  Then click on the _Solve_ button at the bottom of the left-hand tool bar.
280
295
  The Linny-R icon in the upper left corner should start rotating, while the
281
296
  status bar at the bottom should display:
@@ -312,24 +327,47 @@ workspace=[path] to overrule the default path for the user directory
312
327
 
313
328
  ## Click-start for Linny-R
314
329
 
315
- To facilitate start-up, you can create a shortcut icon for Linny-R on your desktop.
330
+ The first time you start Linny-R after a fresh install or an update,
331
+ you will have to open the Command Line Interface (CLI) of your computer,
332
+ change to your Linny-R directory and type:
333
+
334
+ ``node node_modules/linny-r/server launch``
335
+
336
+ This will not only start Linny-R, but also create a script file in your
337
+ Linny-R directory that will allow you to start Linny-R by clicking its
338
+ icon on your machine. On a macOS machine, this fill will be the shell
339
+ script `linny-r.command`, on a Windows machine the batch script
340
+ `linny-r.bat`.
341
+
342
+ To facilitate start-up, you can create a shortcut icon for Linny-R on your
343
+ desktop.
316
344
 
317
345
  On a Windows machine, open the _File Explorer_, select your Linny-R folder,
318
- right-click on the batch file `linny-r.bat`, and select the _Create shortcut_ option.
319
- Then right-click on the shortcut file to edit its properties, and click the _Change Icon_ button.
320
- The dialog that then appears will allow you to go to the sub-folder
321
- `node_modules\linny-r\static\images`, where you should select the file `linny-r.ico`.
322
- Finally, rename the shortcut to `Linny-R` and move or copy it to your desktop.
346
+ right-click on the batch file `linny-r.bat`, and select the _Create shortcut_
347
+ option. Then right-click on the shortcut file to edit its properties, and
348
+ click the _Change Icon_ button. The dialog that then appears will allow
349
+ you to go to the sub-folder `node_modules\linny-r\static\images`, where
350
+ you should select the file `linny-r.ico`. Finally, rename the shortcut to
351
+ `Linny-R` and move or copy it to your desktop.
323
352
 
324
- On a macOS machine, open Terminal and change to your Linny-R directory, and then type:
353
+ On a macOS machine, open Terminal and change to your Linny-R directory,
354
+ and then type:
325
355
 
326
356
  ``chmod +x linny-r.command``
327
357
 
328
- to make the script file executable.
329
- To set the icon, use Finder to open the folder that contains the file `linny-r.command`,
330
- click on its icon (which still is plain) and open the _Info dialog_ by pressing ``Cmd+I``.
331
- Then open your Linny-R folder in Finder, change to the sub-folder `node_modules/linny-r/static/images`,
332
- and from there drag/drop the file `linny-r.icns` on the icon shown in the top left corner of the _Info dialog_.
358
+ to make the script file executable. To set the icon, use Finder to open
359
+ the folder that contains the file `linny-r.command`, click on its icon
360
+ (which still is plain) and open the _Info dialog_ by pressing ``Cmd+I``.
361
+ Then open your Linny-R folder in Finder, change to the sub-folder
362
+ `node_modules/linny-r/static/images`, and from there drag/drop the file
363
+ `linny-r.icns` on the icon shown in the top left corner of the _Info dialog_.
364
+
365
+ > [!NOTE]
366
+ > When configuring Linny-R for a network environment where individual users
367
+ > each have their personal work space (e.g., a virtual drive U:), you must
368
+ > edit this script file, adding the argument `workspace=path/to/workspace`
369
+ > to the `node` command. This will instruct Linny-R to create the `user`
370
+ > directory in this workspace directory instead of the Linny-R directory.
333
371
 
334
372
  ## User workspace
335
373
 
@@ -338,20 +376,21 @@ The sub-directories of this directory `user` are used by Linny-R to store files.
338
376
 
339
377
  * `autosave` will contain models that have been _auto-saved_
340
378
  * `channel` and `callback` will be used to interact with Linny-R via its _Receiver_
341
- * `data` will be used by the _Dataset Manager_ to locate datasets for which a path
342
- has been specified
379
+ * `data` will be used by the _Dataset Manager_ to locate datasets for which
380
+ a path has been specified
343
381
  * `diagrams` will be used to render Scalable Vector Graphics (SVG) files as
344
382
  Portable Network Graphics (PNG) using Inkscape (if installed)
345
383
  * `modules` will contain models stored in the `local host` _repository_
346
- * `reports` will contain text files with time series data and statistics in tab-separated
347
- format that can be imported or copy/pasted into Excel
348
- * `solver` will contain the files that are exchanged with the Mixed Integer Linear Programming (MILP) solver
349
- (the names of the files that will appear in this directory may vary, depending on the MILP-solver you use)
384
+ * `reports` will contain text files with time series data and statistics in
385
+ tab-separated format that can be imported or copy/pasted into Excel
386
+ * `solver` will contain the files that are exchanged with the Mixed Integer
387
+ Linear Programming (MILP) solver (the names of the files that will appear
388
+ in this directory may vary, depending on the MILP-solver you use)
350
389
 
351
390
  > [!NOTE]
352
391
  > By default, the `user` directory is created in your `Linny-R` directory.
353
- > You can overrule this by starting the server with the `workspace=[path]` option.
354
- > This will create a new, empty workspace (the directories listed above) in the specified path.
392
+ > You can overrule this by starting the server with the `workspace=[path]`
393
+ > option. This will create a new, empty workspace in the specified path.
355
394
  > It will **not** affect or duplicate information from existing workspaces.
356
395
 
357
396
  ## Installing Inkscape
@@ -362,8 +401,8 @@ These files can be viewed and edited using Inkscape, an open source
362
401
  vector graphics editor.
363
402
 
364
403
  As it may be tedious to first save a diagram as SVG and then render it
365
- manually as a bitmap image, Linny-R features a *Render diagram as bitmap* button
366
- on the top toolbar, and on the bottom toolbar of the _Chart manager_.
404
+ manually as a bitmap image, Linny-R features a *Render diagram as bitmap*
405
+ button on the top toolbar, and on the bottom toolbar of the _Chart manager_.
367
406
  When you click it, Linny-R will send the image as SVG to the server.
368
407
  The server script will save the SVG in the `user/diagrams` sub-directory,
369
408
  and then try to execute an Inkscape command that will convert this SVG to
@@ -375,7 +414,8 @@ If rendering was successful, the image will appear in this browser tab;
375
414
  if rendering failed, the original SVG image will be shown.
376
415
 
377
416
  To install Inkscape, please look here:
378
- <a href="https://inkscape.org/release" target="_blank">https://inkscape.org/release</a>
417
+ <a href="https://inkscape.org/release"
418
+ target="_blank">https://inkscape.org/release</a>
379
419
 
380
420
  Linny-R will automatically detect whether Inkscape is installed by searching
381
421
  for it in the environment variable PATH on your computer. On a macOS computer,
@@ -388,21 +428,25 @@ Linny-R will look for Inkscape in `/Applications/Inkscape.app/Contents/MacOS`.
388
428
 
389
429
  ## Using Linny-R console
390
430
 
391
- The console-only version of Linny-R allows you to run a Linny-R model without a web browser.
392
- This may be useful when you want run models from a script (shell script, Python, ...).
393
- If you open a CLI box, change to your `Linny-R` directory, and then type:
431
+ The console-only version of Linny-R allows you to run a Linny-R model without
432
+ a web browser. This may be useful when you want run models from a script
433
+ (shell script, Python, ...). If you open a CLI box, change to your `Linny-R`
434
+ directory, and then type:
394
435
 
395
436
  ``node node_modules/linny-r/console`` _(on Windows, use backslashes)_
396
437
 
397
- you will see the command line options that allow you to run models in various ways.
438
+ you will see the command line options that allow you to run models in various
439
+ ways.
398
440
 
399
441
  > [!NOTE]
400
- > The console-only version is still in development, and does not provide all functions yet.
442
+ > The console-only version is still in development, and does not provide
443
+ > all functions yet.
401
444
 
402
445
  ## Troubleshooting problems
403
446
 
404
- If during any of the steps above you encounter problems, please try to diagnose them and resolve them yourself.
405
- You can find a lot of useful information on the Linny-R user documentation website:
447
+ If during any of the steps above you encounter problems, please try to
448
+ diagnose them and resolve them yourself. You can find a lot of useful
449
+ information on the Linny-R user documentation website:
406
450
  <a href="https://linny-r.info" target="_blank">https://linny-r.info</a>.
407
451
 
408
452
  > [!IMPORTANT]
@@ -411,6 +455,8 @@ You can find a lot of useful information on the Linny-R user documentation websi
411
455
 
412
456
  Then also look at the console window of your browser.
413
457
  Most browsers offer a _Web Developer Tools_ option via their application menu.
414
- This will allow you to view the browser console, which will display JavaScript errors in red font.
458
+ This will allow you to view the browser console, which will display JavaScript
459
+ errors in red font.
415
460
 
416
- If you've tried hard, but failed, you can try to contact Pieter Bots at ``p.w.g.bots@tudelft.nl``
461
+ If you've tried hard, but failed, you can try to contact Pieter Bots at
462
+ ``p.w.g.bots@tudelft.nl``
package/console.js CHANGED
@@ -16,7 +16,7 @@ NOTE: For browser-based Linny-R, this file should NOT be loaded, as it
16
16
  */
17
17
 
18
18
  /*
19
- Copyright (c) 2017-2022 Delft University of Technology
19
+ Copyright (c) 2017-2024 Delft University of Technology
20
20
 
21
21
  Permission is hereby granted, free of charge, to any person obtaining a copy
22
22
  of this software and associated documentation files (the "Software"), to deal
@@ -953,6 +953,7 @@ function createWorkspace() {
953
953
  callback: path.join(SETTINGS.user_dir, 'callback'),
954
954
  data: path.join(SETTINGS.user_dir, 'data'),
955
955
  diagrams: path.join(SETTINGS.user_dir, 'diagrams'),
956
+ models: path.join(SETTINGS.user_dir, 'models'),
956
957
  modules: path.join(SETTINGS.user_dir, 'modules'),
957
958
  reports: path.join(SETTINGS.user_dir, 'reports'),
958
959
  solver_output: path.join(SETTINGS.user_dir, 'solver'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linny-r",
3
- "version": "1.9.3",
3
+ "version": "2.0.2",
4
4
  "description": "Executable graphical language with WYSIWYG editor for MILP models",
5
5
  "main": "server.js",
6
6
  "scripts": {