Actions associated with events, transitions, process flowchart objects, agents, controls, etc. in AnyLogic are written in Java code. Java code is composed of statements. Statement is a unit of code, an instruction provided to a computer. Statements are executed sequentially one after another and, generally, in top-down order. The following code of three statements, for example, declares a variable x, assigns it a random number drawn from a uniform distribution, and prints the value to the model log.
x = uniform();
traceln( "x = " x );
You may have noticed that there is a semicolon at the end of each statement. In Java this is a rule:
We will consider these types of Java statements: