From fc98e979fae92b39a659d66a0d0c1cf049a19c40 Mon Sep 17 00:00:00 2001 From: Jean-Christophe <jean-christophe.routier@univ-lille.fr> Date: Thu, 2 Jul 2020 08:42:07 +0200 Subject: [PATCH] =?UTF-8?q?ajout=20r=C3=A9f=C3=A9rences=20fig=20et=20tab?= =?UTF-8?q?=20dans=20section=206?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/report/dalek.tex | 12 +++++---- doc/report/galadriel.tex | 53 ++++++++++++++++++++++++++-------------- 2 files changed, 41 insertions(+), 24 deletions(-) diff --git a/doc/report/dalek.tex b/doc/report/dalek.tex index 67476df..9f8a29d 100644 --- a/doc/report/dalek.tex +++ b/doc/report/dalek.tex @@ -10,12 +10,12 @@ They know that, no matter how secret or insignificant this base might be, the Do On the bright side, Dalek's neither sleep nor eat, so there is no question of organising shifts. Yet on the not-so-bright side, they haven't been designed with 360° sensors. Their sensors basically allow them to scan only a 90° portion at a time, and for simplification purposes, we will consider these 90° portions as the four cardinal directions, so not dalek can be scanning a South-East portion in our example, it will have to settle for scanning either South or East, tough luck. Last but not least, their chief, who knows about strategy, assigned them to fixed positions in the camp so these more junior Daleks wouldn't have to worry about where to be but only about where to look. -To summarise, we can model the problem as follows: +To summarise, we can model the problem as follows (see Figure~\ref{fig:dalek}): \begin{itemize} \item Set of agents, the five Daleks: $= (D_1, D_2, D_3, D_4, D_5)$ \item Set of variables, the cardinal point they are looking at: $= (C_1, C_2, C_3, C_4, C_5) $. \item Domain of each variable, here the four directions available: $= (N, E, S, W)$ - \item The set of utility functions corresponding to the different combinations of which direction they are looking at. + \item The set of utility functions corresponding to the different combinations of which direction they are looking at (see Table~\ref{tab:dalek-utilities}). \item $\alpha$ : in this case this parameter is somehow artificial since a sensor is part of the Dalek's anatomy, but we could think of the function as the Dalek's creation process, when each of them was given "arms", "eyes", sensors, etc... \end{itemize} Again, just like in our previous example, we shall consider agent and variable they control as one and the same. @@ -43,6 +43,7 @@ Considering the position of the 5 Daleks, we can model the prolem as the followi \draw (D3) -- (D5) node [midway,above]{$U_{35}$}; \end{tikzpicture} \caption{Dalek graph representation with utility functions} + \label{fig:dalek} \end{figure} With utility functions modeled as follows, translating the necessity to cover a maximal number of zones. @@ -232,6 +233,7 @@ Considering the position of the 5 Daleks, we can model the prolem as the followi \caption{Binary utility functions according to surveillance directions} + \label{tab:dalek-utilities} \end{table} @@ -240,7 +242,7 @@ Considering the position of the 5 Daleks, we can model the prolem as the followi \subsection{MGM resolution} \begin{enumerate} - \item \textbf{Round 0}: All Daleks are looking north with utilities as illustrated in the \textit{situation 0} figure. + \item \textbf{Round 0}: All Daleks are looking north with utilities as illustrated in Figure~\ref{fig:dalek_sit0_mgm}. Each Dalek computes its utility if it changed the direction where its looking, taking into account its neighbours are supposed not to change. For instance: \begin{itemize} @@ -291,7 +293,7 @@ Considering the position of the 5 Daleks, we can model the prolem as the followi \item West: $10 + 5 + 5 = 20$, $\delta_W = 13$ \end{itemize} Here both E and W are good options since they both cause a gain of 13. - Which one will be chosen depends on the implementation, here we shall postulate that th \textit{closest} one is elected, hence W. + Which one will be chosen depends on the implementation, here we shall postulate that th \textit{closest} one is elected, hence W (see Figure~\ref{fig:dalek_sit1_mgm}). \item $D_5$ computes $U_{25} + U_{35} + U_{45}$ \begin{itemize} \item North: $5+1+1 = 7$ @@ -299,7 +301,7 @@ Considering the position of the 5 Daleks, we can model the prolem as the followi \item South: $10 + 5 + 5 = 20$ \item West: $5 + 1 + 1 = 7 $ \end{itemize} - Here both E and S are good with a $\delta= 13$, we assume E is chosen. + Here both E and S are good with a $\delta= 13$, we assume E is chosen (see Figure~\ref{fig:dalek_sit1_mgm}). \end{itemize} Now that each Dalek has computed its utility and potential gain, they announce it. Both $D_4$ and $D_5$ have a potential gain of 13, so the way in which ties are handled depends on the implementtaion. diff --git a/doc/report/galadriel.tex b/doc/report/galadriel.tex index 8469fc8..c749999 100755 --- a/doc/report/galadriel.tex +++ b/doc/report/galadriel.tex @@ -4,24 +4,25 @@ Let us consider a company of three, sirs Gandalf, Frodo and Aragorn, visiting the halls of lady Galadriel in Lothlorien. The three of them are discussing which outfit they should wear and trying to find the best overall look their reduced fellowship can have. Worn out from the journey, their hosts show them to individual baths. Before leaving them to bathe and relax, their hosts leave them with two clean outfits sets of robes, made of either black velvet or white silk. After relaxing in the hot baths for a while, it will be up to them to decided which outfit they should wear. -This graph-colouring problem can be formalised as follows: +This graph-colouring problem can be formalised as follows (see Fiure~\ref{fig:galadriel-utility}): \begin{itemize} \item Set of agents, the three companions: $= (G, F, A)$ \item Set of variables, the colour of their each robe: $= (R_1, R_2, R_3)$. \item Domain of each variable, here the colour each robe can take: $= (B, W)$ - \item The set of utility functions corresponding to the different combinations of each of their robes. + \item The set of utility functions corresponding to the different combinations of each of their robes (see Table~\ref{tab:galadriel-utility} and~\ref{tab:galadriel-values}) \item $\alpha$ : simply the function (here the elf who gave each robe to each man!) mapping $R_1$ to Gandalf, $R_2$ to Frodo and $R_3$ to Aragorn. \end{itemize} Here, the goal is to maximise the global \textbf{utility} function $F_g$ -aka charisma- so they look as dashing as they can. We know by computing manually the sums that there are three best option which each yield 17: \begin{itemize} - \item G=W, F=B, A=B - \item G=W, F=W, A=B - \item G=W, F=W, A=W + \item G=W, F=W, A=W (see Figure~\ref{fig:galadriel-best1}) + \item G=W, F=B, A=B (see Figure~\ref{fig:galadriel-best2}) + \item G=W, F=W, A=B (see Figure~\ref{fig:galadriel-best3}) + \end{itemize} -[text=white, fill=black, draw,circle] +%[text=white, fill=black, draw,circle] \begin{figure} \centering @@ -34,6 +35,7 @@ We know by computing manually the sums that there are three best option which ea \draw (G) -- (A) node [midway,above]{5}; \end{tikzpicture} \caption{Favourable \#1 case with sum of utilites = 17} + \label{fig:galadriel-best1} \end{figure} \begin{figure} @@ -47,6 +49,7 @@ We know by computing manually the sums that there are three best option which ea \draw (G) -- (A) node [midway,above]{8}; \end{tikzpicture} \caption{Favourable \#2 case with sum of utilites = 17} + \label{fig:galadriel-best2} \end{figure} \begin{figure} @@ -60,6 +63,7 @@ We know by computing manually the sums that there are three best option which ea \draw (G) -- (A) node [midway,above]{8}; \end{tikzpicture} \caption{Favourable \#3 case with sum of utilites = 17} + \label{fig:galadriel-best3} \end{figure} \begin{table}[ht] @@ -89,7 +93,8 @@ We know by computing manually the sums that there are three best option which ea W & B & 8 \\ \hline W & W & 5 \\ \hline \end{tabular} - \caption{Utility functions according to robe colours} +\caption{Utility functions according to robe colours} +\label{tab:galadriel-utility} \end{table} \begin{table}[ht] @@ -105,7 +110,8 @@ We know by computing manually the sums that there are three best option which ea W & W & B & 6 & 8 & 3 & \textbf{17} \\ \hline W & W & W & 6 & 5 & 6 & \textbf{17} \\ \hline \end{tabular} - \caption{Full system values according to utilities} +\caption{Full system values according to utilities} +\label{tab:galadriel-values} \end{table} @@ -120,6 +126,7 @@ We know by computing manually the sums that there are three best option which ea \draw (G) -- (A) node [midway,above]{$U_{13}$}; \end{tikzpicture} \caption{Graph representation with utility functions} +\label{fig:galadriel-utility} \end{figure} @@ -128,10 +135,12 @@ Since there are in this case only two possible values for each variable, namely Let us look at the proceedings in detail. \subsection{MGM approach} + +See Table~\ref{tab:fg_contrib}. \begin{enumerate} \item \textbf{Round 0:} All three agents (G,A,F) start wearing black. Here each agent computes the difference $\delta$ by which it can contribute to improve the situation as known to it. For instance \begin{itemize} - \item If Galdalf switches his robes to white, $U_{12}=5$ and $U_{13}=8$ so that gives deltas of respectively $\delta(U_{12})=5-1= 4$ and $\delta(U_{13})=8-3= 5$ with therefore $\Delta= \sum\limits_{\delta(U_{ij})}= 4+5=9$. So his best offer is $\Delta_G= +9$ + \item If Gandalf switches his robes to white, $U_{12}=5$ and $U_{13}=8$ so that gives deltas of respectively $\delta(U_{12})=5-1= 4$ and $\delta(U_{13})=8-3= 5$ with therefore $\Delta= \sum\limits_{\delta(U_{ij})}= 4+5=9$. So his best offer is $\Delta_G= +9$ \item Similarly, if Aragorn switches his robes to white, $U_{13}=0$ and $U_{23}=0$ so respectively $\delta(U_{13})=0-3= -3$ and $\delta(U_{23})=0-4= -4$, with $\Delta= \sum\limits_{\delta(U_{ij})}= -3+-4=-7$. So his best offer is a decrease in general utility $\Delta_A= -7$. \item Finally if Frodo switches his robes to white, $U_{12}=0$ and $U_{23}=3$ so respectively $\delta(U_{12})=0-1= -1$ and $\delta(U_{23})=3-4= -1$ with $\Delta= \sum\limits_{\delta(U_{ij})}= -1 + -1= -2$. So his best offer is $\Delta_F= -2$. \end{itemize} @@ -150,7 +159,7 @@ Let us look at the proceedings in detail. 1 & W & B & B & 5 & 8 & 4 & 5+8=13 & 8+4=12 & 5+4=9 & 17 ?\\ \hline \end{tabular} \caption{MGM evolution of $F_g$ and agent's contribution} - \label{tab:fg_contrib} + \label{tab:fg_contrib} \end{table} @@ -187,7 +196,7 @@ Let us look at the proceedings in detail. \subsection{MGM-2 approach} This situation unravelled with our friends being unable to communicate with each other. - Each time they had to put on their robes, exit the individual baths, meet and see what each of them was wearing, then they would think about the best change they could, announce it outloud, in a non RP manner "I can get a +x for our group charisma if you allow me to change my robes to y colour". + Each time they had to put on their robes, exit the individual baths, meet and see what each of them was wearing, then they would think about the best change they could, announce it outloud, in a non RP manner "I can get a $+x$ for our group charisma if you allow me to change my robes to $y$ colour". This did result in an optimal solution, but it might have been achieved faster had they been allowed to communicate. This is what MGM2 allows us to do. Let us now have a look at how this would have gone if they had been given a way to communicate with each other, this is the case in 2-coordinated algorithm, here MGM2. Imagine that, before leaving each of them to bathe, the elves give -them except for Gandalf, since he can easily do this without a thingummy- a thought stone. @@ -205,7 +214,7 @@ Let us look at the proceedings in detail. \draw (G) -- (A) node [midway,above]{3}; \end{tikzpicture} \caption{MGM-2 : round 0 situation} - \label{fig:my_label} + \label{fig:mgm2-round0} \end{figure} @@ -220,11 +229,13 @@ Let us look at the proceedings in detail. \draw (G) -- (A) node [midway,above]{8}; \end{tikzpicture} \caption{MGM-2 : round 1 situation} - \label{fig:my_label} + \label{fig:mgm2-round1} \end{figure} - + + + \begin{enumerate} - \item \textbf{Round 0}: + \item \textbf{Round 0} (see Figure~\ref{fig:mgm2-round0}): \begin{itemize} \item Agents inform each other of the current value of their variable. \item The set of Offerers and Receivers is determined at random, here $O = \{G, F\}, R= \{A\}$ @@ -265,7 +276,7 @@ Let us look at the proceedings in detail. Gandalf computes a gain of 11: $(U_{12} = 6) > 0 + (U_{13} = 8) > 3 \rightarrow 6 + 8 > 0 + 3$. \item Gandalf wins this round and is allowed to act and update its value to white. \end{itemize} - \item \textbf{Round 1}: + \item \textbf{Round 1} (see Figure~\ref{fig:mgm2-round1}): \begin{itemize} \item The process repeats. Now a new set of Offerers and Receivers is determined at random $O = \{G\}, R= \{F, A\}$ \item Gandalf chooses a partner at random: Aragorn. And makes an offer to him which is described in \ref{tab:gandalfaragornoffer}. @@ -287,9 +298,11 @@ Let us look at the proceedings in detail. W & W & 6 & 5 & $11 < 14 \rightarrow \delta < 0$ \\ \hline \end{tabular} \caption{Gandalf's offer to Aragorn for round 1} - \label{tab:gandalfaragornoffer} + \label{tab:gandalfaragornoffer-r1} \end{table} - + +Table~\ref{tab:fg_contrib_evolution} summarizes the steps. + \begin{table}[ht] \centering \begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|l|} @@ -299,9 +312,11 @@ Let us look at the proceedings in detail. 1 & W & W & B & 6 & 8 & 3 & 6+8=14 & 8+3=11 & 6+3=9 & 17\\ \hline \end{tabular} \caption{MGM-2 evolution of $F_g$ and agent's contribution} - \label{tab:fg_contrib} + \label{tab:fg_contrib_evolution} \end{table} + + \subsection{Modelling of the problem with SCADCOP API} \begin{lstlisting} -- GitLab