Seize resource from Group

Seize resource from Group

shanice_c
Not applicable
52 Views
8 Replies
Message 1 of 9

Seize resource from Group

shanice_c
Not applicable

[ FlexSim 21.2.0 ]

hi, I would like to ask if flexSim will choose from the idle processor from a group by the rank each processor is ranked in a group? For example, if I have 10 processors(Processor1~Processor 10) as a group, when the demand of using processor is always greater than the supply of using processor. If I don't give any criteria to choose resource from the group, it's defaulted to seize a resource from Processor1 to look for an idle one everytime? And will this the reason to cause parts of processors are idle all the time, while parts of processors have already produced many items and keep producing?

0 Likes
Accepted solutions (1)
53 Views
8 Replies
Replies (8)
Message 2 of 9

moehlmann_fe
Explorer
Explorer
Accepted solution

By default, an "Acquire" or "Pull from List" activity should pull the first available value on the (internal) list. In case of a resource that references a group this list would indeed be ordered by the ranks of the objects in the group at the start of the model run.

However, after the first value gets released again it should be appended to the end of the list and the next acquired value should be the second ranked object and so on...

Attached is an example of each member of a group being acquired in the resulting "round robin" form.

AcquireOrder.fsm

If some of your processors are utilized more than others, the cause is likely something else.

0 Likes
Message 3 of 9

shanice_c
Not applicable

hi @Felix Möhlmann, if I don't use "list" and "Acquire" then there is no pull and push issue. When the processor is idle again, the sequence of request a resource would still based on the member sequence in Group. I asked this question, because I'm using SQL clause to look for a resource, but I have not add ORDER BY in clause, simply use SELECT FROM WHERE and always get the first one from the query result. Another thing is that now in my model, the supply is always greater than demand. I'm thinking if there's mistake in model or is it because I don't give a rule, so that few resources are used repeatedly.

0 Likes
Message 4 of 9

moehlmann_fe
Explorer
Explorer
Sorry, I misunderstood your question. Yes, when you query a group without an "ORDER BY" clause they would be ordered according to their group rank and the first eligible processor in the group would be chosen.
0 Likes
Message 5 of 9

shanice_c
Not applicable

Hi @Felix Möhlmann , Sorry for replying again after accepting the answer.

Just now I have tried adding ORDER BY into SQL query, but the sequence it is choosing resource is opposite to I expected.

I have noticed that the order to add object into group would affect the priority to seize when all objects are available. So my rule of giving BayNum from the layout left to right is 0 to 1, 2, 3….

And the ranking of group member in Group is from left to right and from up to down.

Above is my rule. Generally I should use”ORDER BY BayNum ASC” to let model choose resource from left bay. But my testing result is that if I use”ORDER BY BayNum ASC”, it will choose from larger BayNum; if I use”ORDER BY BayNum DESC”, it will choose from smaller BayNum.

The SQL clause is in the bellowing picture, the clause is in the Assign activity.

1632978572433.png

I’m confused with why this would happen, because I have intentionally set the ranking of members.

I have attached two models, one is order by ASC, another is by DESC

0930_with priority_by DESC.fsm

0930_with priority_by ASC.fsm

0 Likes
Message 6 of 9

moehlmann_fe
Explorer
Explorer

@Fiona C

I am getting an error (403) when I try to download any of your models. Could you please try reuploading them?
0 Likes
Message 7 of 9

shanice_c
Not applicable
0 Likes
Message 8 of 9

moehlmann_fe
Explorer
Explorer

You are choosing to assign the last found value. You set "countTask" to be equal to the number of rows in the query table and then assign the value from the "countTask-th" row (so the last row in the table). If the table was ordered in ascending order, this will be the highest "bayNum" and vice versa. If you instead just assign the value from the first row, the order will fit the ORDER BY statement.

1632994671873.png

You should also make sure that a row actually exists in the result table.

if(!countTask)
{
    // Some logic in case there is no entry in the result table
}


Your model also throws a lot of error message due to the "Update EQ_Table" code. There you search for objects in the model based on a name (processor) and a number, when assigning the location. But there is no processor for the numbers 15-20.

1632994628250.png

The other values are also based on the rank in the group, not the number of the processor.

0 Likes
Message 9 of 9

shanice_c
Not applicable
@Felix Möhlmann Thanks, I've fixed the logic mistake I made.
0 Likes