init (predefined name)
When you start the simulation of a reset model, the first event to be executed always is the Init event. Among others Plant Simulation then executes all methods named init within the current simulation model.
Compare this example:
Click in the EventController to open the List of scheduled events. You’ll see the first event to be processed is the init event.
When you click , Plant Simulation processes the event and proceeds to the next one.
Compare the examples below to get an idea of what you can accomplish in an init method.
To start reducing the availability of the machine after 12 hours have been simulated, create an init method, and enter the following source code.
&setFailure.methCall(str_to_time("12:0:0"))
To create and insert a Transporter on a Track, you can use the SimTalk method create, create an init method, and enter the following source code:
.MUs.Transporter.create(Track) -- inserts a Transporter anywhere on the Track
.MUs.Transporter.create(Track, 5.5) -- inserts a Transporter 5.5 meters along the length of the Track
To reopen the Entrance and the Exit of a station, create a user-defined attribute of data type method for this station and name it init. Then, and enter the following source code:
self.~.EntranceLocked := false
self.~.ExitLocked := false
Related Topics
Init control of the EventController
Init control of the Transporter
Init control of the WorkerPool
Go to Init Methods and Init Controls
Go to Call Sequence of the Init Controls
Go to Call Sequence of the Init Methods