the model stops itself before its stop time

the model stops itself before its stop time

moosa
Not applicable
72 Views
21 Replies
Message 1 of 22

the model stops itself before its stop time

moosa
Not applicable

[ FlexSim 23.1.0 ]

Please find the attached model, this model stops itself before its allotted stop time.when I run with 3 independed scheduled tokens it stops at some 150000; but the same model if run with 2 scheduled tokens stops after it transverses all the rows of the assigned global table.Please note that I will have to extend this logic for 25 different tables,for now in this model I am trying with 3 tables , but i am not successful in establishing the complete logic, but the logic works well for 2 tables.TRANSPORTATION_LOGIC_rev02.fsm

0 Likes
Accepted solutions (1)
73 Views
21 Replies
Replies (21)
Message 2 of 22

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

rm301_row_decide sends the only token remaining to the sink at time 2563929.82 as a result of testing if x<y and evaluating to false where:

int x=token.index;
int y=Table("rm302").numRows/96-1;
0 Likes
Message 3 of 22

moosa
Not applicable

it is true when 2 tokens are running , but when 3 tokens are used it stops at 156,998.94 seconds, which cant be true as the model has to run until 2563838.832 seconds.

1680537894420.png

0 Likes
Message 4 of 22

jason_lightfootVL7B4
Autodesk
Autodesk

Is that a different model? Post the model you want explaining with it set up to run the relevant case.

0 Likes
Message 5 of 22

moosa
Not applicable

its the same model attached with 3 scheduled sources, only that i have not attached the third schedule source to the process flow block.

1680538327452.png

0 Likes
Message 6 of 22

jason_lightfootVL7B4
Autodesk
Autodesk


You have an infinite loop of zero time events.

zerotimeinfiniteloop.gif



0 Likes
Message 7 of 22

moosa
Not applicable
so how do i remove it ??it would be helpful if you could support me with this.
0 Likes
Message 8 of 22

jason_lightfootVL7B4
Autodesk
Autodesk

Well the delay is reading token.hour which is -25287 which evaluates to zero.

In the production time decision code, x (6) is not equal to y (108) so the token goes to exit 2.

You can place breakpoints in your code to see what's going on with the local variable values.


0 Likes
Message 9 of 22

moosa
Not applicable
well i did have a look over code, it works fine until I dont add more than 2 resources, but eventually i need a robust process flow which could be easily extendable.Is there any suggestion or guidance you could give me?
0 Likes
Message 10 of 22

jason_lightfootVL7B4
Autodesk
Autodesk

If you want it to be scaleable then you should probably use object process flows that relate to the presence of 3D objects (what is this model doing - how are you going to scale it?)

0 Likes
Message 11 of 22

moosa
Not applicable
well unfortunately object process flow is not feasible in this case, as we push one input into one list(chafers) with partition id as item.Type ,and then again pull a certain values from that list matching with a global tables (rm301,rm302,....) .In this case we shall have 22 global tables and I believe that global tables cant be parameterized and also the conditions vary a lot.
0 Likes
Message 12 of 22

jason_lightfootVL7B4
Autodesk
Autodesk
Well the fact that the processes are identical indicate to me that you should only have one definition of it and many parameterized instances. The pull from list requirement is just looked up from its own global table. If you have 22 instances (RM301-RM322) then you could use a label on each to store the table instead of calling global tables 'rm301'. But since you look to be importing to those Global Tables already, I'd have a label (called eg. 'globTable') on the M301-M322 objects that points to the correct global table data. Then you can just refer to the table using:
Table(current.globTable)[token.index+1][4]

and so this is totally parameterizable for an object process flow.

0 Likes
Message 13 of 22

moosa
Not applicable

well it sounds interesting , how is that we link an object to the global table? as I am not able to link them, like linking a queue RM302 to table RM302, so that I could access the whole table on the object process flow.

1680596215533.png

0 Likes
Message 14 of 22

jason_lightfootVL7B4
Autodesk
Autodesk

transportation-logic-rev02_jl.fsm

Here's an example with a new object process flow. I set a pointer to the table at reset using

current.curingTable=reftable(current.name)

but you could also just use Table(current.name) in the references for the table.

0 Likes
Message 15 of 22

moosa
Not applicable

thanks for this object process flow, but unfortunately I have the same output , the model stops in after 156998.94 seconds and the value of hour has value -25287, this doesnt occur when I connect 2 objects RM301 and RM302.

0 Likes
Message 16 of 22

jason_lightfootVL7B4
Autodesk
Autodesk

You set token.hour to -25287 in the activity "waiting_time_for nextchafer" since x is 131711 and y is 156998 and token.hour is set to the difference : X-Y.

This code I think assumes that the X time is in the future but in fact it's in the past resulting in the negative time.

In the "production_time" decision, Instead of testing X==Y (you should never test doubles like this) you should check if X<Y.

Also - instead of X, call it "schedProdTime" and then you can just test schedProdTime< time() instead of X and Y which don't convey any meaning.

0 Likes
Message 17 of 22

moosa
Not applicable
well the problem is when the time is equivalent to the scheduled time on the global table only then the pull request should be made else the task executor is to wait, if at the same instant of time we have 2 requests then the dispatcher should use the second task executor.If I use the condition X<Y then it will abruptly pull from the list which is not my motive, my target is :the list is being filled up while it is being emptied from the matching label and time from the global table.
0 Likes
Message 18 of 22

jason_lightfootVL7B4
Autodesk
Autodesk
Use a process to push to the list that is separate from the pulling process. Only push to the list when it should get on the list.
0 Likes
Message 19 of 22

moosa
Not applicable

well i tried doing it but was not successful, as shown ,firstly I was pushing all the items being produced into a list , then pull it back and then pushing into another list as per the requirement and then pulling it when the schedule time comes in, Tbh i am not sure you suggested something like this.Please note that the input list is producing several items at different times while the output lists is waiting for the scheduled time for the output to be delivered.


1680612128243.png

0 Likes
Message 20 of 22

jason_lightfootVL7B4
Autodesk
Autodesk
Don't do this in the object process flow instance - it's a seperate process.

You can remove the delays from your pulling process and check for producton time, since when you get to the Pull From List anything on the list is valid to be pulled.

0 Likes