question

chiiiiii avatar image
0 Likes"
chiiiiii asked Felix Möhlmann commented

list.push() ploblem

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!

FlexSim 25.0.0
push to listpushlist push
rule-base-demo.fsm (119.5 KiB)
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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

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


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