Acquire Resources by distance from a fixed point

Acquire Resources by distance from a fixed point

mhosseini457NG
Advocate Advocate
24 Views
5 Replies
Message 1 of 6

Acquire Resources by distance from a fixed point

mhosseini457NG
Advocate
Advocate

[ FlexSim 23.2.3 ]

I'm looking for a way to change resource acquisition in my model via a sorting-based strategy. Currently, the resources are not being selected according even to the order of their names within the resource group. I was thinking if there is a fixed point within my model, like a designated queue position or a specific spot on the floor, would it be possible to acquire resources based on their distance from this fixed point?

A simple model is attached.

Thanks

orderby_contents_oncenter_object (2).fsm

0 Likes
Accepted solutions (1)
25 Views
5 Replies
Replies (5)
Message 2 of 6

moehlmann_fe
Explorer
Explorer
Accepted solution

You can look at the distance field for an example. By default this calculates the distance between the value/resource and the puller. You can replace the expression that gets the location of the puller with a static vector and thus compute the distance between the value and those coordinates.

1702481846511.png

0 Likes
Message 3 of 6

moehlmann_fe
Explorer
Explorer
I also just noticed that you put the query into the "Queue Strategy" field. This is used to determine which puller/token gets to acquire a resource if there are multiple waiting.

For deciding which of multiple resources to pull, use the "Default Query" field or the query field in the Acquire activity (which would override the default query).

0 Likes
Message 4 of 6

mhosseini457NG
Advocate
Advocate

It worked, thanks for the answer! @Felix Möhlmann

I have two questions. First, when I adjust the Expression Field as you said, it still displays as "Straight-Line Distance From Resource to Puller" under Expression. I'm curious about why this differs from what you have in the snapshot. Second, in my resource acquisition query i use two 'ORDER BY' clauses. On occasions when these clauses seem to conflict, I'm wondering how it determines which criterion to prioritize in the sorting task?

0 Likes
Message 5 of 6

moehlmann_fe
Explorer
Explorer
The markup text (line 8 in my screenshot) is what is shown in the field.

The query first sorts by the first value. Ties are broken by sorting by the second value, otherwise the second value is not used.

Something like "ORDER BY content ASC, distance ASC" will choose the resource with the lowest "content" regardless of distance. Only if two or more have the same (lowest) content the distance is also taken into account.

If you want both fields to matter in all cases, you can combine them into a single number and sort by that (for example "ORDER BY (content*2 + distance/10) ASC").

0 Likes
Message 6 of 6

mhosseini457NG
Advocate
Advocate

got it, thanks!

0 Likes