Commit 51266eb2 authored by Markus Klinik's avatar Markus Klinik
Browse files

schedule builder

parent 8e4ce2a9
%% Creator: Inkscape inkscape 0.92.4,
%% PDF/EPS/PS + LaTeX output extension by Johan Engelen, 2010
%% Accompanies image file 'greedy-fails.pdf' (pdf, eps, ps)
%% To include the image in your LaTeX document, write
%% \input{<filename>.pdf_tex}
%% instead of
%% \includegraphics{<filename>.pdf}
%% To scale the image, write
%% \def\svgwidth{<desired width>}
%% \input{<filename>.pdf_tex}
%% instead of
%% \includegraphics[width=<desired width>]{<filename>.pdf}
%% Images with a different path to the parent latex file can
%% be accessed with the `import' package (which may need to be
%% installed) using
%% \usepackage{import}
%% in the preamble, and then including the image with
%% \import{<path to file>}{<filename>.pdf_tex}
%% Alternatively, one can specify
%% \graphicspath{{<path to file>/}}
%% For more information, please see info/svg-inkscape on CTAN:
\errmessage{(Inkscape) Color is used for the text in Inkscape, but the package 'color.sty' is not loaded}%
\errmessage{(Inkscape) Transparency is used (non-zero) for the text in Inkscape, but the package 'transparent.sty' is not loaded}%
\newcommand*\fsize{\dimexpr\f@size pt\relax}%
\setlength{\unitlength}{\unitlength * \real{\svgscale}}%
\put(-0.0030175,0.08198805){\makebox(0,0)[lt]{\lineheight{1.25}\smash{\begin{tabular}[t]{l}Resource A\end{tabular}}}}%
\put(-0.0030175,0.01793489){\makebox(0,0)[lt]{\lineheight{1.25}\smash{\begin{tabular}[t]{l}Resource B\end{tabular}}}}%
\put(0.21476325,0.08198805){\makebox(0,0)[lt]{\lineheight{1.25}\smash{\begin{tabular}[t]{l}Task 1 (capA)\end{tabular}}}}%
\put(0.47097591,0.01793489){\makebox(0,0)[lt]{\lineheight{1.25}\smash{\begin{tabular}[t]{l}Task 2 (capB)\end{tabular}}}}%
\put(0.72718857,0.01793489){\makebox(0,0)[lt]{\lineheight{1.25}\smash{\begin{tabular}[t]{l}Task 3 (capB)\end{tabular}}}}%
<svg width="395" height="100"><text x="5px" y="64px">Resource A</text><text x="5px" y="89px">Resource B</text><g><title>Task 1
capA=Resource A</title><rect width="100" height="20" fill="rgb(243,146,146)" stroke="rgb(0,0,0)" stroke-width="2px" x="85px" y="50px"></rect><text x="90px" y="64px">Task 1 (capA)</text></g><g><title>Task 2
capB=Resource B</title><rect width="100" height="20" fill="rgb(118,146,243)" stroke="rgb(0,0,0)" stroke-width="2px" x="185px" y="75px"></rect><text x="190px" y="89px">Task 2 (capB)</text></g><g><title>Task 3
capB=Resource B</title><rect width="100" height="20" fill="rgb(203,243,146)" stroke="rgb(0,0,0)" stroke-width="2px" x="285px" y="75px"></rect><text x="290px" y="89px">Task 3 (capB)</text></g><line x1="85px" y1="35px" x2="395px" y2="35px" stroke="rgb(0,0,0)" stroke-width="2px"></line><g><line x1="85px" y1="30px" x2="85px" y2="40px" stroke="rgb(0,0,0)" stroke-width="2px"></line><text x="82px" y="25px">0</text></g><g><line x1="185px" y1="30px" x2="185px" y2="40px" stroke="rgb(0,0,0)" stroke-width="2px"></line><text x="182px" y="25px">10</text></g><g><line x1="285px" y1="30px" x2="285px" y2="40px" stroke="rgb(0,0,0)" stroke-width="2px"></line><text x="282px" y="25px">20</text></g><g><line x1="385px" y1="30px" x2="385px" y2="40px" stroke="rgb(0,0,0)" stroke-width="2px"></line><text x="382px" y="25px">30</text></g></svg>
......@@ -5,7 +5,7 @@ In this section we describe some design decisions of the implementation of our m
We have implemented our algorithm in the functional programming language Clean.
The source code is available at our university's GitLab.\footnote{\url{}}
The implementation works in two phases.
The scheduler works in two phases.
Phase one uses a genetic algorithm to find a set of good assignments for a given instance definition.
Phase two uses these assignments to build schedules.
......@@ -142,8 +142,49 @@ This results in smaller intermediate numbers, which decreases the chance for inf
\subsection{Greedy Schedule Building}
Depth-first dependency resolution.
This allows modelling task priorities: first in list gets scheduled first.
Our schedule builder is a modified variant of the one by \citet{MyszkowskiLNS2018}.
Given a valid assignment, it builds a schedule as follows.
\item It always keeps track of the earliest point in time when each resource is available.
Initially, this is 0 for every resource.
\item For every task in the instance definition, in the order in which they occur, first schedule all predecessor tasks.
\item Then, when a task has no more unscheduled predecessors, find the earliest time where all resources assigned to that task are available.
This becomes the start time of the task.
\item Finally, update the resource availabilities by setting them to the end time of the task.
\item Repeat until all tasks are scheduled.
The difference between our schedule builder and the one by Myszkowski et al.~is that they do not perform depth-first dependency resolution.
In their instance definitions, all predecessors of a task must occur in the instance definition before the task.
Otherwise the generated schedule may violate the ordering constraints.
Our method allows tasks to occur in any order in the instance definition.
This way of schedule building has some of advantages and disadvantages.
It is simple to understand and easy to implement.
An advantage is that it allows modelling task priorities.
Tasks earlier earlier in the instance definition get scheduled first.
Another advantage is that the schedules it builds are valid by construction, where no resource is assigned to two tasks that are overlapping in time, and where tasks are always preceded by their predecessors.
A disadvantage is it does not always find the schedule with the shortest makespan, because it schedules the tasks in the order in which they occur in the instance definition.
It is sometimes possible to find shorter schedules by changing the order of tasks.
Consider the scenario in \cref{fig:greedy-fails}.
There are two resources, A with one capability capA, and B with one capability capB.
There are three tasks 1, 2, and 3, where task 1 requires capA and tasks 2 and 3 require capB.
Furthermore, task 1 is a predecessor of task 2.
There exists only one valid assignment, namely the one shown in \cref{fig:greedy-fails}.
The greedy schedule builder processes tasks in the order in which they occur, so it fails to see that task 3 could be scheduled at time 0.
\caption{greedy fails}
Finding the shortest schedule for a given assignment is an optimization problem on its own, which we leave for future work.
\subsection{Quality Functions}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment