a week ago
Hello,
attached is the example without the generator, you can achieve the same behavior by recursively calling the method that was involved in the generator with methCall and the time that has to pass for it to get executed (here 86400 for one day). If I am not wrong there is still a periodicity in your table of 6 parts per day which has also been accounted for in the model.
a week ago
@IgorKunjavskij Thank you for your ExampleModel.
However, I understand the solution from @MarcusA better.
But I'm struggling to call the method every new day :/
a week ago - last edited a week ago
If you want to execute a method after a period of 24 hours has passed after this method has been called you can use
&method_name.methCall(86400,Parameter1,Parameter2...)
So you can have an init method make this call and afterwards have the method that was called repeat this call at the end of its execution so that it gets called recursively at the beginning of every day.
a week ago
wow, it works now! A really big thank you to you guys!!!
To put everything together, How I got it working:
method init:
Prod_Sequence.deleteContents Backup_Table.copyRangeTo({1,0}..{*,*}, Prod_Sequence, 1,0) &NewDelivery.executeIn(86400)
method NewDelivery:
var DaysPassed : real DaysPassed:=eventcontroller.SimTime/1:00:00:00 if Source_ZV.occupied Source_ZV.cont.delete end if Source_RSW.occupied Source_RSW.cont.delete end for var Row := 1 to Prod_Sequence.YDim --Go through whole table if Prod_Sequence[1,Row] < DaysPassed --Reduce number of MU if they are created before SimTime Prod_Sequence[3,Row] := 0 else exitloop 1 --When all rows are reduced, exit the method end next &NewDelivery.executeIn(86400)
I am really amazed by your effort!
@MarcusA Your cold caused a few errors but I managed to solve it . Get well very soon!