I've just a little question about how to calculate the parts duration of stay in the store. I don’t know which name I should use to achieve my purpose,
Firstly, calculating the time when the part store[i,j] enters the store;
Secondly, recording the current time;
Then, using variables to calculate duration of stay, such as duration of stay=the current time –entering time;
If duration of stay>=4 hours,
the AGV get the part “store[i,j]” out of the store and send it to the specific location.
Could you help me program a method?
Solved! Go to Solution.
Though l refer to some similar models and study them ,now ,here is a possible way to reach the targets:
@.[i,j].cont.starttime:=eventcontroller.simtime /*record the time when the part enters store*/
t:=eventcontroller.simtime-store[i,j].cont.starttime /*the duration of stay ,the data type of "t" is time*/
if t>=14400 /* 4hours=14400s */
The MU already has an attribute 'EntryTime' which you can use to get the time the part has entered.
Thank u very much!
When I use an object ,it's difficult for me to understand the meanning and syntax of the attributes,i.e, I dont konw how to program a method with the atttributes,such as the"entrytime" of the entity,"task " of the transporter.
Could you give some suggestions?
Have a good time!