Grouping
ProModel provides a variety of statements that allow you to group, obtain, and interact with model components. These statements allow you to control more precisely how Entities and Resources behave in your simulation.
Accum
The Accum statement accumulates, without consolidating, a specified amount of Entities at a Location. The Accum statement works like a gate to prevent Entities from passing and processed until a certain amount of them are gathered at the gate. Once the specified quantity has been accumulated, the gate opens and Entities are allowed to pass. Note that the Accum statement cannot be used in the Logic for Routes.
To use the Accum statement, add the syntax...
Accum <number>
where number
is the Entity quantity to accumulate.
Only positive numbers are accepted in this field.
If number is 0 or 1, the Accum statement is ignored.
If number is greater than the capacity of the Location where the statement is defined, the simulation stops with an error.
Accum Example
If you define the statement...
Accum 10
...at a packaging Location, the Entities at the Location do not begin packaging until a total of 10 Entities are in the packaging Location. Once 10 Entities have arrived at the packaging Location, the Entities begin packaging and can move on through the system.
Join
The Join statement identifies a base Entity and joins a specified quantity of a designated Entity type to the base Entity to create a new Entity. The Entity at the Location where the Join statement is executed becomes the base Entity, and the joining Entities must be routed to this Location using the If Join Routing Rule.
When the Join statement is executed, the base Entity waits at its current Location until the specified number of joining Entities have reached its Location. The joining Entities are joined with the base Entity to create a new Entity. The new Entity retains the Attributes of the base Entity, and so the Attributes of the joining Entities are lost. Any Resources owned by the joining Entities are transferred to the new Entity.
To use the Join statement, add the syntax...
Join <number> <Entity name>, <priority>
...where number
is the joining Entity quantity to add to the base Entity and Entity name
is the Entity name to join with the base Entity.
The priority
field is an optional part that defines base Entity's priority in regards to how quickly it receives its joining Entities.
Valid entries are between 1 and 999, and base Entities with a higher number in the priority field receive their joining Entities before base Entities with a lower number.
If the priority field is for all base Entities, they receive their joining Entities on a first come, first served basis.
Join Examples
Suppose you have a car factory model where the car's base and doors are manufactured separately before being joined together at the end of the process. Because the parts are created separately, you need two separate Entities on two different Flow branches: the Entity CarBase and the Entity CarDoor. Once the CarBase Entity is finished and reaches an assembly Location, you must define the statement...
Join 4 CarDoor
...in the assembly Location to indicate that the car's base needs four doors attached. Next, ensure that the CarDoor Entities were routed to the assembly Location using the If Join Routing Rule. The CarBase Entity waits at the assembly Location until four CarDoor Entities are completed and traveled to the assembly Location. The CarDoor Entities are joined onto the CarBase Entity, and the completed car travels to the end.
Additionally, suppose you upgrade to a bigger factory where you create both two-door and four-door car models. The four-door models are more popular, so you want to make sure that they are completed first, but you still only have one part of your factory creating doors. To make sure that the four-door models have the higher priority, define the statement...
Join 2 CarDoor, 1
...at the two-door assembly Location, and the statement...
Join 4 CarDoor, 2
...at the four-door assembly Location. These statements ensure a CarDoor Entity always tries to go to the four-door assembly Location first if it is able to, and only travels to the two-door assembly Location if there is no CarBase waiting for doors at the four-door assembly Location.
Get
The Get statement captures a specified Resource quantity as they become available and attaches them to an Entity. The Resources are then considered “owned” by the Entity. Use the Get statement to simulate a Resource helping to process an Entity.
To use the Get statement, add the syntax...
Get <quantity> <Resource name>, <priority>
...where quantity
is the number of Resource units to capture.
If the quantity field is blank, ProModel assumes that the quantity is 1.
Note that if the Entity at the Location or Route where the Get statement is defined already owns Resources of the requested type, the requested quantity is still added, which can cause problems if the Resource quantity is not high enough to satisfy the request.
Resource name
is the Resource to attach.
The priority
field is optional to define where the Entity is in regards to how quickly it receives its requested Resources.
Valid entries are between 1 and 999. Entities with a higher number receive Resources before Entities with a lower number.
If the priority field is blank for all Entities, they receive Resources on a first come, first served basis.
You may also use the statements And and Or together with the Get statement to reference multiple Resources.
Get <Resource name 1> And <Resource name 2>
Get <Resource name 1> Or <Resource name 2>
Note that if an Entity still owns a Resource when it leaves the system, the simulation stops with an error. For information on how to free an owned Resource, see Free.
Get Examples
If the statement...
Get Inspector
...is defined in an inspection Location, each Entity arriving at the Location requests one Inspector Resource. An available Inspector Resource travels to the Location (this is visible in the simulation if a Path Network is defined for it) and becomes “owned” by the Entity. It then travels with the Entity until it is freed.
Now, suppose there are two inspection Locations rather than one, and each Entity needs two Inspector Resources before it can move on, but you only have a total of three Inspector Resource units. In this case, define the statement...
Get 2 Inspector, 2
...at the most important inspection Location, and...
Get 2 Inspector, 1
...at the least important inspection Location. These statements ensure that an Entity requests two Inspectors when reaching either inspection Location, and the Inspectors always go to it first Location if both are requesting Inspectors.
If the Entities needed both an Inspector Resource and a Supervisor Resource before being processed, use the statement...
Get Inspector And Supervisor
If the Entities could use either an Inspector Resource or a Supervisor Resource to process, use the statement...
Get Inspector Or Supervisor
Whichever Resource was available first is used.
Free
The Free statement releases Resources owned by the Entity in the Location or Route where the Free statement is defined. Entities must have received Resources through a Get or Jointly Get statement in order for the Resources to be freed.
To use the Free statement, add the syntax...
Free <quantity> <Resource name>
...where quantity
is the Resource unit quantity to free.
If the quantity field is blank, ProModel assumes the quantity is 1.
You may use commas to free multiple Resources in the same Free statement.
Free <quantity> <Resource name 1>, <quantity> <Resource name 2>, <quantity> <Resource name 3>
You may also use the statement All to free all of the Resources that an Entity owns.
Free All
Free Examples
If an Entity owns an Inspector Resource and enters a Location where the statement...
Free Inspector
...is defined, the Inspector Resource is freed and the Entity no longer owns any Resources.
If instead the Entity owns five Inspector Resources and five Supervisor Resources, and encounters the statement...
Free 2 Inspector, 3 Supervisor
Two Inspectors and three Supervisors are released, and the Entity owns three Inspectors and two Supervisors. If this Entity then enters a Location with the statement...
Free All
...defined in its Logic, the three remaining Inspectors and two remaining Supervisors are released, and the Entity no longer owns any Resources.
Jointly Get
The Jointly Get statement captures a specified Resource quantity as they become available, and attaches them as a group to an Entity. The Resources is only captured when all requested Resources are available and can be captured as a group. The Resources is then considered “owned” by the Entity.
To use the Jointly Get statement, add the syntax...
Jointly Get <quantity> <Resource name>, <priority>
...where quantity
is the Resource unit quantity to capture.
If the quantity field is blank, ProModel assumes the quantity is 1.
Note that if the Entity at the Location or Route where the Jointly Get statement is defined already owns the requested Resource type, the requested quantity is still added, which can cause problems if if the Resource quantity is not high enough to satisfy the request.
Resource name
is the Resource to attach.
The priority
field is optional to define where the Entity is in regards to how quickly it receives its requested Resources.
Valid entries are between 1 and 999. Entities with a higher number in the priority field receive Resources before Entities with a lower number.
If the priority field is blank for all Entities, they receive Resources on a first come, first served basis.
You may also use the statements And and Or together with the Jointly Get statement to reference multiple Resources.
Jointly Get <Resource name 1> And <Resource name 2>
Jointly Get <Resource name 1> Or <Resource name 2>
Note that if an Entity still owns a Resource when it leaves the system, the simulation stops with an error. For more information on how to free an owned Resource, see Free.
Jointly Get Examples
If the statement...
Jointly Get 3 Inspector
...is defined in the inspection Location Logic, the Entities entering that Location request three Inspector Resources and remain at that Location until their request is fulfilled. No Inspectors is captured until a total of three Inspectors are available at the same time. Once three Inspector Resources are available, all three are captured at once and travel to the inspection Location (this is visible in the simulation if there is a Path Network defined for them). The Resources then become “owned” by the Entity and move with the Entity until they are freed.
Now, suppose you have two inspection Locations, InspecTable1 and InspecTable2, and you want InspecTable1 to have the higher priority when it comes to gathering the Inspector Resource. To do this, define the statement...
Jointly Get 3 Inspector, 2
...in the InspecTable1 Logic, and the statement...
Jointly Get 3 Inspector, 1
...in the InspecTable2 Logic. The values in the priority field ensure that Inspector Resources always travel to InspecTable1 in cases where both Locations are requesting Inspector Resources.
If the Entities at the inspection Locations needed both an Inspector and a Supervisor Resource to be processed, use the statement...
Jointly Get Inspector And Supervisor
Neither Resource is captured until both Resource types were available. If the Entities at the inspection Locations needed either three Inspector Resources or two Supervisor Resources to be processed, use the statement...
Jointly Get 3 Inspector Or 2 Supervisor
No Resources is captured until either three Inspectors are available or two Supervisors are available, and whichever condition is met first is used.
Split
The Split statement divides an Entity into a specified quantity of new Entities when it reaches a particular Location. Note that Split cannot be used in Routes Logic. Use the Split statement to simulate dividing raw materials into new components.
To use the Split statement, add the syntax...
Split <number> As <new Entity name>
...where number
is the new Entity quantity to split the old Entity to split into, and new Entity name
is the new Entity type name that the old Entity splits into.
Note that new Entity name must be defined on the Simulation Browser's Entities tab.
The name must also be different from the old Entity; you cannot use the Split statement to split an Entity into more versions of itself.
Note also that when you use the Split statement at a Location, the Location must provide a separate Flow for the new Entity type to follow.
When the old Entity splits into the new Entity types, the total old Entity cost at that time in the simulation is evenly distributed among the new Entities. The new Entities retain the old Entity Attributes. Note that the old Entity must release any of the Resources it owns using the Free statement before being split, since Resources cannot be passed on to new Entities through a Split statement.
Split Example
Suppose you have two Entity types defined in your Simulation Browser: Log and WoodChip, and you want to split the Log Entity into multiple WoodChip Entities when it reaches the Woodchipper Location. To do this, define the statement...
Split 100 As WoodChip
...in the Woodchipper Location Logic. A Flow can then be created from the system's beginning to the Woodchipper Location that the Log Entity can follow. Since the Log Entity is completely used up at the Woodchipper Location, the Log Flow can end there. Another Flow for the WoodChip Entities can then be created to take them from the Woodchipper Location to the end.
Every time a Log Entity reaches the Woodchipper Location, it is split into 100 WoodChip Entities. If the total Log Entity cost is 100 when it reaches the Woodchipper Location, each Woodchip Entity has a 1 cost.
Load and Unload
The Load statement identifies a base Entity and “loads” a specified Entity quantity onto it. The Entity at the Location where the Load statement is executed becomes the base Entity, and the loading Entities must be routed to this Location using the If Load Routing Rule.
When the Load statement is executed, the base Entity waits at its current Location until the specified loading Entity quantity has reached its Location. The loading Entities are then loaded onto the base Entity. Temporarily loaded Entities retain their identity and may be unloaded with an Unload statement.
You also have the option to permanently load Entities onto the base Entity using the optional Perm statement. Permanently loaded Entities do not retain their identity and cannot be unloaded later.
If a base Entity owns a Resource when the Entities are unloaded, the Resource stays with the base Entity. Any Resources owned by permanently loading Entities are transferred automatically to the base Entity. Any Resources owned by temporary loading Entities are kept and cannot be freed until the Entities are unloaded.
To use the Load statement, add the syntax...
Load <number> Perm Iff <Boolean expression> IN <time>, <priority>
...where number
is the amount of loading Entities to load onto the base Entity.
If the number field is blank, ProModel assumes the number is 1.
Perm
is optional to load Entities permanently onto the base Entity rather than temporarily loaded.
The Iff
statement is also optional to add a condition to your Load statement without having to create a separate If Then statement.
If the Iff field is included, the Load statement only executes when the condition of the Boolean expression is met.
The IN
statement and time
field are also optional.
The IN statement allows specifies how long the loading takes based on the time field value.
The priority
field is optional to define where the Entity is in regards to how quickly it receives its loading Entities.
Valid entries are between 1 and 999. Base Entities with a higher number receive loading Entities before base Entities with a lower number.
If the priority field is blank for all base Entities, they receive loading Entities on a first come, first served basis.
The Unload statement is used to unload the temporarily loaded Entities from your base Entity. Once Entities are unloaded, they proceed ahead of the base Entity. Note that unloaded Entities must have a Flow path defined for them, or a Flow set to All that they can follow once they are unloaded.
To use the Unload statement, add the syntax...
Unload <number> Iff <Boolean expression>
...where number
is the temporarily loaded Entity quantity to unload.
If the number field is blank, ProModel assumes the number is 1.
The Iff statement is optional to add a condition to your Unload statement without having to create a separate If Then statement. If the Iff field is included, the Unload statement only executes if the Boolean expression condition is met.
Load and Unload Examples
Suppose you want to load a collection of 10 Package Entities onto a Truck Entity to travel to another part of your model. First, route the Package Entities from their Location to the Parking Location where the Truck Entity is waiting using the If Load Routing Rule. Next, define the statement...
Load 10
...in the Parking Location Logic. The Package Entities then waits at their Location per the If Load Routing Rule until a Truck Entity arrives at the Parking Location, executing the Load statement. 10 Package Entities then travel to the Parking Location and load onto the Truck Entity.
Now, suppose that you want to unload all of the Package Entities from the Truck once they reach a Warehouse Location. To do this, define the statement...
Unload 10
...in the Warehouse Location Logic.
Group and Ungroup
The Group statement accumulates and temporarily consolidate a specified Entity quantity into a single Group shell Entity. The shell Entity retains the same Attributes as the first Entity grouped into the shell. However, you also have the option to use a Group As statement, which creates a new shell Entity without Attribute values, even if the same name is used for the Group shell Entity.
When using a Group statement, the individual Entities comprising the group retain their identities, Attributes, and Resources, and are divided from the group when an Ungroup statement is encountered. The first Entity processed from the group takes any Resources the group owns. Entities in a group can be grouped into a larger group at another Location.
To use the Group statement, add the syntax...
Group <number> As <Entity name>
...where number
is the Entity quantity to include in your group.
The As
statement is optional to consider the Group shell Entity a new Entity, defined by the Entity name
field.
The Ungroup statement separates Entities that were grouped by a Group statement.
To use the Ungroup statement, add the syntax...
Ungroup LIFO
...where LIFO
is optional and stands for Last In First Out.
Use LIFO to ungroup Entities in the opposite order that they were grouped in.
Group and Ungroup Examples
Suppose you have a model that produces and sells Egg Entities. Once the Eggs have been gathered, they move to a Packaging Location before being sold. At the Packaging Location, you want to group 12 Egg Entities into a Carton Entity. To achieve this result, define the statement...
Group 12 As Carton
...in the Packaging Location Logic.
Now suppose that once your Carton Entities reach your Store Location, you want to ungroup some to use as samples in your Store. To ungroup the Carton Entities back into individual Egg Entities, define the statement...
Ungroup
...in the Store Location Logic.
Combine
The Combine statement accumulates and consolidates a specified Entity quantity into an Entity, optionally with a different name. Unlike the Group statement, combined Entities lose their identities and Attributes, and cannot be ungrouped later. Use Combine when several Entities need to be combined, such as when eight spark plugs are combined in a box. Note that after several Entities have been combined at a Location, no additional statistics are collected for any of the combined Entities at that Location.
To use the Combine statement, add the syntax...
Combine <expression> {As <new entity name>}
...where expression
is the Entity quantity to combine.
Negative values generate an error message.
If this expression evaluates to zero, it is ignored.
If it evaluates to one, then no Entities are actually combined, but the Entity that encountered the combine statement is renamed (if the As option has been specified).
This expression is evaluated every time an Entity encounters the Combine statement, so the amount of Entities to combine can vary as the simulation progresses. If an Entity arrives that changes this expression to a number lower than the Entities already waiting to combine, all of the waiting Entities are combined, including the Entity that just arrived.
The As <new entity name>
field is the optional name of the resulting Entity.
If left off, the new Entity has the same name as the last combined Entity or the output Entity name.
When specifying Combine <expression> AS <new entity name>
in the operation logic, there must be another operating block at the same Location.
In this case, the incoming Entity at the new operating block is the new Entity name specified in the Combine statement.
Note that Combine passes cost on to new Entities but not statistical information. ProModel counts combined Entities as exits.