FET Forum

FET Development => Suggestions => Topic started by: igh on January 19, 2012, 01:26:28 AM

Title: Save highest and current schedules on timeout
Post by: igh on January 19, 2012, 01:26:28 AM
Hi, thanks for producing a great program!

I've made a small change to my copy of 5.16.0 to save the timetables on timeout in the same way you do for SIGTERM.
It would be great if you could add this to the base code.

Here is the diff of the change I made:


diff --git a/src/interface/fet.cpp b/src/interface/fet.cpp
--- a/src/interface/fet.cpp
+++ b/src/interface/fet.cpp
@@ -872,13 +872,15 @@
cout<<"Impossible"<<endl;
out<<"Impossible"<<endl;
}
- else if(timeExceeded){
- cout<<"Time exceeded"<<endl;
- out<<"Time exceeded"<<endl;
- }
- else if(gen.abortOptimization){
- cout<<"Simulation stopped"<<endl;
- out<<"Simulation stopped"<<endl;
+ // !IGH! write best and current timetables when time exceeded or SIGTERM
+ else if(timeExceeded || gen.abortOptimization ){
+ if(timeExceeded){
+ cout<<"Time exceeded"<<endl;
+ out<<"Time exceeded"<<endl;
+ }else{
+ cout<<"Simulation stopped"<<endl;
+ out<<"Simulation stopped"<<endl;
+ }

//2011-11-11 (1)
//write current stage timetable


Thanks, Ian
Title: Re: Save highest and current schedules on timeout
Post by: Liviu Lalescu on January 19, 2012, 10:25:26 AM
Thank you for the idea and code!

When generating multiple timetables, FET will not save the partial timetables (current and highest stage) for time limit exceeded for a timetable. The best would be to have a unified approach, so either save best+current timetable for both command line and GUI multiple timetable generation, or do not save for both.

I am not sure if saving best+current timetable for GUI multiple timetable generation is possible without too much work. I'll see it and let you know. On the other hand, saving partial timetables for GUI multiple timetable generation might be inappropriate.

Maybe I'll just consider adding your code for the CLI partial timetables.

I ask you and other users to write your/their further opinion about this matter.
Title: Re: Save highest and current schedules on timeout
Post by: igh on January 19, 2012, 10:57:58 AM
Thanks!

I only need this for the CLI. It enables my wrapper script to examine the partial timetables and logs. It can then provide more information to helps identify the problem areas. All I actually need is fs_activities.xml and the log files, but I expect the other formatted output could be very useful to others.

Ian


Title: Re: Save highest and current schedules on timeout
Post by: Liviu Lalescu on January 20, 2012, 09:58:24 AM
Since there are no other answers and your reasons are good, I think I will add your modification/suggestion. Maybe in a few days; I'll let you know (I think I won't release a new snapshot, but only give you/attach here the fet.cpp file to double check it.). Anyway, I would prefer to wait with the new FET version, because there are very few changes for the moment and also I am skeptical about upgrading to Qt 4.8.0, which seems slower, so I am still waiting for maybe Qt 4.8.1.
Title: Re: Save highest and current schedules on timeout
Post by: Liviu Lalescu on January 24, 2012, 04:12:35 PM
Done, please double check the attached fet.cpp archived file. It will be added in the next version (but it will take a while, as there are not many changes for now, and also I might want to wait for a newer Qt version).
Title: Re: Save highest and current schedules on timeout
Post by: Liviu Lalescu on January 30, 2012, 06:08:30 AM
Minor update to the file's comments. Attached.