Adding MPS Export (#31)

* Initial Push

Inititial project state

* Static demo version

* static demo site - added variables

a

* first_implementation

* Updated UI, Improved Style to be more "Reactly", added Functionality

* add parsing functions

* change folder

* Import/Export Prototype

* Adding "reactjs-popup" to package,json

* Adding GLPK source

* Rough implementation of solver + example

* Show solution in output

* example 2 + popup lib

* removing import button

This feature won't be needed in this state of the project and might come back later. Right now it serves no functional purpose.

* Removing "Popout" button

This feature won't be needed in this state of the project and might come back later. Right now it serves no functional purpose.

* Updating Logs

Now the site displays all logs created with customLog(STRING). Logs can be cleared with customLogClear();

* Adding walltime

Can be called using:

Start:
function walltimeStart() {
returns Date.now();

Stop:
function walltimeStopAndPrint(startpoint: number) {
Add startpoint as argument.
It prints the elapsed time using customLog()

* Adding duals ouput

* Adding glpk.js package

required dependency

* adding LP format export and fixing a few errors

* fixing further errors

* adding automatic build

* Moving files to correct folders

* Update nextjs.yml

* Updating README and .gitignore

README:
- added installation instructions
- added troubleshooting

gitignore:
- skipping Writerside and .idea folders

* Update LICENCE.txt

We are required to use the same license. See https://github.com/hgourvest/node-glpk/blob/master/LICENSE

* Updating icon

* Adding RegEx input checks and updating text box explanations

* Update README.md

Updating license info

Signed-off-by: SinusFox <61253950+SinusFox@users.noreply.github.com>

* Deleting license to recreate proper license

* Update layout.tsx

fixing typo

Signed-off-by: SinusFox <61253950+SinusFox@users.noreply.github.com>

* Fixing word issue

English has some false friends... like the German "Enter" is actually return in English.

* Updatint License

* Fixing design issue and updating license link

* Fixing typo in log

* Fixing white mode

* adding translations 1/2

UI Translations

Coming in 2/2: Output translations

* adding output translations

* adding minimize button

* adding unit test for rendering home page

* fixing maxmin on lp export

* Update .gitignore

* Update .gitignore

* Update scripts.ts

* Update scripts.ts

* Update README.md

* adding tests

* Adding MPS Export

* Updating language file

* Updating Deployment Structure/GitHub Actions

* Update nextjsbuildonly.yml

---------

Signed-off-by: SinusFox <61253950+SinusFox@users.noreply.github.com>
Co-authored-by: moebiusl <lucas.moebius@icloud.com>
Co-authored-by: Marcel Pöppe <marcel.poeppe@gmail.com>
This commit is contained in:
SinusFox
2024-10-11 16:08:24 +02:00
committed by GitHub
parent 9ad9ec1a46
commit 0f19fa71be
12 changed files with 543 additions and 16 deletions
+6
View File
@@ -0,0 +1,6 @@
export interface Bound{
name: string;
type: number; // 1 for lower bound, 2 for upper bound, 3 for equal
ub: number;
lb: number;
}
+9
View File
@@ -0,0 +1,9 @@
export interface Bounds{ type: number, ub: number, lb: number }
export const GLP_FR = 1; /* free (unbounded) variable */
export const GLP_LO = 2; /* variable with lower bound */
export const GLP_UP = 3; /* variable with upper bound */
export const GLP_DB = 4; /* double-bounded variable */
export const GLP_FX = 5; /* fixed variable */
export const GLP_MAX = 2;
export const GLP_MIN = 1
+8
View File
@@ -0,0 +1,8 @@
import {Variable} from "./Variable";
import {Bounds} from "./Bounds";
export interface Constraint {
name: string;
vars: Variable[];
bounds: Bounds;
}
+18
View File
@@ -0,0 +1,18 @@
import {Variable} from "./Variable";
import {Bound} from "./Bound";
import {Options} from "./Options";
import {Constraint} from "./Constraint";
export interface LP {
name: string,
objective: {
direction: number,
name: string,
vars: Variable[]
},
subjectTo: Constraint[],
bounds?: Bound[],
binaries?: string[],
generals?: string[],
options?: Options
}
+12
View File
@@ -0,0 +1,12 @@
import {Result} from "./Result";
export interface Options {
mipgap?: number, /* set relative mip gap tolerance to mipgap, default 0.0 */
tmlim?: number, /* limit solution time to tmlim seconds, default INT_MAX */
msglev?: number, /* message level for terminal output, default GLP_MSG_ERR */
presol?: boolean, /* use presolver, default true */
cb?: { /* a callback called at each 'each' iteration (only simplex) */
call(result: Result):Result,
each: number
}
}
+10
View File
@@ -0,0 +1,10 @@
export interface Result {
name: string;
time: number;
result: {
status: number;
z: number;
vars: {[key:string]: number};
dual?: { [key: string]: number }; /* simplex only */
};
}
+4
View File
@@ -0,0 +1,4 @@
export interface Variable {
name: string;
coef: number
}