# Stochastic Modeling

A model can be stochastic as well as deterministic. There are many
different ways to incorporate nondeterminism into a model. For example,
you can assign a randomly generated time value to a transition, event
rate, or delay operation. Or a random value or its derivative can be
used to determine a message destination address, evaluate a guard
expression, or otherwise impact the model behavior.

#### Random serialization of simultaneous events

There is also a case when the model can have stochastic behavior,
even if you do not specify it explicitly using randomly generated
values: this is random serialization of simultaneous events. If several
events are available at the same time, AnyLogic can make
nondeterministic choice with equal probability for each
event. Otherwise,
the model behavior is deterministic and 100% reproducible irrespective
of the seed of the random number generator.

To turn random
serialization on

- In the Projects view,
select the experiment you are currently working with.
- Go to the Randomness
section of the Properties view.
- Select the option Random for the parameter Selection
mode for simultaneous events.

To enable conducting complicated experiments over stochastic models,
AnyLogic supports replication
mechanism. Please refer to the following help topics for more
information:

Optimizing
stochastic models