question

Vahideh M avatar image
0 Likes"
Vahideh M asked Jeff Nordgren edited

Query expression for task priority considering amount of acquiring resource

@Jordan Johnson, @Phil BoBo, @Matthew Gillespie, @Matt Long, @anthony.johnson

Hi All,

I am trying to use the Query in an Acquire but it does not work properly.

The version of my Flexsim: 2020.1.3

I have three tasks. Two of them need two operators and one of them needs one operator, which has been assign by labels and recall later in Acquire resource. There are only three operators in my model.

Also, I have two kinds of priority: Overall_prio and Prio. It is like external (Product production priority) and internal priority (task priority), which I need it for the rest of my process flow.

Overall_prio = 1 means that it has the highest priority among other products and it should be done in the first place.

Prio = 1 means that it has the highest priority among other tasks related to the same production.

Tasks are pushing to the list, and pulling by Query ORDER BY prio ASC, overall_prio ASC that is ok and I need it this way.

I am want to assign operators to the tokens in this order:

first: production 1, task 1

second: production 2, task 1

third: production 2, task 2

Although I define ORDER BY Puller.Prio ASC for Acquire operator, but it doesn’t work right and the last task (production 2, task 2) acquire operator before production 2, task 1.

Thank you in advance,

Query for Assigning the operators.fsm

FlexSim 20.1.3
flexsim 20.1.3token priority
· 1
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

Jeff Nordgren avatar image
0 Likes"
Jeff Nordgren answered tannerp commented

@vahideh.m,

Attached is your model with the changes that I've made to it.

First, you are trying to do a query on the Resource (Operators) but the Resource list is just the Operator objects. They don't have any other information (like Prio, Overall_prio or Amount_Emp) so you can't use non-existent info from a list, whether it be an item list, resource list or any other list.

You are also trying to use an internal list and pushing the token to that internal list. Doing this, the list only has one field which is the token ID. Even though you assign labels to your token, those labels (fields) don't exist on the internal list. So I created a Global List (ItemList) and added those three fields that you need.

You only need those fields when you are pulling from the item list, which is where you need your query info. This query needs to have the fields spelled properly (including caps) so I had to change that but you essentially have that query correct, I just had to add some caps to your field names.

Next, because you only want to do one process at a time, I added a Zone, which only allows one token to enter and finish before another token is allowed in. Otherwise, after the first token is assigned Overall_prio 1 and Prio 1, it Acquires two Operators, leaving one Operator free. The next token pulled also requires two operators but there is only one free one left, so that task can't Acquire 2 Operators. Then the third token comes in and only need 1 Operator. So that token can Acquire the last operator because it only need one, putting the sequence out of order. That is why I put the Zone in so that each operation need to complete before another one is allowed to enter.

Take a look at the model and see if it is now doing what you are wanting it to do. If you have any questions or problems, please let us know.

Thanks.

query-for-assigning-the-operators-JN3.fsm


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