### SetupTime_avg(id) / SetupTime_average(id) / SetupTime_Mittelwert(id)
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the average setup time of the clients at station id, in seconds. Note: Setup times are also recorded as part of the service times.
```APIDOC
## SetupTime_avg(id) / SetupTime_average(id) / SetupTime_Mittelwert(id)
### Description
Gets the average setup time of the clients at station id (in seconds). Note: Setup times are also recorded as part of the service times.
### Parameters
- **id** (string) - Required - The station id.
### Returns
- **average** (number) - The average setup time in seconds.
```
--------------------------------
### SetupTime_min(id) / SetupTime_Minimum(id)
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the minimum setup time of the clients at station id, in seconds.
```APIDOC
## SetupTime_min(id) / SetupTime_Minimum(id)
### Description
Gets the minimum setup time of the clients at station id (in seconds).
### Parameters
- **id** (string) - Required - The station id.
### Returns
- **minimum** (number) - The minimum setup time in seconds.
```
--------------------------------
### SetupTime_median(id)
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the median of the setup times of the clients at station id, in seconds.
```APIDOC
## SetupTime_median(id)
### Description
Gets the median of the setup times of the clients at station id (in seconds).
### Parameters
- **id** (string) - Required - The station id.
### Returns
- **median** (number) - The median setup time in seconds.
```
--------------------------------
### Example code for running an optimization
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Scripts/network/SocketConnectionTest.ipynb
Shows how to define an optimization step function and run it within a QS context. The code is commented out and assumes the simulator is started in socket server mode.
```python
# # Load initial model
# model = Model("filename.xml")
#
# def optimization_step(x, simulator, model):
# model.set_attr("station", "tag", "attribute", x) # Define what to change
# xml_model = model.get()
# xml_result = simulator.run_task(xml_model)
# statistics = Statistics(xml_result)
# y = statistics.get_attr("xmlpath", "attribute") # Define objective value
# return y
#
# with QS(java_path, simulator_path) as qs:
# # Add optimization loop here
# x = 123
# y = optimization_step(x, qs, model)
```
--------------------------------
### SetupTime_sk(id)
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the skewness of the setup times of the clients at station id.
```APIDOC
## SetupTime_sk(id)
### Description
Gets the skewness of the setup times of the clients at station id.
### Parameters
- **id** (string) - Required - The station id.
### Returns
- **skewness** (number) - The skewness (unitless).
```
--------------------------------
### SetupTime_quantil(p;id)
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the quantile for the probability p of the setup times of the clients at station id, in seconds.
```APIDOC
## SetupTime_quantil(p;id)
### Description
Gets the quantil for the probability p of the setup times of the clients at station id (in seconds).
### Parameters
- **p** (number) - Required - The probability for the quantile.
- **id** (string) - Required - The station id.
### Returns
- **quantile** (number) - The quantile value in seconds.
```
--------------------------------
### SetupTime_max(id) / SetupTime_Maximum(id)
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the maximum setup time of the clients at station id, in seconds.
```APIDOC
## SetupTime_max(id) / SetupTime_Maximum(id)
### Description
Gets the maximum setup time of the clients at station id (in seconds).
### Parameters
- **id** (string) - Required - The station id.
### Returns
- **maximum** (number) - The maximum setup time in seconds.
```
--------------------------------
### Simulation procedure: create EditModel, Simulator, prepare, start, getStatistics
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/docs/simulator-architecture-core.pdf
Shows the standard sequence to run a simulation: create an EditModel, configure it, create a Simulator, prepare it, check for errors, start it, and then access the Statistics object for results.
```java
EditModel editModel=new EditModel();
editModel.<…>
Simulator simulator=new Simulator(editModel,null);
String error=simulator.prepare();
if (error!=null) {System.out.println(error); return;}
simulator.start();
Statistics statistics=simulator.getStatistics();
statistics.<…>
```
--------------------------------
### Load model and run simulation task
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Scripts/network/SocketConnectionTest.ipynb
Loads an example model and runs it either by connecting to an already running socket server or by starting the simulator in socket server mode. Prints a message indicating the mode used.
```python
# Load model
xml_model = get_example_model()
# Load custom model: xml_model = Model("filename.xml").get()
# Perform test
if simulator_already_running_on_port > 0:
print("Connect to already running socket server.")
qs = QS_socket_only("localhost", port=simulator_already_running_on_port)
xml_result = qs.run_task(xml_model)
else:
print("Starting simulator in socket server mode, connect to simulator.")
with QS(java_path, simulator_path) as qs:
xml_result = qs.run_task(xml_model)
```
--------------------------------
### SetupTime_cv(id)
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the coefficient of variation of the setup times of the clients at station id.
```APIDOC
## SetupTime_cv(id)
### Description
Gets the coefficient of variation of the setup times of the clients at station id.
### Parameters
- **id** (string) - Required - The station id.
### Returns
- **coefficient_of_variation** (number) - The coefficient of variation (unitless).
```
--------------------------------
### SetupTime_sd(id) / SetupTime_Standardabweichung(id)
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the standard deviation of the setup times of the clients at station id, based on seconds.
```APIDOC
## SetupTime_sd(id) / SetupTime_Standardabweichung(id)
### Description
Gets the standard deviation of the setup times of the clients at station id (based on seconds).
### Parameters
- **id** (string) - Required - The station id.
### Returns
- **standard_deviation** (number) - The standard deviation of setup times in seconds.
```
--------------------------------
### SetupTime_var(id) / SetupTime_Varianz(id)
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the variation (variance) of the setup times of the clients at station id, based on seconds.
```APIDOC
## SetupTime_var(id) / SetupTime_Varianz(id)
### Description
Gets the variation of the setup times of the clients at station id (based on seconds).
### Parameters
- **id** (string) - Required - The station id.
### Returns
- **variance** (number) - The variance of setup times in seconds squared.
```
--------------------------------
### Output of starting simulator in socket server mode
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Scripts/network/SocketConnectionTest.ipynb
Expected output when the simulator is started in socket server mode.
```text
Output:
Starting simulator in socket server mode, connect to simulator.
```
--------------------------------
### SetupTime_hist(id;time)
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the fraction of values for which the setup time at station id was exactly time seconds.
```APIDOC
## SetupTime_hist(id;time)
### Description
Gets the fraction of values for which the setup time at station id was time seconds.
### Parameters
- **id** (string) - Required - The station id.
- **time** (number) - Required - The exact setup time in seconds.
### Returns
- **fraction** (number) - The fraction of values matching the exact time.
```
--------------------------------
### SetupTime_scv(id)
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the squared coefficient of variation of the setup times of the clients at station id.
```APIDOC
## SetupTime_scv(id)
### Description
Gets the squared coefficient of variation of the setup times of the clients at station id.
### Parameters
- **id** (string) - Required - The station id.
### Returns
- **squared_coefficient_of_variation** (number) - The squared coefficient of variation (unitless).
```
--------------------------------
### SetupTime_hist(id;timeA;timeB)
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the fraction of values for which the setup time at station id was more than timeA and at most timeB seconds.
```APIDOC
## SetupTime_hist(id;timeA;timeB)
### Description
Gets the fraction of values for which the setup time at station id was more than timeA and at most timeB seconds.
### Parameters
- **id** (string) - Required - The station id.
- **timeA** (number) - Required - The lower bound (exclusive) in seconds.
- **timeB** (number) - Required - The upper bound (inclusive) in seconds.
### Returns
- **fraction** (number) - The fraction of values in the interval (timeA, timeB].
```
--------------------------------
### SetupTime_kurt(id)
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the excess kurtosis of the setup times of the clients at station id.
```APIDOC
## SetupTime_kurt(id)
### Description
Gets the excess kurtosis of the setup times of the clients at station id.
### Parameters
- **id** (string) - Required - The station id.
### Returns
- **excess_kurtosis** (number) - The excess kurtosis (unitless).
```
--------------------------------
### Simulation.getWIP()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/ScriptingJS.tex
Gets the current number of clients in the system.
```APIDOC
## Simulation.getWIP()
### Description
Gets the current number of clients in the system.
### Method
Simulation.getWIP
### Parameters
None.
### Return Value
Number - The current number of clients in the system.
```
--------------------------------
### Statistics.xml example
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/ScriptingJS.tex
Loads an XML field and returns its data as a string using the format and separator settings. The example accesses the ModelName field.
```javascript
var name=Statistics.xml("Model->ModelName");
```
--------------------------------
### Interactive
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/docs/Warteschlangensimulator-Commandline-en.pdf
Starts the interactive mode. This command expects no additional parameters.
```APIDOC
## Interactive
### Description
Starts the interactive mode. This command expects no additional parameters.
### Method
CLI
### Command
java -jar Simulator.jar Interactive
### Parameters
None.
### Example
java -jar Simulator.jar Interactive
```
--------------------------------
### WIP() / N() / Station()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the current total number of clients in the system.
```APIDOC
## WIP() / N() / Station()
### Description
Gets the current total number of clients in the system.
### Method
Function call
### Endpoint
WIP() or N() or Station()
### Parameters
None
### Returns
- **current total number of clients** (integer) - The current total number of clients in the system.
```
--------------------------------
### WIP_median() / Station_median() / N_median()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the median of the number of clients in the system.
```APIDOC
## WIP_median() / Station_median() / N_median()
### Description
Gets the median of the number of clients in the system.
### Method
Function call
### Endpoint
WIP_median() or Station_median() or N_median()
### Parameters
None
### Returns
- **median** (number) - The median of the number of clients in the system.
```
--------------------------------
### Simulation.getNQ()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/ScriptingJS.tex
Gets the current number of waiting clients in the system.
```APIDOC
## Simulation.getNQ()
### Description
Gets the current number of waiting clients in the system.
### Method
Simulation.getNQ
### Parameters
None.
### Return Value
Number - The current number of waiting clients in the system.
```
--------------------------------
### Start the simulator with java -jar Simulator.jar
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/docs/Warteschlangensimulator-Commandline-en.pdf
Launches the Warteschlangensimulator Java program. A Java runtime environment is required. Optionally, append a file name (model, statistics, parameter series, or optimizer file) to load it immediately after startup.
```bash
java-jar Simulator.jar
```
--------------------------------
### WIP_sk() / Station_sk() / N_sk()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the skewness of the number of clients in the system.
```APIDOC
## WIP_sk() / Station_sk() / N_sk()
### Description
Gets the skewness of the number of clients in the system.
### Method
Function call
### Endpoint
WIP_sk() or Station_sk() or N_sk()
### Parameters
None
### Returns
- **skewness** (number) - The skewness of the number of clients in the system.
```
--------------------------------
### Initialize 3D Viewer and Scene
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/src/main/java/net/web/res/qs3d_de.html
Initializes the 3D viewer environment, builds the scene from the model, and sets up the camera controls and update loop.
```javascript
'use strict'; function resizeWindow() { document.getElementById('viewerArea').style.height=window.innerHeight+'px'; } resizeWindow(); var model=new ModelReader(qs_model); var modelName=model.getAny(model.nodes,Language.xmlModelName); if (modelName!=null && typeof(modelName.xmlcontent)!='undefined') document.getElementById('viewerTitle').innerHTML=modelName.xmlcontent; var modelSize=model.getModelSize(); var margin=2000; var scale=3; var rangeX=[-margin,modelSize[0]*scale+margin]; var rangeZ=[-margin,modelSize[1]*scale+margin]; var viewer=new Viewer3D(document.getElementById('viewerArea'),rangeX,[1,2000],rangeZ,[(rangeX[1]+rangeX[0])/2,500,rangeZ[1]]); var frame=new FrameBuilder(viewer.scene,textureFloor,rangeX,rangeZ,3000); var scene=new SceneBuilder(viewer.scene,model,scale); frame.build(); scene.build(); viewer.addControls(); viewer.start(); resizeWindow(); setInterval(function(){ var p=viewer.camera.position; var info=""; info+=Language.info1+"
"+Language.info2+"
"+Language.info3+"
"; info+=viewer.currentFPS+" fps; "+Language.infoCamera+": ("+Math.round(p.x/scale)+","+Math.round(p.z/scale)+")"; info+=" "+Language.infoHide+""; document.getElementById("viewerInfo").innerHTML=info; },1000);
```
--------------------------------
### Dockerfile for Warteschlangensimulator
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Scripts/docker/docker-socket.txt
Builds a container image for the Warteschlangensimulator. It copies the Simulator.jar and its libs, sets the working directory, and runs the jar with the 'serversocket' argument on port 10000.
```dockerfile
FROM eclipse-temurin:17
RUN mkdir /opt/app
COPY Simulator.jar /opt/app
RUN mkdir /opt/app/libs
COPY libs/*.jar /opt/app/libs/
WORKDIR /opt/app
CMD ["java", "-jar", "Simulator.jar","serversocket","10000"]
EXPOSE 10000
```
--------------------------------
### WIP_min() / Station_min() / N_min() / WIP_Minimum() / Station_Minimum() / N_Minimum()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the minimal number of clients in the system.
```APIDOC
## WIP_min() / Station_min() / N_min() / WIP_Minimum() / Station_Minimum() / N_Minimum()
### Description
Gets the minimal number of clients in the system.
### Method
Function call
### Endpoint
WIP_min() or Station_min() or N_min() or WIP_Minimum() or Station_Minimum() or N_Minimum()
### Parameters
None
### Returns
- **minimal number of clients** (integer) - The minimal number of clients in the system.
```
--------------------------------
### Help
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/docs/Warteschlangensimulator-Commandline-en.pdf
Shows help. This command expects one or no additional parameters. If a command is entered as additional parameter, the help information for that command is displayed. Otherwise a list with all available commands is displayed.
```APIDOC
## Help
### Description
Shows help. This command expects one or no additional parameters. If a command is entered as additional parameter, the help information for that command is displayed. Otherwise a list with all available commands is displayed.
### Method
CLI
### Command
java -jar Simulator.jar Help [command]
### Parameters
#### Positional Parameters
- **command** (string) - Optional - The command for which help information is to be displayed.
### Example
java -jar Simulator.jar Help Export
```
--------------------------------
### WIP_cv() / Station_cv() / N_cv()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the coefficient of variation of the number of clients in the system.
```APIDOC
## WIP_cv() / Station_cv() / N_cv()
### Description
Gets the coefficient of variation of the number of clients in the system.
### Method
Function call
### Endpoint
WIP_cv() or Station_cv() or N_cv()
### Parameters
None
### Returns
- **coefficient of variation** (number) - The coefficient of variation of the number of clients in the system.
```
--------------------------------
### resource_min() / resource_Minimum() / utilization_min() / utilization_Minimum()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the minimum number of busy operators in all resources.
```APIDOC
## resource_min() / resource_Minimum() / utilization_min() / utilization_Minimum()
### Description
Gets the minimum number of busy operators in all resources.
### Parameters
None.
### Returns
- The minimum number of busy operators in all resources.
```
--------------------------------
### Configure Java and simulator paths
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Scripts/network/SocketConnectionTest.ipynb
Sets optional paths for Java and Warteschlangensimulator, and a port number if the simulator is already running. If auto-detection fails, specify the paths. If the simulator is already running, set the port; otherwise keep -1.
```python
# If Java auto dection is not working, specify the path to the Java runtime environment or development kit here
java_path = None
# If Warteschlangensimulator auto detection is not working, specify the path to Warteschlangensimulator here
simulator_path = None
# If the simulator is already running and is not to be started and stopped by this script,
# enter the port number here. Otherwide let this field at -1.
simulator_already_running_on_port = -1
```
--------------------------------
### Run optimization with PyBOBYQA
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Scripts/network/SocketConnectionTest.ipynb
Shows how to use PyBOBYQA to run an optimization by calling pybobyqa.solve with the optimization_step function.
```python
with QS(java_path, simulator_path) as qs:
soln = pybobyqa.solve(optimization_step, x0, bounds=(a, b), args=(qs, model))
```
--------------------------------
### ResidenceTime_sk()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the skewness of the residence times over all clients.
```APIDOC
## ResidenceTime_sk()
### Description
Gets the skewness of the residence times over all clients.
### Function Signature
ResidenceTime_sk()
### Parameters
None.
### Return Value
- The skewness.
```
--------------------------------
### Optimizer
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/docs/Warteschlangensimulator-Commandline-en.pdf
Starts a model optimization. This command expects exactly two additional parameters: input model file and optimizer configuration file.
```APIDOC
## Optimizer
### Description
Starts a model optimization. This command expects exactly two additional parameters: input model file and optimizer configuration file.
### Method
CLI
### Command
java -jar Simulator.jar Optimizer
### Parameters
#### Positional Parameters
- **inputModelFile** (string) - Required - Input model file. Must exist.
- **optimizerConfigFile** (string) - Required - Optimizer configuration file. Must exist.
### Example
java -jar Simulator.jar Optimizer model.sim optimizer.conf
```
--------------------------------
### ProcessTime_sk()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the skewness of the process times over all clients.
```APIDOC
## ProcessTime_sk()
### Description
Gets the skewness of the process times over all clients.
### Parameters
None.
### Returns
- **number** - The skewness.
```
--------------------------------
### TransferTime_sk()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the skewness of the transfer times over all clients.
```APIDOC
## TransferTime_sk()
### Description
Gets the skewness of the transfer times over all clients.
### Function Signature
TransferTime_sk()
### Parameters
None.
### Return Value
- **number** - The skewness.
```
--------------------------------
### WaitingTime_sk()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the skewness of the waiting times over all clients.
```APIDOC
## WaitingTime_sk()
### Description
Gets the skewness of the waiting times over all clients.
### Parameters
None.
### Returns
- **number** - The skewness.
```
--------------------------------
### NQ_min() / Queue_min() / Schlange_min() / Warteschlange_min() / NQ_Minimum() / Queue_Minimum() / Schlange_Minimum() / Warteschlange_Minimum()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the minimal number of waiting clients in the system.
```APIDOC
## NQ_min() / Queue_min() / Schlange_min() / Warteschlange_min() / NQ_Minimum() / Queue_Minimum() / Schlange_Minimum() / Warteschlange_Minimum()
### Description
Gets the minimal number of waiting clients in the system.
### Method
Function call
### Endpoint
NQ_min() or Queue_min() or Schlange_min() or Warteschlange_min() or NQ_Minimum() or Queue_Minimum() or Schlange_Minimum() or Warteschlange_Minimum()
### Parameters
None
### Returns
- **minimal number of waiting clients** (integer) - The minimal number of waiting clients in the system.
```
--------------------------------
### Import socket connection and model processing modules
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Scripts/network/SocketConnectionTest.ipynb
Imports the QS_full_connect and QS_socket_connect functions from socket_connect, and Model, Statistics, and get_example_model from model_processor.
```python
from socket_connect import QS_full_connect as QS, QS_socket_connect as QS_socket_only
from model_processor import Model, Statistics, get_example_model
```
--------------------------------
### costs_process()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the process time costs of the current client.
```APIDOC
## costs_process()
### Description
Gets the process time costs of the current client.
### Returns
- The process time costs of the current client.
```
--------------------------------
### costs_process_sum()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the sum of the process time costs of all clients.
```APIDOC
## costs_process_sum()
### Description
Gets the sum of the process time costs of all clients.
### Returns
- The sum of process time costs for all clients.
```
--------------------------------
### costs_transfer()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the transfer time costs of the current client.
```APIDOC
## costs_transfer()
### Description
Gets the transfer time costs of the current client.
### Returns
- The transfer time costs of the current client.
```
--------------------------------
### NQ_avg() / Queue_avg() / Schlange_avg() / Warteschlange_avg() / NQ_Mittelwert() / Queue_Mittelwert() / Schlange_Mittelwert() / Warteschlange_Mittelwert()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the average number of waiting clients in the system.
```APIDOC
## NQ_avg() / Queue_avg() / Schlange_avg() / Warteschlange_avg() / NQ_Mittelwert() / Queue_Mittelwert() / Schlange_Mittelwert() / Warteschlange_Mittelwert()
### Description
Gets the average number of waiting clients in the system.
### Method
Function call
### Endpoint
NQ_avg() or Queue_avg() or Schlange_avg() or Warteschlange_avg() or NQ_Mittelwert() or Queue_Mittelwert() or Schlange_Mittelwert() or Warteschlange_Mittelwert()
### Parameters
None
### Returns
- **average number of waiting clients** (number) - The average number of waiting clients in the system.
```
--------------------------------
### costs_transfer_sum()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the sum of the transfer time costs of all clients.
```APIDOC
## costs_transfer_sum()
### Description
Gets the sum of the transfer time costs of all clients.
### Returns
- The sum of transfer time costs for all clients.
```
--------------------------------
### WIP_avg() / Station_avg() / N_avg() / WIP_Mittelwert() / Station_Mittelwert() / N_Mittelwert()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the average number of clients in the system.
```APIDOC
## WIP_avg() / Station_avg() / N_avg() / WIP_Mittelwert() / Station_Mittelwert() / N_Mittelwert()
### Description
Gets the average number of clients in the system.
### Method
Function call
### Endpoint
WIP_avg() or Station_avg() or N_avg() or WIP_Mittelwert() or Station_Mittelwert() or N_Mittelwert()
### Parameters
None
### Returns
- **average number of clients** (number) - The average number of clients in the system.
```
--------------------------------
### costs_waiting()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the waiting time costs of the current client.
```APIDOC
## costs_waiting()
### Description
Gets the waiting time costs of the current client.
### Returns
- The waiting time costs of the current client.
```
--------------------------------
### Command-line calling scheme: java -jar Simulator.jar Command OptionsForCommand
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/docs/Warteschlangensimulator-Commandline-en.pdf
Invokes the simulator with a command and its options. No program window is displayed; all output goes to the command line. Commands can also be tried via the graphical interface using 'Execute command-line command...' in the 'Extras' menu.
```bash
java-jar Simulator.jar Command OptionsForCommand
```
--------------------------------
### resource_down()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the number of operators that are currently in down time in all resources.
```APIDOC
## resource_down()
### Description
Gets the number of operators that are currently in down time in all resources.
### Parameters
None.
### Returns
- The number of operators currently in down time in all resources.
```
--------------------------------
### ResidenceTime_kurt()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the excess kurtosis of the residence times over all clients.
```APIDOC
## ResidenceTime_kurt()
### Description
Gets the excess kurtosis of the residence times over all clients.
### Function Signature
ResidenceTime_kurt()
### Parameters
None.
### Return Value
- The excess kurtosis.
```
--------------------------------
### JavaScript for initializing a 3D model viewer
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/src/main/java/net/web/res/qs3d_en.html
Loads a model via ModelReader, displays its name, creates a Viewer3D instance with a fixed range and camera position, builds frame and scene, then starts rendering. Also includes an interval that updates an info panel with FPS and camera coordinates every second.
```javascript
'use strict';
function resizeWindow() {
document.getElementById('viewerArea').style.height=window.innerHeight+'px';
}
resizeWindow();
var model=new ModelReader(qs_model);
var modelName=model.getAny(model.nodes,Language.xmlModelName);
if (modelName!=null && typeof(modelName.xmlcontent)!='undefined') document.getElementById('viewerTitle').innerHTML=modelName.xmlcontent;
var modelSize=model.getModelSize();
var margin=2000;
var scale=3;
var rangeX=[-margin,modelSize[0]*scale+margin];
var rangeZ=[-margin,modelSize[1]*scale+margin];
var viewer=new Viewer3D(document.getElementById('viewerArea'),rangeX,[1,2000],rangeZ,[(rangeX[1]+rangeX[0])/2,500,rangeZ[1]]);
var frame=new FrameBuilder(viewer.scene,textureFloor,rangeX,rangeZ,3000);
var scene=new SceneBuilder(viewer.scene,model,scale);
frame.build();
scene.build();
viewer.addControls();
viewer.start();
resizeWindow();
setInterval(function(){
var p=viewer.camera.position;
var info="";
info+=Language.info1+"
"+Language.info2+"
"+Language.info3+"
";
info+=viewer.currentFPS+" fps; "+Language.infoCamera+": ("+Math.round(p.x/scale)+","+Math.round(p.z/scale)+")";
info+=" "+Language.infoHide+"";
document.getElementById("viewerInfo").innerHTML=info;
},1000);
```
--------------------------------
### ResidenceTime_cv()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the coefficient of variation of the residence times over all clients.
```APIDOC
## ResidenceTime_cv()
### Description
Gets the coefficient of variation of the residence times over all clients.
### Function Signature
ResidenceTime_cv()
### Parameters
None.
### Return Value
- The coefficient of variation.
```
--------------------------------
### Dockerfile for Warteschlangensimulator
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Scripts/docker/docker-sim.txt
Defines the container image for the simulator. It copies the application JAR and its libraries, then runs the server on port 8183.
```dockerfile
FROM eclipse-temurin:17
RUN mkdir /opt/app
COPY Simulator.jar /opt/app
RUN mkdir /opt/app/libs
COPY libs/*.jar /opt/app/libs/
WORKDIR /opt/app
CMD ["java", "-jar", "Simulator.jar","server","8183"]
EXPOSE 8183
```
--------------------------------
### ResidenceTime_median()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the median of the residence times over all clients, in seconds.
```APIDOC
## ResidenceTime_median()
### Description
Get the median of the residence times over all clients (in seconds).
### Function Signature
ResidenceTime_median()
### Parameters
None.
### Return Value
- The median residence time in seconds.
```
--------------------------------
### ProcessTime_kurt()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the excess kurtosis of the process times over all clients.
```APIDOC
## ProcessTime_kurt()
### Description
Gets the excess kurtosis of the process times over all clients.
### Parameters
None.
### Returns
- **number** - The excess kurtosis.
```
--------------------------------
### ProcessTime_cv()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the coefficient of variation of the process times over all clients.
```APIDOC
## ProcessTime_cv()
### Description
Gets the coefficient of variation of the process times over all clients.
### Parameters
None.
### Returns
- **number** - The coefficient of variation.
```
--------------------------------
### WarmUpKunde() / WarmUpClient() / isWarmUpClient()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets 0 or 1 depending on whether the client was generated during the warm-up phase (1) or not (0).
```APIDOC
## WarmUpKunde() / WarmUpClient() / isWarmUpClient()
### Description
Gets 0 or 1 depending on whether the client was generated during the warm-up phase (1) or not (0).
### Returns
0 or 1.
```
--------------------------------
### WIP_max() / Station_max() / N_max() / WIP_Maximum() / Station_Maximum() / N_Maximum()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the maximal number of clients in the system.
```APIDOC
## WIP_max() / Station_max() / N_max() / WIP_Maximum() / Station_Maximum() / N_Maximum()
### Description
Gets the maximal number of clients in the system.
### Method
Function call
### Endpoint
WIP_max() or Station_max() or N_max() or WIP_Maximum() or Station_Maximum() or N_Maximum()
### Parameters
None
### Returns
- **maximal number of clients** (integer) - The maximal number of clients in the system.
```
--------------------------------
### ProcessTime_median()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Get the median of the process times over all clients (in seconds).
```APIDOC
## ProcessTime_median()
### Description
Get the median of the process times over all clients (in seconds).
### Parameters
None.
### Returns
- **number** - The median process time in seconds.
```
--------------------------------
### NQ_var() / Queue_var() / Schlange_var() / Warteschlange_var() / NQ_Varianz() / Queue_Varianz() / Schlange_Varianz() / Warteschlange_Varianz()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the variation of the number of waiting clients in the system.
```APIDOC
## NQ_var() / Queue_var() / Schlange_var() / Warteschlange_var() / NQ_Varianz() / Queue_Varianz() / Schlange_Varianz() / Warteschlange_Varianz()
### Description
Gets the variation of the number of waiting clients in the system.
### Method
Function call
### Endpoint
NQ_var() or Queue_var() or Schlange_var() or Warteschlange_var() or NQ_Varianz() or Queue_Varianz() or Schlange_Varianz() or Warteschlange_Varianz()
### Parameters
None
### Returns
- **variation** (number) - The variation of the number of waiting clients in the system.
```
--------------------------------
### TransferTime_kurt()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the excess kurtosis of the transfer times over all clients.
```APIDOC
## TransferTime_kurt()
### Description
Gets the excess kurtosis of the transfer times over all clients.
### Function Signature
TransferTime_kurt()
### Parameters
None.
### Return Value
- **number** - The excess kurtosis.
```
--------------------------------
### TransferTime_cv()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the coefficient of variation of the transfer times over all clients.
```APIDOC
## TransferTime_cv()
### Description
Gets the coefficient of variation of the transfer times over all clients.
### Function Signature
TransferTime_cv()
### Parameters
None.
### Return Value
- **number** - The coefficient of variation.
```
--------------------------------
### TransferTime_median()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the median of the transfer times over all clients, in seconds.
```APIDOC
## TransferTime_median()
### Description
Gets the median of the transfer times over all clients (in seconds).
### Function Signature
TransferTime_median()
### Parameters
None.
### Return Value
- **number** - The median transfer time in seconds.
```
--------------------------------
### POST /v1/jobs.xml (Parameterize and simulate fixed model)
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/src/main/java/net/webcalc/res/index_info_en.html
Same as the JSON version but with XML response format.
```APIDOC
## POST /v1/jobs.xml (Post field name: "table")
### Description
This invocation assumes that the server is operated with a fixed specified model. A table is loaded and the data from the table is loaded into the model according to the settings in the defined model. The model parameterized in this way is simulated; the results are then available as in a normal simulation.
### Method
POST
### Endpoint
/v1/jobs.xml
### Parameters
#### Request Body (multipart/form-data)
- **table** (file) - Required - The CSV table file to upload.
### Request Example
curl.exe -X POST --form "table=@table.csv" /v1/jobs.xml
### Response
#### Success Response (200)
- **job_id** (string) - ID of the created job.
#### Response Example
{}
```
--------------------------------
### WIP_var() / Station_var() / N_var() / WIP_Varianz() / Station_Varianz() / N_Varianz()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the variation of the number of clients in the system.
```APIDOC
## WIP_var() / Station_var() / N_var() / WIP_Varianz() / Station_Varianz() / N_Varianz()
### Description
Gets the variation of the number of clients in the system.
### Method
Function call
### Endpoint
WIP_var() or Station_var() or N_var() or WIP_Varianz() or Station_Varianz() or N_Varianz()
### Parameters
None
### Returns
- **variation** (number) - The variation of the number of clients in the system.
```
--------------------------------
### WaitingTime_kurt()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the excess kurtosis of the waiting times over all clients.
```APIDOC
## WaitingTime_kurt()
### Description
Gets the excess kurtosis of the waiting times over all clients.
### Parameters
None.
### Returns
- **number** - The excess kurtosis.
```
--------------------------------
### SystemInterface Base Functions
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/src/main/java/ui/help/pages_en/Java.html
Core methods for retrieving simulation time, evaluating expressions, checking warm-up status, accessing local and global maps, controlling animation, and terminating the simulation.
```APIDOC
## SystemInterface Base Functions
### Description
These methods provide fundamental access to the simulation state and control.
### Methods
#### double getTime()
- **Description**: Gets the current time in the simulation as a seconds numerical value.
- **Returns**: double - Current simulation time in seconds.
#### Object calc(final String expression)
- **Description**: Calculates the expression passed as a string using the term evaluation function, which supports probability distributions, Erlang C calculator, etc. Returns the result as a Double, or an error message as a string if calculation fails.
- **Parameters**:
- expression (String) - Required - The expression to evaluate.
- **Returns**: Object - Double result or String error message.
#### boolean isWarmUp()
- **Description**: Returns true if the simulation is in the warm-up phase, false otherwise.
- **Returns**: boolean - Warm-up status.
#### Map getMapLocal()
- **Description**: Returns a station-local mapping for reading and writing values. Values persist beyond the current script execution.
- **Returns**: Map - Local map.
#### Map getMapGlobal()
- **Description**: Returns a model-wide mapping for reading and writing values. Values persist beyond the current script execution.
- **Returns**: Map - Global map.
#### void pauseAnimation()
- **Description**: Switches the animation to single step mode. No effect if already in single step mode or if running as a simulation.
#### void terminateSimulation(final String message)
- **Description**: Terminates the simulation. If message is null, terminates normally; otherwise terminates with the given error message.
- **Parameters**:
- message (String) - Optional - Error message or null for normal termination.
```
--------------------------------
### WaitingTime_cv()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the coefficient of variation of the waiting times over all clients.
```APIDOC
## WaitingTime_cv()
### Description
Gets the coefficient of variation of the waiting times over all clients.
### Parameters
None.
### Returns
- **number** - The coefficient of variation.
```
--------------------------------
### NQ_min(id) / Queue_min(id) / Schlange_min(id) / Warteschlange_min(id) / NQ_Minimum(id) / Queue_Minimum(id) / Schlange_Minimum(id) / Warteschlange_Minimum(id)
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the minimal number of clients in the queue at station id.
```APIDOC
## NQ_min(id) / Queue_min(id) / Schlange_min(id) / Warteschlange_min(id) / NQ_Minimum(id) / Queue_Minimum(id) / Schlange_Minimum(id) / Warteschlange_Minimum(id)
### Description
Gets the minimal number of clients in the queue at station id.
### Parameters
- **id** - Required - The station identifier.
### Returns
- The minimal number of clients in the queue at the specified station.
```
--------------------------------
### WaitingTime_max()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the maximum waiting time over all clients in seconds.
```APIDOC
## WaitingTime_max()
### Description
Get the maximum waiting time over all clients (in seconds).
### Parameters
None.
### Returns
- **number** - The maximum waiting time in seconds.
```
--------------------------------
### WaitingTime_min()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the minimum waiting time over all clients in seconds.
```APIDOC
## WaitingTime_min()
### Description
Get the minimum waiting time over all clients (in seconds).
### Parameters
None.
### Returns
- **number** - The minimum waiting time in seconds.
```
--------------------------------
### KundeInStatistik() / ClientInStatistics() / isClientInStatistics()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets 0 or 1 depending on whether the client is to be recorded in the statistics (1) or not (0). Additionally the client has to be generated after the warm-up phase to be actually recorded.
```APIDOC
## KundeInStatistik() / ClientInStatistics() / isClientInStatistics()
### Description
Gets 0 or 1 depending on whether the client is to be recorded in the statistics (1) or not (0). Additionally the client has to be generated after the warm-up phase to be actually recorded.
### Returns
0 or 1.
```
--------------------------------
### WaitingTime_median()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the median of the waiting times over all clients in seconds.
```APIDOC
## WaitingTime_median()
### Description
Get the median of the waiting times over all clients (in seconds).
### Parameters
None.
### Returns
- **number** - The median waiting time in seconds.
```
--------------------------------
### POST /v1/jobs.json (Parameterize and simulate fixed model)
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/src/main/java/net/webcalc/res/index_info_en.html
Assumes the server is operated with a fixed model. Uploads a table (CSV) to parameterize the model and runs the simulation.
```APIDOC
## POST /v1/jobs.json (Post field name: "table")
### Description
This invocation assumes that the server is operated with a fixed specified model. A table is loaded and the data from the table is loaded into the model according to the settings in the defined model. The model parameterized in this way is simulated; the results are then available as in a normal simulation.
### Method
POST
### Endpoint
/v1/jobs.json
### Parameters
#### Request Body (multipart/form-data)
- **table** (file) - Required - The CSV table file to upload.
### Request Example
curl.exe -X POST --form "table=@table.csv" /v1/jobs.json
### Response
#### Success Response (200)
- **job_id** (string) - ID of the created job.
#### Response Example
{}
```
--------------------------------
### WaitingTime_avg()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the average waiting time over all clients in seconds.
```APIDOC
## WaitingTime_avg()
### Description
Get the average waiting time over all clients (in seconds).
### Parameters
None.
### Returns
- **number** - The average waiting time in seconds.
```
--------------------------------
### NQ() / Queue() / Schlange() / Warteschlange()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the current total number of waiting clients in the system.
```APIDOC
## NQ() / Queue() / Schlange() / Warteschlange()
### Description
Gets the current total number of waiting clients in the system.
### Method
Function call
### Endpoint
NQ() or Queue() or Schlange() or Warteschlange()
### Parameters
None
### Returns
- **current total number of waiting clients** (integer) - The current total number of waiting clients in the system.
```
--------------------------------
### ClientInterface Methods
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/ScriptingJava.tex
All methods available on the ClientInterface object, accessible via sim.getClient().
```APIDOC
## ClientInterface Methods
### Description
Provides access to client data during simulation. Only available when execution is triggered by a client.
### Methods
#### Object calc(final String expression)
Calculates the expression using the term evaluation function. Returns a Double result or an error message string if calculation fails.
#### String getTypeName()
Returns the name of the type of the client that triggered the script processing.
#### String[] getBatchTypeNames()
Returns the names of the types of clients in the temporary batch that triggered the script. Returns an empty list if the current client is not a temporary batch.
#### int getSourceStationID()
Returns the ID of the station where the current client was created or assigned its current type.
#### boolean isWarmUp()
Returns true if the current client was generated during the warm-up phase and will not be recorded in statistics.
#### boolean isInStatistics()
Returns true if the current client is to be recorded in statistics. Independent of warm-up phase.
#### void setInStatistics(final boolean inStatistics)
Sets whether the client is to be recorded in statistics. Independent of warm-up phase.
#### long getNumber()
Returns the 1-based consecutive number of the current client. Thread local when using multiple simulation threads.
#### double getWaitingSeconds()
Gets the current waiting time of the client in seconds.
#### String getWaitingTime()
Gets the current waiting time of the client as a formatted time string.
#### void setWaitingSeconds(final double seconds)
Sets the current waiting time of the client.
#### double getTransferSeconds()
Gets the current transfer time of the client in seconds.
#### String getTransferTime()
Gets the current transfer time of the client as a formatted time string.
#### void setTransferSeconds(final double seconds)
Sets the current transfer time of the client.
#### double getProcessSeconds()
Gets the current processing time of the client in seconds.
#### String getProcessTime()
Gets the current processing time of the client as a formatted time string.
#### void setProcessSeconds(final double seconds)
Sets the current processing time of the client.
#### double getResidenceSeconds()
Gets the current residence time of the client in seconds.
#### String getResidenceTime()
Gets the current residence time of the client as a formatted time string.
#### void setResidenceSeconds(final double seconds)
Sets the current residence time of the client.
#### double getValue(final int index)
Gets the numerical value stored for the current client at the given index.
#### void setValue(final int index, final int value)
Sets the value for the given index for the current client.
#### void setValue(final int index, final double value)
Sets the value for the given index for the current client.
#### void setValue(final int index, final String value)
Sets the value for the given index for the current client. The string is interpreted by calc() before assigning.
#### String getText(final String key)
Gets the string stored for the current client under the given key.
#### void setText(final String key, final String value)
Sets the string value for the given key for the current client.
#### double[] getAllValues()
Returns all numerical values stored for the current client.
#### Map getAllTexts()
Returns all text values stored for the current client.
```
--------------------------------
### costs_process_avg() / costs_process_average()
Source: https://github.com/a-herzog/warteschlangensimulator/blob/master/Simulator/build/Help/Scripting/en/Calculation2.tex
Gets the average process time costs of all clients.
```APIDOC
## costs_process_avg() / costs_process_average()
### Description
Gets the average process time costs of all clients.
### Returns
- The average process time costs for all clients.
```