question

Daniel Saravia avatar image
0 Likes"
Daniel Saravia asked Jeanette F commented

Problem with TS in PF after Batching?

Hello,

I have a PF the handles the loading of customer's vehicles by matching the order numbers on 2 different kind of flow items (customer vehicles and orders/boxes) I do have 2 kind of orders represented by a brown box (customers that notify their arrival) and a red box (customers that show up without notice). The flow items follow the same PF but I only can make the logic work for the brown boxes, so I don't know why the red boxes can't follow the logic.

Orders are sent to a list and them pull when the corresponding customer arrives (same order number). The customers are sent to a list too then pull by the PF as they arrive to a determined parking spot. I was able to run the SIM without sending the customers vehicles to a list but I changed to sync better the loading because sometimes the batching was done faster than the time the customer took to park their vehicle. @Logan Gold, @bill.nordgren, @Jörg Vogel


Thanks,

CPU_Waiting_Lot_autosave.fsm

FlexSim 20.2.3
processflowflexsim 20.2.3tasksequence
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jeanette F avatar image
0 Likes"
Jeanette F answered Jeanette F commented

Hello @Daniel Saravia,

When I examine the tokens for the red and brown boxes the only difference seems to be the array. The order that the array is filled is switched for the red boxes when compared to the brown boxes. I think this is because the order in which the tokens arrive decides what goes in the array first.

To fix this I added this code to your custom code activity before your code.

if (token.Type ==1){
    token.Arraypieces.reverse();
}
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Daniel Saravia avatar image Daniel Saravia commented ·

Thanks, that seems to work but the type 1 does not leave the parking spot (Type 0 works fine) which causes the TE to fail when all parking spot are taken. @Jeanette F

0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ Daniel Saravia commented ·

Hello @Daniel Saravia,

The batching activity does not keep all the labels of all the tokens. It appears it keeps the labels of the first token that arrives to be batched of the two tokens (and it will do the label aggregation). This means that the Type 1 tokens do not have the order label saved to it after the batch activity. To remedy this I created an order label on the Order tokens after they are created. Then in the batching activity I made the order label aggregate into an array. Then in the custom code activity after batching I have it sort through the array and correctly define the label order and item. Please reference the model attached.

I did not write the code by referencing the token type because there are a few tokens that do not arrive at the batch activity consistent with it's tokens of the same type. Instead I have the code check to write the code in intended order.

cpu-waiting-lot-autosave.fsm

0 Likes 0 ·