<table><tr><td style="">TallFurryMan added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D20001">View Revision</a></tr></table><br /><div><div><p>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?".<br />
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.<br />
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.<br />
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.<br />
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.</p>
<p>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.<br />
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.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R321 KStars</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D20001">https://phabricator.kde.org/D20001</a></div></div><br /><div><strong>To: </strong>wreissenberger, mutlaqja, TallFurryMan<br /><strong>Cc: </strong>kde-edu, narvaez, apol<br /></div>