The exponential distribution is used to model events that occur randomly but with a decreasing probability over time. It is ideal for situations such as waiting times, system failures, or random arrivals where something is most likely to occur early, and becomes less likely the longer it takes.
A classic example: "If you are waiting to be served, it is more likely to happen soon; and each additional minute reduces that probability."
This is not well represented by a uniform distribution (such as ADVANCE 10,5), but it is by an exponential function, defined with the type:
Function {name:efun1, type:"EXP", a:100, b:20, lambda:0.3, intervals:100}
Parameters
a: Curve height (visual only; it does not affect the calculation).
b: Base minimum value. This is the point from which the distribution starts.
lambda: Decay rate. The higher the lambda, the faster the decay.
intervals: Number of segments into which the curve is divided (the more, the more precise).
Approximately, 99.9% of the values will lie within the range:
λ = 1 → from b to b + 6.91
λ = 0.5 → from b to b + 13.82
λ = 2 → from b to b + 3.45
Comparative usage example:
Function {Name:efun1, type:"EXP", a:100, b:20, lambda:0.3, intervals:70}
Function {Name:efun2, type:"EXP", a:100, b:20, lambda:0.6, intervals:70}
Function {Name:efun3, type:"EXP", a:100, b:20, lambda:1.0, intervals:70}
ADVANCE FN$efun1 ; slow decay
ADVANCE FN$efun2 ; medium decay
ADVANCE FN$efun3 ; fast decay
Example
/*
Exponential
*/
SYSTEM {TYPE:OPTIONS, Speed:5}
;=== Facilities with statistical tracking ===
Facility {NAME:VENTANILLA1,X:165,Y:184,E_BIN_start:5,E_BIN_SIZE:1,E_BIN_COUNT:80,capacity:10}
Facility {NAME:VENTANILLA2,X:343,Y:185,E_BIN_start:5,E_BIN_SIZE:1,E_BIN_COUNT:80,capacity:10}
Facility {NAME:VENTANILLA3,X:535,Y:183,E_BIN_start:5,E_BIN_SIZE:1,E_BIN_COUNT:80,capacity:10}
;=== Final positions for visualization ===
POSITION {NAME:POS1, X:250, Y:381}
POSITION {NAME:POS2, X:423, Y:383}
POSITION {NAME:POS3, X:566, Y:384}
;=== EFunctions with different decay rates ===
Function {Name:efun1, TYPE:EXP, a:100, b:20, Lambda:0.3, Intervals:70}
Function {Name:efun2, TYPE:EXP, a:100, b:20, Lambda:0.6, Intervals:70}
Function {Name:efun3, TYPE:EXP, a:100, b:20, Lambda:1.0, Intervals:70}
;=== Simulation start ===
START 500
;=== Entity flow through the three service windows ===
GENERATE 10,0,0,0 {NAME:GEN1, X:91, Y:383}
; WINDOW 1 – Slow decay
ADVANCE 20,4 {TO:VENTANILLA1}
SEIZE VENTANILLA1
ADVANCE FN$efun1
RELEASE VENTANILLA1
ADVANCE 20,0 {TO:POS1}
; WINDOW 2 – Medium decay
ADVANCE 20,0 {TO:VENTANILLA2}
SEIZE VENTANILLA2
ADVANCE FN$efun2
RELEASE VENTANILLA2
ADVANCE 20,0 {TO:POS2}
; WINDOW 3 – Fast decay
ADVANCE 20,0 {TO:VENTANILLA3}
SEIZE VENTANILLA3
ADVANCE FN$efun3
RELEASE VENTANILLA3
ADVANCE 20,0 {TO:POS3}
ENDGENERATE 1