question

Andrei Ferreira Pinto avatar image
0 Likes"
Andrei Ferreira Pinto asked Andrei Ferreira Pinto commented

Problems with schedule source times in process flow

Hello everyone,

FlexSim gets a little bit confused when I try to create a schedule source in process flow in mixed sequences (attached file). Apparently it only works when token creation occurs cronologically in the same column.

How can I manage to create specific tokens following the logic presented by the time column without changing the whole table?

Thanks in advance,

Andrei

FlexSim 17.2.2
process flowtask sequenceschedule source
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

Mischa Spelt avatar image
2 Likes"
Mischa Spelt answered Andrei Ferreira Pinto commented

I see two possible options.

Option 1 - Sort the table

You do not have to do this by hand. You can either copy/paste the table to Excel, then sort it by time, then paste it back. Or you could automate this. I used the sampler to get a reference to the table, and then tried sorting it:

getvarnode(model().find("Tools/ProcessFlow/ProcessFlow/Source"), "arrivals").as(Table)
    .sort();

However since the time column happens to be a text column, it sorts the values alphabetically instead of numerically, so you would have to do a little more work here to change the values to numbers, ending up with something like

Table source = getvarnode(model().find("Tools/ProcessFlow/ProcessFlow/Source"), "arrivals");
for(int i = 1; i <= source.numRows; i++)
{
	double value = source[i][1];
	source[i][1] = value;
}


source.sort(1);

which you could execute from a Script window.

Option 2 - Use a delay

If you prefer to keep the order of the rows the same, what I would do is generate all tokens at time 0 with a label specifying their arrival time. This would require you to copy the current Time column to a Label column and setting all times to 0:

Then add a Delay activity with a delay time of token.ArrivalTime below your source: see this demo model


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

Andrei Ferreira Pinto avatar image Andrei Ferreira Pinto commented ·

Works perfectly!

Thanks!

0 Likes 0 ·