<s>
A	O
discrete-event	B-General_Concept
simulation	I-General_Concept
(	O
DES	O
)	O
models	O
the	O
operation	O
of	O
a	O
system	O
as	O
a	O
(	O
discrete	O
)	O
sequence	O
of	O
events	O
in	O
time	O
.	O
</s>
<s>
Each	O
event	O
occurs	O
at	O
a	O
particular	O
instant	O
in	O
time	O
and	O
marks	O
a	O
change	O
of	O
state	B-Application
in	O
the	O
system	O
.	O
</s>
<s>
In	O
addition	O
to	O
next-event	O
time	O
progression	O
,	O
there	O
is	O
also	O
an	O
alternative	O
approach	O
,	O
called	O
incremental	O
time	O
progression	O
,	O
where	O
time	O
is	O
broken	O
up	O
into	O
small	O
time	O
slices	O
and	O
the	O
system	O
state	B-Application
is	O
updated	O
according	O
to	O
the	O
set	O
of	O
events/activities	O
happening	O
in	O
the	O
time	O
slice	O
.	O
</s>
<s>
Both	O
forms	O
of	O
DES	O
contrast	O
with	O
continuous	B-General_Concept
simulation	I-General_Concept
in	O
which	O
the	O
system	O
state	B-Application
is	O
changed	O
continuously	O
over	O
time	O
on	O
the	O
basis	O
of	O
a	O
set	O
of	O
differential	O
equations	O
defining	O
the	O
rates	O
of	O
change	O
of	O
state	B-Application
variables	O
.	O
</s>
<s>
A	O
common	O
exercise	O
in	O
learning	O
how	O
to	O
build	O
discrete-event	B-General_Concept
simulations	I-General_Concept
is	O
to	O
model	O
a	O
queueing	O
system	O
,	O
such	O
as	O
customers	O
arriving	O
at	O
a	O
bank	O
teller	O
to	O
be	O
served	O
by	O
a	O
clerk	O
.	O
</s>
<s>
When	O
a	O
Customer-Arrival	O
event	O
occurs	O
,	O
the	O
state	B-Application
variable	O
queue-length	O
is	O
incremented	O
by	O
1	O
,	O
and	O
if	O
the	O
state	B-Application
variable	O
teller-status	O
has	O
the	O
value	O
"	O
available	O
"	O
,	O
a	O
Service-Start	O
follow-up	O
event	O
is	O
scheduled	O
to	O
happen	O
without	O
any	O
delay	O
,	O
such	O
that	O
the	O
newly	O
arrived	O
customer	O
will	O
be	O
served	O
immediately	O
.	O
</s>
<s>
When	O
a	O
Service-Start	O
event	O
occurs	O
,	O
the	O
state	B-Application
variable	O
teller-status	O
is	O
set	O
to	O
"	O
busy	O
"	O
and	O
a	O
Service-End	O
follow-up	O
event	O
is	O
scheduled	O
with	O
a	O
delay	O
(	O
obtained	O
from	O
sampling	O
a	O
service-time	O
random	O
variable	O
)	O
.	O
</s>
<s>
When	O
a	O
Service-End	O
event	O
occurs	O
,	O
the	O
state	B-Application
variable	O
queue-length	O
is	O
decremented	O
by	O
1	O
(	O
representing	O
the	O
customer	O
's	O
departure	O
)	O
.	O
</s>
<s>
If	O
the	O
state	B-Application
variable	O
queue-length	O
is	O
still	O
greater	O
than	O
zero	O
,	O
a	O
Service-Start	O
follow-up	O
event	O
is	O
scheduled	O
to	O
happen	O
without	O
any	O
delay	O
.	O
</s>
<s>
Otherwise	O
,	O
the	O
state	B-Application
variable	O
teller-status	O
is	O
set	O
to	O
"	O
available	O
"	O
.	O
</s>
<s>
In	O
addition	O
to	O
the	O
logic	O
of	O
what	O
happens	O
when	O
system	O
events	O
occur	O
,	O
discrete	B-General_Concept
event	I-General_Concept
simulations	I-General_Concept
include	O
the	O
following	O
:	O
</s>
<s>
Priority	B-Application
queue	I-Application
,	O
</s>
<s>
A	O
system	O
state	B-Application
is	O
a	O
set	O
of	O
variables	O
that	O
captures	O
the	O
salient	O
properties	O
of	O
the	O
system	O
to	O
be	O
studied	O
.	O
</s>
<s>
The	O
state	B-Application
trajectory	O
over	O
time	O
S(t )	O
can	O
be	O
mathematically	O
represented	O
by	O
a	O
step	O
function	O
whose	O
value	O
can	O
change	O
whenever	O
an	O
event	O
occurs	O
.	O
</s>
<s>
In	O
discrete-event	B-General_Concept
simulations	I-General_Concept
,	O
as	O
opposed	O
to	O
continuous	B-General_Concept
simulations	I-General_Concept
,	O
time	O
'	O
hops	O
 '	O
