list.push() ploblem

list.push() ploblem

chiiiiii
Not applicable
320 Views
10 Replies
Message 1 of 11

list.push() ploblem

chiiiiii
Not applicable

[ FlexSim 25.0.0 ]

Hi, I have some questions to ask.

I plan to calculate the starting locations (startstation) of the items waiting to be transported (since my AGV can carry up to four items at a time). Then, I will compare the distances between these locations to determine the optimal sequence for picking up the items and planning the transportation route.

I was advised to use a single list and an attribute (e.g., 0 for load, 1 for unload).

However, I am having some trouble implementing this in custom code.

I set up the following:

List tasklist = Model.find("tasklist");

// Retrieve TaskList

// Push start

Object station = token.startstation;

int operation = 0;

item = token.item;

List("tasklist").push(item, station, operation);


But it did not work as expected. I want to understand why.


Additionally, I have another question and would appreciate some advice.

(For details, please refer to the link: https://answers.flexsim.com/questions/176553/the-question-push-to-list.html )

At the same time, I will attach a simple demo for reference.

rule_base_demo.fsm

In the demo, I use the from-to concept to let the AGV transport materials.

I hope to split it into two attributes (startstation and endstation) and store them in a list.


I really appreciate your help!

0 Likes
321 Views
10 Replies
Replies (10)
Message 2 of 11

moehlmann_fe
Advocate
Advocate

If you use "List.push(item, station, operation)" then "station" would be the partition ID to which the item is pushed. To retrieve it from the list you would then have to pull from that specific partition.

Maybe that's the issue you were running into.

I took the liberty to overhaul your demo model to remove a lot of unnecessary repetition and those 'Delay-loops' which should really never be needed. I haven't yet encountered a case where I couldn't use an event or sync actions through lists instead.

The new model uses a single Object Process Flow for the machines. They pull items from a partitioned list, then push them to the AGV task list and once they are processed they push them to the item list again. The partition is determine by the "FlowDefinition" table which contains the information which station is next after a given step.

For the AGV I implemented an example of how lists could be used to make the transports more efficient. When the AGV has loaded items it will start moving toward the nearest "EndStation" of items it has loaded. If it comes across a station along its route where it can load another item, it will do so. Though in the current model the transport times are very small compared to the process times, so this case simply never comes up.

Still, I hope this can serve as an inspiration and example of what is possible.

rule-base-demo-fm.fsm

0 Likes
Message 3 of 11

joerg_vogel_HsH
Mentor
Mentor
@chiiiiii, it looks like you want to evaluate more values as attributes of an item.

You can add push argurment fields to your list, which you can fill by more push argument values. Alternatively if you want to keep an update value structure you can add labels to your item, which you put as label values onto your list. If you activate Dynamic attribute you can change this value at an item and you update the field also in your list.

0 Likes
Message 4 of 11

chiiiiii
Not applicable

Hi, thank you very much for your response; it has been extremely helpful to me.

If possible, I still have some questions I would like to ask you.

As I mentioned before, the images I provided were from a simplified demo. In my current model, after a station completes processing, if the next station is still processing, the item can be temporarily stored in the cassette e-rack. Once the next station finishes processing and the processed item is transported to the subsequent station, the stored item can then be transported to its next station.

The method I am using is to record which station processed the item after it has been processed.


I have a questions I would like to ask:

If an e-rack is added to the system, how would you modify the model?

I currently have an idea to add a source and destination for each machine to the e-rack in the FlowDefinition, as shown in the image.

1741850261960.png

However, I don't know how to apply this to the e-rack.

Perhaps add a Decide module to determine the machine's status?

Thank you again for your previous suggestions, and I look forward to your response.

0 Likes
Message 5 of 11

moehlmann_fe
Advocate
Advocate

I would build a separate Process Flow for the racks that hooks into the existing logic. Each rack gets a label that denotes what items can be stored there. A token is created for each machine that the rack acts as a buffer for and pulls items from the respective partition (with a lower priority than the machine itself).

Once the item is in the rack it is pushed to the same partition again. An additional label on the item is used to differentiate between items in a rack and others, so the tokens don't pull items that are already stored in a rack.

rule-base-demo-fm-2.fsm

0 Likes
Message 6 of 11

chiiiiii
Not applicable

Hi, I sincerely apologize for bothering you again.

I have some questions I would like to ask regarding my model, as there are some special cases that I need to handle. Below is a detailed explanation of the situation:

After processing, machine 2340's input port generates empty boxes (white boxes) that need to be transported to the cassette E-Rack as a temporary storage area (after which they will be destroyed).

Only after the empty box has been transported away can the actual item (brown box) be transported to machine 2340, since the input port of 2340 has a capacity of only 1.

At the same time, after processing, the actual item from 2340 is combined with an empty box (white box) from 2340's output port (which can hold two empty boxes).

Previously, my approach was:

When an item enters machine 2340, it determines which empty box it is being combined with based on the status of the output port’s empty boxes.

A label (outputport1 / outputport2) is assigned to the item to indicate which empty box it is associated with.

Once processing is complete, the corresponding empty box is deleted based on the label on the item.

After the processed item from 2340's output port is transported away, an empty box must be retrieved from the cassette E-Rack to replenish the missing empty boxes at 2340's output port.

Only when both the incoming item from 2130 and the required empty box at 2340's output port are present can machine 2340 proceed with processing.

This is why I created ProcessFlow (PF) for each port to manage this process.

Based on your suggestions, I now need to handle the following issues:

Empty boxes generated by 2340 need to be transported back to the cassette E-Rack queue.

After processing is completed at 2340, the corresponding empty box must be deleted (I suspect this might be the reason why my model is currently unable to execute the travel task).

Once the processed item is transported away, an empty box needs to be retrieved from the cassette E-Rack to replenish the missing empty boxes at 2340's output port.

For machine 2400, there will be two units available.

If 2358 finishes processing and 2400DL is still processing, the item should be sent to 2400SL.

If both 2400DL and 2400SL are processing, the item should be sent to the E-Rack instead.

I would like to ask for your guidance on how to resolve these issues. Although I have some ideas, it might take me a considerable amount of time to experiment and find a solution, so your assistance would be greatly beneficial.

I will be attaching:

My current model, which I modified based on your suggestions but is currently encountering an issue where the AMR cannot find the target machine.
Cassette rule based_multi_load_test.fsm

I truly appreciate your previous responses, and I sincerely look forward to and appreciate your guidance.

0 Likes
Message 7 of 11

chiiiiii
Not applicable

Hi, I sincerely apologize for bothering you again.

I have some questions I would like to ask regarding my model, as there are some special cases that I need to handle. Below is a detailed explanation of the situation:

After processing, machine 2340's input port generates empty boxes (white boxes) that need to be transported to the cassette E-Rack as a temporary storage area (after which they will be destroyed).

Only after the empty box has been transported away can the actual item (brown box) be transported to machine 2340, since the input port of 2340 has a capacity of only 1.

At the same time, after processing, the actual item from 2340 is combined with an empty box (white box) from 2340's output port (which can hold two empty boxes).

Previously, my approach was:

When an item enters machine 2340, it determines which empty box it is being combined with based on the status of the output port’s empty boxes.

A label (outputport1 / outputport2) is assigned to the item to indicate which empty box it is associated with.

Once processing is complete, the corresponding empty box is deleted based on the label on the item.

After the processed item from 2340's output port is transported away, an empty box must be retrieved from the cassette E-Rack to replenish the missing empty boxes at 2340's output port.

Only when both the incoming item from 2130 and the required empty box at 2340's output port are present can machine 2340 proceed with processing.

This is why I created ProcessFlow (PF) for each port to manage this process.

Based on your suggestions, I now need to handle the following issues:

Empty boxes generated by 2340 need to be transported back to the cassette E-Rack queue.

After processing is completed at 2340, the corresponding empty box must be deleted (I suspect this might be the reason why my model is currently unable to execute the travel task).

Once the processed item is transported away, an empty box needs to be retrieved from the cassette E-Rack to replenish the missing empty boxes at 2340's output port.

For machine 2400, there will be two units available.

If 2358 finishes processing and 2400DL is still processing, the item should be sent to 2400SL.

If both 2400DL and 2400SL are processing, the item should be sent to the E-Rack instead.

I would like to ask for your guidance on how to resolve these issues. Although I have some ideas, it might take me a considerable amount of time to experiment and find a solution, so your assistance would be greatly beneficial.

I have modified my model based on your suggestions, but I am currently encountering an issue where the AMR cannot find the target machine. I am actively working on resolving this problem.

I really want to share my current model with you, but perhaps due to the file size, I am unable to upload it.

I truly appreciate your previous responses, and I sincerely look forward to and appreciate your guidance.

0 Likes
Message 8 of 11

chiiiiii
Not applicable

Hi, I sincerely apologize for bothering you again.

I have some questions I would like to ask regarding my model, as there are some special cases that I need to handle. Below is a detailed explanation of the situation:

After processing, machine 2340's input port generates empty boxes (white boxes) that need to be transported to the cassette E-Rack as a temporary storage area (after which they will be destroyed).

Only after the empty box has been transported away can the actual item (brown box) be transported to machine 2340, since the input port of 2340 has a capacity of only 1.

At the same time, after processing, the actual item from 2340 is combined with an empty box (white box) from 2340's output port (which can hold two empty boxes).

Previously, my approach was:

When an item enters machine 2340, it determines which empty box it is being combined with based on the status of the output port’s empty boxes.

A label (outputport1 / outputport2) is assigned to the item to indicate which empty box it is associated with.

Once processing is complete, the corresponding empty box is deleted based on the label on the item.

After the processed item from 2340's output port is transported away, an empty box must be retrieved from the cassette E-Rack to replenish the missing empty boxes at 2340's output port.

Only when both the incoming item from 2130 and the required empty box at 2340's output port are present can machine 2340 proceed with processing.

This is why I created ProcessFlow (PF) for each port to manage this process.

Based on your suggestions, I now need to handle the following issues:

Empty boxes generated by 2340 need to be transported back to the cassette E-Rack queue.

After processing is completed at 2340, the corresponding empty box must be deleted (I suspect this might be the reason why my model is currently unable to execute the travel task).

Once the processed item is transported away, an empty box needs to be retrieved from the cassette E-Rack to replenish the missing empty boxes at 2340's output port.

For machine 2400, there will be two units available.

If 2358 finishes processing and 2400DL is still processing, the item should be sent to 2400SL.

If both 2400DL and 2400SL are processing, the item should be sent to the E-Rack instead.

I would like to ask for your guidance on how to resolve these issues. Although I have some ideas, it might take me a considerable amount of time to experiment and find a solution, so your assistance would be greatly beneficial.

I will be attaching:

My current model, which I modified based on your suggestions but is currently encountering an issue where the AMR cannot find the target machine.
Cassette rule based_multi_load_test.fsm

My previously completed single-load full version of the model, to help provide a clearer understanding of the original structure.
Cassette rule based_multi_load.fsm

I truly appreciate your previous responses, and I sincerely look forward to and appreciate your guidance.

0 Likes
Message 9 of 11

moehlmann_fe
Advocate
Advocate

The single Process Flow for all machines should be seen as a base. If you need to implement specific behaviours for certain stations you can either try to integrate them into the shared Process Flow through Decide activities, so the logic is only executed for certain instances.

Or you make a copy and create an Object Process Flow for that station only. The logic for the empty boxes can be similar to that of the "normal" boxes. Meaning to use lists to manage the availability and transports.

To have two stations that fulfill the same role I would exchange the pointers in the FlowDefinition table with strings. Each machine is assigned its respective string as a label. The Process Flow is changed to use that label instead of the pointer to the machine itself.

rule-base-demo-fm-3.fsm

0 Likes
Message 10 of 11

chiiiiii
Not applicable

Hi, I’m sorry to bother you again.

After trying, I encountered an issue, and I’m not sure why my 2340 in is moved into the brown box, but my 2340 machine does not start processing. Could you kindly help me identify where I might have made a mistake in my settings?

The modifications I made include adding a delay to postpone the generation of the white box, and I also set up the white box to be generated at the beginning in 2340 in.

Below is my current model. I haven’t added the cassette rack logic yet, as I am still in the process of understanding it.

I would really appreciate your guidance. Thank you in advance!

Cassette rule based_multi_load_test.fsm

0 Likes
Message 11 of 11

moehlmann_fe
Advocate
Advocate

There were a couple small mistakes in the model

- I changed some stuff in the AGV Process Flow, because what I had implemented previously didn't actually work as I intended.
- The "Items" list in that PF should be an internal list.
- If you create the empty boxes in the queue, they should be pushed to the "Ready" partition and the tokens should then enter the flow that is responsible for pulling boxes to the queue. These plus the other tokens that enter this flow should be no more than two (number of spaces available in queue). So I would create an box at the start and one token to pull another, when it becomes available.
- The connection ranks (or the condition itself) of the "Final Station" Decide activity needed to be swapped.

cassette-rule-based-multi-load-test(1).fsm

0 Likes