\newcommand{\spatialresourcewaste}[3][0.24\textwidth]{
	\begin{subfigure}{0.24\textwidth}
	\vspace{0.5cm}
	%\ifnum#1=1 \hspace{0.25\textwidth} \fi
	\begin{minipage}[c]{\textwidth}%
		\includegraphics[width=1\textwidth]{figures/spatial_resource_waste/#3}
	\end{minipage}
	%\hfill
	\caption{#2}
	\end{subfigure}}

\newcommand{\spatialresourcewastetable}[3][0.9\textwidth]{
	\begin{subfigure}{0.24\textwidth}
	\begin{minipage}[c][#1]{\textwidth}%
	\resizebox{\textwidth}{!}{
	\centering
	\begin{tabular}{llll}
	\toprule
\textbf{Task termination} & \textbf{\% CPU} & \textbf{\% RAM} \\
	\midrule
	#3
	\bottomrule
	\end{tabular}}
	\end{minipage}
	\caption{#2 (exact values)}
	\end{subfigure}}

\begin{figure}
\spatialresourcewaste{Cluster A}{output_3_1.png}
\spatialresourcewaste{Cluster B}{output_3_3.png}
\spatialresourcewaste{Cluster C}{output_3_5.png}
\spatialresourcewaste{Cluster D}{output_3_7.png}
\spatialresourcewastetable{Cluster A}{
No termination & 0.6972\% & 1.0447\% \\
Evict & 13.4392\% & 11.8184\% \\
Fail & 2.2792\% & 2.8387\% \\
Finish & 1.3963\% & 1.1066\% \\
Kill & 82.1791\% & 83.1826\% \\
Lost & 0.0091\% & 0.0091\% \\
}
\spatialresourcewastetable{Cluster B}{
No termination & 0.2582\% & 0.4637\%\\
Evict & 4.8340\% & 7.3120\%\\
Fail & 6.2950\% & 8.3841\%\\
Finish & 2.5877\% & 1.2231\%\\
Kill & 86.0215\% & 82.6144\%\\
Lost & 0.0036\% & 0.0027\%\\
}
\spatialresourcewastetable{Cluster C}{
No termination & 0.3376\% & 0.3812\% \\
Evict & 8.2099\% & 8.0454\% \\
Fail & 1.2294\% & 2.0809\% \\
Finish & 2.9399\% & 3.3249\% \\
Kill & 87.2740\% & 86.1588\% \\
Lost & 0.0093\% & 0.0088\% \\
}
\spatialresourcewastetable{Cluster D}{
No termination & 0.4995\% & 0.4822\% \\
Evict & 7.6002\% & 9.0656\% \\
Fail & 3.0288\% & 3.9214\% \\
Finish & 0.8666\% & 0.8914\% \\
Kill & 88.0011\% & 85.6364\% \\
Lost & 0.0039\% & 0.0030\% \\
}
\caption{Relative usage of CPU and RAM resources w.r.t. final task termination.}\label{fig:spatialresourcewaste-actual}
\end{figure}

\begin{figure}
\spatialresourcewaste{Cluster A}{output_3_9.png}
\spatialresourcewaste{Cluster B}{output_3_11.png}
\spatialresourcewaste{Cluster C}{output_3_13.png}
\spatialresourcewaste{Cluster D}{output_3_15.png}
\spatialresourcewastetable{Cluster A}{
No termination &   0.033962\% &   0.193674\% \\
Evict &   2.838362\% &   3.399075\% \\
Fail &   0.058335\% &   0.069755\% \\
Finish &   0.000102\% &   0.000151\% \\
Kill &  96.661332\% &  95.799104\% \\
Lost &   0.407908\% &   0.538242\% \\
}
\spatialresourcewastetable{Cluster B}{
No termination &   0.000094\% &   0.000191\% \\
Evict &   0.003365\% &   0.004696\% \\
Fail &   0.003061\% &   0.004965\% \\
Finish &   0.012696\% &   0.017647\% \\
Kill &  91.094839\% &  85.573746\% \\
Lost &   8.885947\% &  14.398756\% \\
}
\spatialresourcewastetable{Cluster C}{
No termination &   0.000105\% &   0.000221\% \\
Evict &   0.008618\% &   0.006991\% \\
Fail &   0.001261\% &   0.001459\% \\
Finish &   0.015047\% &   0.017003\% \\
Kill &  82.483146\% &  79.698011\% \\
Lost &  17.491823\% &  20.276314\% \\
}
\spatialresourcewastetable{Cluster D}{
No termination &   0.000948\% &   0.000128\% \\
Evict &   0.046057\% &   0.006352\% \\
Fail &   0.023703\% &   0.002770\% \\
Finish &   0.095353\% &   0.012975\% \\
Kill &  95.468127\% &  97.927565\% \\
Lost &   4.365813\% &   2.050210\% \\
}
\spatialresourcewaste{Cluster E}{output_3_17.png}
\spatialresourcewaste{Cluster F}{output_3_19.png}
\spatialresourcewaste{Cluster G}{output_3_21.png}
\spatialresourcewaste{Cluster H}{output_3_23.png}
\spatialresourcewastetable{Cluster E}{
No termination &   0.015102\% &   0.016472\% \\
Evict &   0.362088\% &   0.321274\% \\
Fail &   0.051373\% &   0.047377\% \\
Finish &   1.672195\% &   1.310360\% \\
Kill &  97.899179\% &  98.304482\% \\
Lost &   0.000063\% &   0.000034\% \\
}
\spatialresourcewastetable{Cluster F}{
No termination &   0.000114\% &   0.000306\% \\
Evict &   0.007986\% &   0.013466\% \\
Fail &   0.000913\% &   0.002064\% \\
Finish &   0.013296\% &   0.021751\% \\
Kill &  94.396548\% &  90.227868\% \\
Lost &   5.581144\% &   9.734546\% \\
}
\spatialresourcewastetable{Cluster G}{
No termination &   0.001283\% &   0.000748\% \\
Evict &   0.034040\% &   0.025278\% \\
Fail &   0.004384\% &   0.003918\% \\
Finish &   0.176091\% &   0.166656\% \\
Kill &  27.376816\% &  30.954255\% \\
Lost &  72.407386\% &  68.849146\% \\
}
\spatialresourcewastetable{Cluster H}{
No termination &   0.000148\% &   0.000022\% \\
Evict &   0.006021\% &   0.000751\% \\
Fail &   0.000858\% &   0.000144\% \\
Finish &   0.015642\% &   0.001873\% \\
Kill &  78.910066\% &  97.713322\% \\
Lost &  21.067264\% &   2.283888\% \\
}
\caption{Relative request of CPU and RAM resources prior to tasks' execution w.r.t. final task termination.}\label{fig:spatialresourcewaste-requested}
\end{figure}
