Chapter 3: Modeling in Plant Simulation – Material Flow (I)
This chapter will introduce you to the modeling of material flow objects in Plant Simulation. After completing this chapter, you will be able to:
- Understand the modeling approach of Plant Simulation
- Know the difference between point-oriented and length-oriented modeling
- Create simulation models using material flow objects in Plant Simulation
- Run your simulation model
One of the main features of Plant Simulation is the object-oriented modeling approach. By using this approach, you can define the properties of an object in a class, create multiple instances of this class, and make use of the inheritance between the class and its instances. You can imagine a class as a template, whereas instances are individual objects that are created using this template. When you define the attributes of a class, they will be passed on to all instances created from this class. This means that if you modify the value of an attribute in the class object, the change will also be applied in all instance objects derived from this class. This is more efficient and less error-prone than having to change the same property for each individual instance object every time.
However, you can also assign the value of an attribute individually for an instance object. This will overwrite the derived attribute in this instance object and deactivate the inheritance from the class object. The overwritten attribute in the instance object influences neither the attribute in the class object nor the attribute in other instances of the class. On the other hand, any change you make in the class object will not be applied anymore to the instance object, in which the inheritance is deactivated. Plant Simulation provides a toggle button to activate and deactivate the inheritances for each attribute. An active inheritance is shown using this icon , while inactive inheritance is shown using this icon .
As mentioned in the previous chapter, we will refer to objects in the Class Library and the Toolbox as class objects. Objects that are inserted from the Class Library or the Toolbox into a Frame will be referred to as instance objects.
You can also define a new class object based on an existing class object in the Class Library. The Class Library provides the following methods to create a new class object from an existing class object:
- Right-click and select Duplicate
Duplicating a class object will create a new independent class object. All attributes of the existing class will be copied to the new class object, but the inheritance relations are severed.
- Right-click and select Derive
Deriving a class object will create a new class object and keep the inheritance relation between the new and the existing class object. The new class object represents a subclass of the existing class object. Any changes made in the attribute of the class will be passed on to the subclass, as long as the inheritance for this attribute is still active.
To show all objects derived from a class object, right-click on the class object in the Class Library and select Show Inheritance. In the example shown in the figure below, you can see that the WorkerBeginner class was derived from the Worker class and the inheritance relations between them are still active. On the contrary, the WorkerAdvanced class was duplicated from the Worker class and therefore is not shown in the inheritance structure.
You can also see which properties are inherited in the subclass. In this example, the value for the attributes Priority and Capacity in the WorkerBeginner class are inherited from the Worker class, while the value for the attributes Efficiency and Speed are overwritten.