martendo / gpss-server

A web service to run GPSS programs, using gpss.py

Home Page:https://martendo.github.io/gpss.py/web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gpss-server

A web service to run GPSS programs, using gpss.py

Server hosted at https://gpss-server.herokuapp.com

Running a Simulation

To run a gpss.py program with gpss-server, send a POST request with the program in the request body.

Web gpss.py uses something along the lines of this:

const request = new XMLHttpRequest();
request.open("POST", "https://gpss-server.herokuapp.com");
request.send(program);

Response

gpss-server will respond in JSON. Based on the status, the object that is sent back will look a little different.

Success

The simulation has completed successfully.

The response object will look like this:

{
  status: "success",
  report: string,
  messages: [{
    linenum: integer,
    text: string,
    type: ("parser-error" | "simulation-error" | "warning"),
  }, ... ],
}

For some examples of what the simulation report might look like, see the gpss.py examples page.

Parser Error

One or more errors occurred while parsing the program.

The response object will look like this:

{
  status: "parser-error",
  message: "Parsing failed with X error(s)",
  messages: [{
    linenum: integer,
    text: string,
    type: ("parser-error" | "simulation-error" | "warning"),
  }, ... ],
}

Simulation Error

An error occurred during simulation.

The response object will look like this:

{
  status: "simulation-error",
  message: "Simulation Error",
  messages: [{
    linenum: integer,
    text: string,
    type: ("parser-error" | "simulation-error" | "warning"),
  }, ... ],
}

About

A web service to run GPSS programs, using gpss.py

https://martendo.github.io/gpss.py/web

License:MIT License


Languages

Language:Python 99.1%Language:Procfile 0.9%