D20001: Simplifying Scheduler

Eric Dejouhanet noreply at phabricator.kde.org
Mon Mar 25 07:34:45 GMT 2019


TallFurryMan added a comment.


  I agree with your points, but I still tend to think SchedulerJob should be able to produce a score by itself, answering "job, what's your score?".
  SchedulerJob knows when it starts, knows the restrictions, and there's no added value in Scheduler for this purpose that I can see. Scheduler is just a tunnel providing global variables in most cases.
  In the case of darkness, Scheduler needs the startup time of SchedulerJob. For dawn and dusk, when that will be fixed, Scheduler will still need the startup and completion time of SchedulerJob. Same again for Moon separation.
  Now, I agree, altitude calculations need SchedulerJob times and non-Scheduler global variables, but also require a startup time that pertains to the previous job in the schedule. So, my opinion is obviously criticizable.
  As a side note, scoring is only a can/cannot run flag in the end, and would better be completely removed at some point. That would spare us some hair.
  
  Now, no problem, we can go for a utility section. But in that case, in my opinion there's no reason to add a new class. We can partition the code per responsibilities, then later on decide on what to cut off, where from and where to.
  We could go for a "scheduler.cpp" with UI, "scheduler_strategy.cpp" with the job evaluation algorithm, "scheduler_frames.cpp" with the frame counting headache, "scheduler_restrictions.cpp" with the score/altitude/moon/darkness calculations, be it for the whole schedule or only jobs.

REPOSITORY
  R321 KStars

REVISION DETAIL
  https://phabricator.kde.org/D20001

To: wreissenberger, mutlaqja, TallFurryMan
Cc: kde-edu, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20190325/35afa907/attachment-0001.html>


More information about the kde-edu mailing list