Customize Fet command line output

Started by thanhnambkhn, November 03, 2016, 04:41:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

thanhnambkhn

Dear all,
Did any body try to customize Fet-cl Source in order to:
- get output result in other format (such as json)
- add more information to output result. (I saw that FET (with GUI) gives the result is more fully than FET-cl).

Dear Lalescu Liviu,
Can you help me to do that? Thank you so much!




Liviu Lalescu

Please see file src/interface/fet.cpp, lines 793-1381, for the beginning.

thanhnambkhn

Thank you. I am investigating it :)

I have an other question.
In Fet GUI/ Timetable Tab/ there is "Soft Conflicts" functionality. (available after generating).
There are some information such as "Number of broken soft constraints: 1 . Total soft conflicts: 0.95 ..."

How to get that information from FET command line?

Liviu Lalescu

See src/engine/timetableexport.cpp, lines 1693-1751.

thanhnambkhn

Thank Liviu Lalescu,
Follow your guide, now I can get "Soft Conflicts" from command line.

Could I have an other question?  :)
How can I make command line have output, which are equivalent to FET with GUI: (on generate Timetable window dialog)
- "Without stopping the simulation and View initial order of placing the activities?"
- "Without stopping the simulation and View difficulty activities?"

Liviu Lalescu

Sure, no problem :)

The initial order is visible always (from the beginning) in the "logs" directory of the results.

For writing the difficult activities: see generate.cpp, lines 2964-2970. You need to connect this code to a command-line signal (SIGTERM is taken, but you may change that). See also timetablegenerateform.cpp function seeImpossible(), and fet.cpp lines 154-165 and 1202-1203. Since command-line is not threaded (no mutex), you need to ensure that you are showing the difficult activities correctly: completely before or completely after the lines 2964-2970 in generate.cpp.

thanhnambkhn

#6
Dear Liviu,
On Fet command line, how to enable the constraints which are locked by dèault ( constraint with lock icon)
(In Fet Gui, I can go to settings to unlock them.)

Thank you, have a nice week.

thanhnambkhn

#7
Hi Liviu,

I found that there are some differences in output result between Fet-cl and Fet-gui.
Fet-gui gives us more detail information than Fet-cl.

Let 's start with the input data TKB_191.fet which I attached below.
FET-gui gives us full detail information:
- Message box with detail about "Generate Impossible": [i]"Simulation impossible! Maybe you can consider lowering the constraints. The partial results were saved in the directory C:\Users\nxan\fet-results\timetables\TKB_191-single

Additional information relating impossible to schedule activities:

Please check the constraints related to the activity below, which might be impossible to schedule:

No: 1, Id: 46 (T:600924108, S:Chào cờ, AT:Sáng, St:1G - Sáng)"[/i]


- Fet-gui also generates "TKB_191_single" folder in output folder (include soft_conflict.txt ...)

But with FET-cl, it gives us very short output, "Impossible generate" only, with return value is 0.
When I checked the output folder, there is not any folder such as: "TKB_191_single" or something like that. (to get more detail about "impossible generate")

So, my question is: how to make FET-cl also generate TKB_191_single folder and soft_conflict.txt file.

Thank you.

Liviu Lalescu

See fet.cpp, lines 1232-1235. In case of impossible activity, I did not consider necessary to write the partial timetable or more information. Because you have the initial order of placing the activities and the max placed number of activities. Just look at the next activity - this is the difficult activity. If you really need to get the partial timetables and the conflicts.txt, you could change the sources, like in timetablegenerateform, function TimetableGenerateForm::impossibleToSolve(), but without the threading stuff.

Do you think I should change the official sources?

Liviu Lalescu

I made this for the official FET, thanks for suggesting! :)

Please use the attached file until the new version will be out.

Liviu Lalescu

I added a new snapshot, containing a FET with this improvement (see the Snapshots section or, after I will release FET-5.30.6, in the official FET).

Please test and let me know if now it is OK.

thanhnambkhn

Dear Liviu,

I have tested, FET works like charm.
Thank you so much for your support.

I will try to give more useful suggestions.

Liviu Lalescu


thanhnambkhn

Dear Liviu,

I am going to add "multiple - generate" (which is on FET-desktop only) to FET-cl because I think this functionality is very useful.

Please help me? Thanks.

Volker Dirr

multiple is just starting a new generation after one is done. so just write a for-command in your batch file and start fet-cl x times.