because	O
events	O
are	O
instantaneous	O
–	O
the	O
clock	O
skips	O
to	O
the	O
next	O
event	O
start	O
time	O
as	O
the	O
simulation	O
proceeds	O
.	O
</s>
<s>
Single-threaded	B-Operating_System
simulation	O
engines	O
based	O
on	O
instantaneous	O
events	O
have	O
just	O
one	O
current	O
event	O
.	O
</s>
<s>
In	O
contrast	O
,	O
multi-threaded	B-Operating_System
simulation	O
engines	O
and	O
simulation	O
engines	O
supporting	O
an	O
interval-based	O
event	O
model	O
may	O
have	O
multiple	O
current	O
events	O
.	O
</s>
<s>
The	O
pending	O
event	O
set	O
is	O
typically	O
organized	O
as	O
a	O
priority	B-Application
queue	I-Application
,	O
sorted	B-Algorithm
by	O
event	O
time	O
.	O
</s>
<s>
Various	O
priority	B-Application
queue	I-Application
implementations	O
have	O
been	O
studied	O
in	O
the	O
context	O
of	O
discrete	B-General_Concept
event	I-General_Concept
simulation	I-General_Concept
;	O
alternatives	O
studied	O
have	O
included	O
splay	B-Data_Structure
trees	I-Data_Structure
,	O
skip	O
lists	O
,	O
calendar	B-Application
queues	I-Application
,	O
and	O
ladder	O
queues	O
.	O
</s>
<s>
On	O
massively-parallel	B-General_Concept
machines	I-General_Concept
,	O
such	O
as	O
multi-core	B-Architecture
or	O
many-core	B-General_Concept
CPUs	O
,	O
the	O
pending	O
event	O
set	O
can	O
be	O
implemented	O
by	O
relying	O
on	O
non-blocking	B-Operating_System
algorithms	I-Operating_System
,	O
in	O
order	O
to	O
reduce	O
the	O
cost	O
of	O
synchronization	O
among	O
the	O
concurrent	O
threads	B-Operating_System
.	O
</s>
<s>
This	O
is	O
accomplished	O
by	O
one	O
or	O
more	O
Pseudorandom	B-Algorithm
number	I-Algorithm
generators	I-Algorithm
.	O
</s>
<s>
One	O
of	O
the	O
problems	O
with	O
the	O
random	O
number	O
distributions	O
used	O
in	O
discrete-event	B-General_Concept
simulation	I-General_Concept
is	O
that	O
the	O
steady-state	O
distributions	O
of	O
event	O
times	O
may	O
not	O
be	O
known	O
in	O
advance	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
the	O
initial	O
set	O
of	O
events	O
placed	O
into	O
the	O
pending	O
event	O
set	O
will	O
not	O
have	O
arrival	O
times	O
representative	O
of	O
the	O
steady-state	O
distribution	O
.	O
</s>
<s>
This	O
problem	O
is	O
typically	O
solved	O
by	O
bootstrapping	B-Application
the	O
simulation	O
model	O
.	O
</s>
<s>
These	O
events	O
,	O
however	O
,	O
schedule	O
additional	O
events	O
,	O
and	O
with	O
time	O
,	O
the	O
distribution	O
of	O
event	O
times	O
approaches	O
its	O
steady	O
state	B-Application
.	O
</s>
<s>
This	O
is	O
called	O
bootstrapping	B-Application
the	O
simulation	O
model	O
.	O
</s>
<s>
In	O
gathering	O
statistics	B-Application
from	O
the	O
running	O
model	O
,	O
it	O
is	O
important	O
to	O
either	O
disregard	O
events	O
that	O
occur	O
before	O
the	O
steady	O
state	B-Application
is	O
reached	O
or	O
to	O
run	O
the	O
simulation	O
for	O
long	O
enough	O
that	O
the	O
bootstrapping	B-Application
behavior	O
is	O
overwhelmed	O
by	O
steady-state	O
behavior	O
.	O
</s>
<s>
(	O
This	O
use	O
of	O
the	O
term	O
bootstrapping	B-Application
can	O
be	O
contrasted	O
with	O
its	O
use	O
in	O
both	O
statistics	B-Application
and	O
computing	O
)	O
.	O
</s>
<s>
The	O
simulation	O
typically	O
keeps	O
track	O
of	O
the	O
system	O
's	O
statistics	B-Application
,	O
which	O
quantify	O
the	O
aspects	O
of	O
interest	O
.	O
</s>
<s>
Because	O
events	O
are	O
bootstrapped	O
,	O
theoretically	O
a	O
discrete-event	B-General_Concept
simulation	I-General_Concept
could	O
run	O
forever	O
.	O
</s>
<s>
Pidd	O
(	O
1998	O
)	O
has	O
proposed	O
the	O
three-phased	O
approach	O
to	O
discrete	B-General_Concept
event	I-General_Concept
simulation	I-General_Concept
.	O
</s>
<s>
Discrete	B-General_Concept
event	I-General_Concept
simulation	I-General_Concept
is	O
used	O
in	O
computer	O
network	O
to	O
simulate	O
new	O
protocols	O
,	O
different	O
system	O
architectures	O
(	O
distributed	O
,	O
hierarchical	O
,	O
centralised	O
,	O
P2P	O
)	O
before	O
actual	O
deployment	O
.	O
</s>
