reset (predefined name)

Plant Simulation calls all methods in your model named reset, when you click Reset Simulation in the EventController. Plant Simulation also deletes all events from the List of scheduled events, sets the simulation time to 0, deletes statistics data and clears all failures.

Note:

executeIn calls do not work in reset methods, as the EventController deletes every scheduled event during the reset phase. You can use an init method instead to schedule events.

Compare the examples below to get an idea of what you can accomplish in a reset method.

  • To delete all parts in your simulation model, when you reset it, create a reset method and enter this source code:

    DeleteMovables
  • To reduce the simulation speed when you reset the model, create a reset method, enter this source code:

    EventController.Speed := 60

  • To reset the availability of the machine at the start of the next simulation run to one hundred percent, create a reset method and enter this source code:

    MyStation.Availability := 100

  • To delete the contents of a table when you reset the model, create a user-defined attribute of data type method for this table and name it reset. Then enter this source code:

    self.~.delete

  • To delete the contents of the DataTable named InventoryTable and reset the counter of the Variable named NextNumber to 1, create a reset method and enter this source code:

    InventoryTable.delete({0,1}..{*,*})
    NextNumber := 1
  • To delete the result numbers from the object Comment, create a reset method and enter this source code:

    Comment.Text := "MU Type, Lifetime"+chr(13)+chr(10)+"----------------------"
  • To reset the values shown in a Display Panel to 0 when you reset the model, create a user-defined attribute of data type method, name it reset and enter:

    self.~.PartsIn := 0
    self.~.PartsOut := 0

Call Order of the Reset and Init Methods

Plant Simulation always executes the init and reset methods of the objects in the reverse order in which you inserted them.

Within a Frame Plant Simulation always executes the init and reset methods of the Frame itself after executing the init and reset methods of all object which you inserted into it.

Note:

When you Cut (Ctrl+X) and Paste (Ctrl+V) an object, Plant Simulation cuts this object and inserts it anew thus changing the order in which the objects were inserted into the Frame.

Note:

When you change bring an object to the foreground our send it to the back in the Frame by clicking Bring to Front or Send to Back on the Icons ribbon tab of the Frame, this changes the order in which the objects were inserted into the Frame.

Note:

Plant Simulation treats reset methods, which you programmed in a Method object, and reset methods, which you attached to an object as a user-defined attribute or type method the same.

Related Topics

reset method of the EventController

init