Page 236 - ExtendSim User Guide
P. 236

Batching and Unbatching
BatchQuantityIn connectors
Checking Use quantity input connectors on the Batch block’s Options tab enables the BatchQuantityIn variable connector. Each BatchQuantityIn value input connector corresponds to an item input connector and controls the batch size for that item connector. If a value input connector has been connected, it will set the number of items required at its adjacent item input connector. If a value input connector is not connected, the number of items for the adjacent item connector will be set by the value in the Batch dialog.
When Use quantity input connectors is checked, there are two options that affect the batch size. With either option, the initial size of the batch is the value at the BatchQuantityIn con- nector when the first item on its corresponding item input connector arrives to the Batch block. The options determine what happens if the input value changes:
• Dynamicallyasbatchiscreated.IfthevalueataBatchQuantityInconnectorchangesbefore that item connector’s batch is released, the number of items required for that batch will change as well. This enables the size of a batch to be changed dynamically.
☞ The number of items to be batched from each input connector can never be less than the num- ber of items that have already arrived to the block from that input. That is, if 10 items have already been pulled in through an item input connector, and the BatchQuantityIn connector changes to 8, the batch size for that item input connector will be set to 10, not 8.
• By first item at each connector. The size of the batch does not change after the first item for the batch has arrived, even if the value of the BatchQuantityIn connector changes. Once that batch is released, a new batch size can be set.
The demand connector
To enable the demand connector, check the Show demand connector box in the Batch block’s Options tab. Then choose one of the following options:
• Startbatchwhenvalueatdemand0.5.NoitemsarebroughtintotheBatchblockuntilthe value of the demand connector equals or exceeds 0.5. For instance, while the Batch block sees a 0 at demand, no items will enter for batching. When it sees a 1 at demand, the required items currently available will enter the Batch block to be joined together. Depending on how the model is constructed, selecting this behavior can cause blocking of upstream items.
• Createbatchwhenvalueatdemand0.5.ItemsareallowedintotheBatchblockastheyare available, up to the required number. However, the batched item will not leave the block as long as the demand connector has a value < 0.5. When the demand connector becomes 0.5, the batched item leaves the block. With this option, a batch can consist of fewer items than the number in the Quantity Needed column, because the batched item will have been created by joining whichever items were available when the demand connector got a value 0.5.
A value output connected to the Batch block’s demand input is used as a true/false indicator, triggering batching. The actual value from the value connector is ignored; what is considered is whether or not it equals or exceeds 0.5.
Simple batching
The simplest batching method is to cause multiple items to be joined as one new item, replac- ing the original items in the model. The batched item may or may not be unbatched at a later point, depending on model requirements.
Discrete Event

   234   235   236   237   238