Order
General Action Statement
The Order statement creates a specified number of Entities and sends them to a specific Location. Use the Order statement to replenish inventories or to order special parts when particular conditions occur.
Syntax
Order <expression> <entity> {TO <location>}
Syntax Examples
Order 10 EntA TO Loc2
Order Order_Qty_Attr Ent(Entity_Attr) TO Loc(Loc_Attr)
Parameters
<expression>
The number of new Entities to order. This field is evaluated every time the Order statement is encountered, allowing the number ordered to vary as the simulation progresses.
<entity>
The new Entity's name. Ent() may be used for an Entity name.
<location>
The new Entities' destination. Loc() may be substituted for the Location names. If no Location is specified, the Order statement Location is used. There must be a Flow path for the created Entity type that leads to the desired Location, but the Entity may skip steps in the Flow path to reach the specified Location.
Parameter Examples
Suppose your model creates and sells Bicycle Entities. You want to produce all the Bicycles you sell yourself since it is less costly, but since business has been so good lately, you frequently run out of stock. Since you never want your store to be out of stock, you arrange to buy more Bicycle Entities from another manufacturer every time your store inventory gets too low. To simulate this relationship, you first define a Variable to represent the store portion's inventory, vInventory. Next, define the statement...
Inc vInventory
...at the Shelving Location where the Bicycles are kept in the store, and the statement...
Dec vInventory
...at the FrontDesk Location where the Bicycles are sold in order to keep track of how many Bicycles are currently in the model's store portion. Now, suppose you wanted to check your store's inventory to see if more Bicycle Entities need to be ordered every time a Customer Entity enters the store. You then define the statements...
{
If vInventory < 10 Then
Order 10 Bicycle To Shelving
IncEntCost 5
}
...in the Logic of the FrontDoor Location. Each time a Customer Entity enters the store, the If Then statement checks the vInventory value to see how many Bicycles are in the store. If there are less than 10 Bicycle Entities in the store, the Order statement orders a total of 10 Bicycle Entities and sends them to the Shelving Location. The IncEntCost statement increases the cost of the 10 Bicycle Entities that are created by 5 to simulate the extra cost of ordering from an outside manufacturer.
For more information on the statements used in this example, see Inc, Dec, IncEntCost, and If Then Statements.
Remarks
If the Location specified in the Order statement does not have enough capacity for all the new Entities, the excess Entities are destroyed.
Attributes from the creating Entity are copied to the resulting Entities.