question

Axel Kohonen avatar image
0 Likes"
Axel Kohonen asked Axel Kohonen edited

Use queue strategy for a resource in Process flow that is in numeric mode?

Hi,

I have a numeric resource in my process flow that is acquired at different phases of the process flow. I would like the acquire activities later down in the process flow to have a higher priority than the acquire activities at the start of the flow. Otherwise the tokens will get into the flow, but possibly never get out as new tokens entering reserve the resource first. I would not free the resource in between else, but there are other work phases in between when the first resource is not needed.

The solution would be to use the Queue strategy on the resource, but it seems that it is not possible when using numeric references.

See the attached model that illustrates the problem

20170814-queuestrategywithnumericresource.fsm

Any clue on if it is possible to use the queue strategy with numeric resources or how I can get around the problem?

Thank you!

Kind regards,

Axel

FlexSim 17.1.2
process flowresourcequeue strategynumeric reference
5 |100000

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

Matt Long avatar image
1 Like"
Matt Long answered Axel Kohonen edited

The numeric option for the Resource does not use a list, and so, you can't use a queue strategy. The numeric is just saying, I have x amount of something and the resource will decrement and increment that number as things acquire and release.

If you need to use a queue strategy I would suggest using an array instead of numeric. Set your Reference field to

[1, 1, 1, 1, 1]
or
[1, 2, 3, 4, 5]

With an array, it can push each value of the array to a list and the pull those numbers off the list when you acquire.

· 3
5 |100000

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

Axel Kohonen avatar image Axel Kohonen commented ·

Hi @Matt Long

This is what I was looking for. I tried to use the array, but I could not figure out how it worked and there wasn't much documentation on it at least not what I found.

However, only using the array with [1,2,3,4,5] worked (see image below). When I tried to use [1,1,1,1,1] it only allowed one resource to be acquired.

Thank you!

Axel

0 Likes 0 ·
arrayvalues.png (8.9 KiB)
Matt Long avatar image Matt Long Axel Kohonen commented ·

I'll see if I can update the documentation.

1 Like 1 ·
Axel Kohonen avatar image Axel Kohonen Matt Long commented ·

Great! Thank you!

0 Likes 0 ·
Kari Payton avatar image
1 Like"
Kari Payton answered Axel Kohonen commented

@Axel Kohonen

You can set a token label in process flow and assign a resource queue strategy to order by the label you created.

1. Create label called priorityLabel and assign number values in ascending order (most important = 1...least important = 3).

2. In the resource connect it to a 3D object. Go to it's advanced properties in the process flow. In the fields tab, create a label field "priorityLabel". In the back orders tab, Queue strategy: ORDER BY Puller.priorityLabel ASC.

You should see the tokens that acquire the 3rd time exist faster than how it was set up previously. 8055-20170814-queuestrategywithnumericresource.fsm


· 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 ·

Yeah I'm not sure the technical reasons why it's greyed out. Maybe @Sam Stubbs knows?

1 Like 1 ·
Axel Kohonen avatar image Axel Kohonen commented ·

Hi @Kari Payton

Thank you for your answer!

Do you know if it is possible to do it without connecting the resource to a 3D object? That is using reference "Numeric" as in the image below.

It seems that it is not possible as the queue strategy options are greyed out? Anyone from FlexSim who knows why so?

Thank you!

Kind regards,

Axel

0 Likes 0 ·
capture.png (4.9 KiB)
Sam Stubbs avatar image Sam Stubbs ♦ Axel Kohonen commented ·

It's because there's nothing to queue by when it's a numeric. By making it numeric, you're abstracting it. Really it's just saying how many times can this abstract resource be "acquired." It's just a count number, there aren't any actual resources there on the other end. So there is noting to sort or to order. If however you have the resources attached to an actual group of treenodes or objects. Then there is an actual reference, there is something to sort and order to it. Does that make sense?

1 Like 1 ·
Sam Stubbs avatar image Sam Stubbs ♦ Axel Kohonen commented ·

If you need to create and sort abstracted entities, then I suggest using a list instead of a resource. Create tokens (since tokens are kind of like an object) and have them represent your abstracted resources, push them to a list. And now you can pull them based on a query.

1 Like 1 ·
Axel Kohonen avatar image Axel Kohonen Sam Stubbs ♦ commented ·

Hi @Sam Stubbs

Thank you! That makes sense. I did not realize that the numeric reference does not use a list, but only a counter. Will probably use a list to solve the problem as I really only need a certain amount of abstract items, but so that I can give priority to certain tokens that want to acquire the items.

Axel

0 Likes 0 ·