question

Kari Payton avatar image
0 Likes"
Kari Payton asked jing.c commented

Pull from a list based on sum of label values.

I have a shipping truck that can only carry 8 tons. I have items on a list with label for the weight (last column). When I pull the items is there a way I can limit it to pull less than 8 tons in total?

FlexSim 17.2.3
process flowlists
5 |100000

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

Jordan Johnson avatar image
3 Likes"
Jordan Johnson answered jing.c commented

I don't know of a way to do that within the pull query. The closest thing I can think of is to put a Zone around the Push to List activity. You can use the Zone Subsets to limit the total label amount in the Zone, which will consequently limit the amount on the list.

zoneandlist-1.fsm


zoneandlist.png (15.5 KiB)
zoneandlist-1.fsm (21.1 KiB)
· 5
5 |100000

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

Kari Payton avatar image Kari Payton commented ·

@jordan.johnson

Well the item container can hold 20,000 kg so I can't limit the items pushed to the list. I can only limit the amount (kg) that can be pulled (5,000 kg)

0 Likes 0 ·
Kari Payton avatar image Kari Payton commented ·

@jordan.johnson I used the zone subset but also added preemption to push items to another list and pull only those items that were allowed to enter the zone. Probably made it more complicated than it had to be but it works. Anyway, thanks for the insight.

0 Likes 0 ·
jing.c avatar image jing.c commented ·

hi, @jordan.johnson

Would you please tell me what's meaning is the "1e12" in RequestNumber of Pull from List activity? I guess it means no limit token it will pull from the list, but I'm not sure~

0 Likes 0 ·
Jordan Johnson avatar image Jordan Johnson ♦♦ jing.c commented ·

FlexScript allows scientific notation. 1e12 is scientific notation for 1x10^12, making 1 trillion. I could also have typed 1000000000000. There isn't a magic number for pulling everything off the list, but 1e12 is so big that it usually works.

1 Like 1 ·
jing.c avatar image jing.c Jordan Johnson ♦♦ commented ·

Many thanks~

0 Likes 0 ·
Raja Sekaran avatar image
4 Likes"
Raja Sekaran answered Kari Payton commented

Hi @Kari Payton,

I have attached the sample models.

In the first attachment, Track the running total with the help of Track Number Fields Total.

Then add Expression field to the list and Track the Total Field Value(Weight).

In the List entries, the result of the expression field(CalculateTotalweight) will be like as the pic below.

Then, use the query in the Pull from the list as the pic below.

In the second attachment, I have used the SELECT clause to pulling the things from the list and also specify theTruck Capacity in the Request number and Require Number field. But It allows you to pull things from the list using fluid-like request quantities, instead of discrete entries on the list.

attachment-1.fsm

attachment-2.fsm

I hope this will help you.

Thanks


· 5
5 |100000

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

Kari Payton avatar image Kari Payton commented ·

@Raja Sekaran

I really appreciate your models and feedback. Really nice... They both work great on the first delivery. However, when I send the truck again to do a pickup I get errors.

In the second scenario, it works perfectly but I get an error because the items disappear if the truck only picks up some of the weight. For example it an item is 150 but the truck capacity is 100, there will be 50 left on the list. This is perfect but then on the list the item shows up as "0x0". Then on the next pickup, i get profiletasksequence error because the item has been deleted in the sink. I tried recycling flowitems in the sink but that doesn't work either.

In the first sceanio the calculation doesn't update when an item is taken off the list.

0 Likes 0 ·
Raja Sekaran avatar image Raja Sekaran Kari Payton commented ·

In the first attachment, In order update the total, I have removed the all entries from the list and re add it to the list again before pulling things from the list. You can find two activities (Remove from List and Re-add it to list) in the first attachment. These two activities will update the calculated value when you send the truck again for pickup.

0 Likes 0 ·
Kari Payton avatar image Kari Payton Raja Sekaran commented ·

@Raja Sekaran

Here's example of what's happening. I changed the weight to 5 to show it clearer.

It's correct here before the pulls.

After only 1 item is pulled. It doesn't update the calculated total weight.

0 Likes 0 ·
correctcalc.png (23.2 KiB)
wrongtotal.png (32.2 KiB)
Show more comments