diff --git a/doc/report/fsm.tex b/doc/report/fsm.tex index b973b603cad56f411e3e967b3f370fad369c877c..3f44b428cf511161c999d34eb8815c9ee455b770 100644 --- a/doc/report/fsm.tex +++ b/doc/report/fsm.tex @@ -48,8 +48,8 @@ The agent unstashes all previous \informVal{} stashed messages and sends a \kick The agent will then transition to \continue{}. During \initRandomVal{\val.domain}, the agent's variable $x_i$ is initialised at a random value $v_i \in d_i$. -When the Supervisor received \kickStart, it will send back a \whatToDo{Continue} message needed to get going. -This artificial trigger of \whatToDo{Continue} is used only once, at the begining of the algorithm. +When the Supervisor received \kickStart, it will send back a \continueAlgo{} message needed to get going. +This artificial trigger of \continueAlgo{} is used only once, at the begining of the algorithm. \end{itemize} @@ -60,8 +60,8 @@ Messages received in this state: \begin{itemize} \item \informVal{someVal}: neighbour's \informVal{someVal} are stashed to be dealt with when leaving \waitingForRole{}. \item \giveGo{}: If the agent has reached this state after completing a round where it had been committed but could not act because it did not win the neighbourhood's delta competition, it will receive its partners' \giveGo{} or \giveNoGo{} here, but nothing should be done about it. \item \giveNoGo{}: If the agent has reached this state after completing a round where it had been committed but could not act because it did not win the neighbourhood's delta competition, it will receive its partners' \giveGo{} or \giveNoGo{} here, but nothing should be done about it. - \item \whatToDo{Stop}: agent transitions to \final{} with the whole process terminating - \item \whatToDo{Continue}: agent called \reset{} method, emptying\linebreak \receivedOffers{}, \neighbourValues{} and \neighbourDeltas{}. + \item \stopAlgo{}: agent transitions to \final{} with the whole process terminating + \item \continueAlgo{}: agent called \reset{} method, emptying\linebreak \receivedOffers{}, \neighbourValues{} and \neighbourDeltas{}. early received \informVal{} messages are unstashed, then the agent sends its own value via \informVal{\val} to all its neighbours. It performs \determineSubset{} and send the outcome to self via \chooseSubset{} before transitioning to \waitingForRole{} where \chooseSubset{} will be dealt with as well as unstashed \informVal{}. \end{itemize} @@ -202,7 +202,7 @@ In order to carry out negotiations, exchange information and coordiante themselv Each message can only be handled in dedicated states and will therefore be stashed for later use when received in a non-dedicated state. \subsubsection{Standard agent messages} \begin{itemize} - \item \kickStart{}: is sent by the agent at the very begining of the process to indicate to the Supervisor that it needs to send it the initial \whatToDo{Continue} message. + \item \kickStart{}: is sent by the agent at the very begining of the process to indicate to the Supervisor that it needs to send it the initial \continueAlgo message. \item \chooseSubset{Offerer/Receiver}: is sent by the agent to itself, sent in the \waitingForRole{} state and then causing the transition towards either \offWaitingValues{} or \recWaitingOffers{}. This message determines the path the agent threads for the next two states before joigning again in the \uncommitted{}/\uncommitted{} states. \item \informVal{someVal}: is sent by an agent to all neighbouring agents in state \waitingForRole{}. \item \informDelta{\neighbourDeltas.get(self.variable)}: is sent by an agent which has computed its solo or joint delta to its neighbourhood upon transitioning to either \uncommitted{} or \uncommitted{} states. @@ -225,11 +225,51 @@ Each message can only be handled in dedicated states and will therefore be stash %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\subsection{Supervisor agent behaviour} +\subsection{Supervisor behaviour} +The supervisor has a simple behaviour based on mainly two states. +In one of them, it awaits for all the agent's values. +Once all values have been collected, it switches to the second state, evaluating whether the full process had ended or not. +From there, it will branch, either back to the other state or to the final one once the condition for ending is reached. +\subsection{Supervisor states} + +\subsubsection{General overview} +\begin{itemize} + \item \waitingAgentValues{}: the main state where supervisor waits for agents' information. + \item \startState{}: the state in which the supervisor starts, from there it broadcasts the \trigger message to all agents and directly goes to \waitingAgentValues. + \item \decidingStopContinue{}: state in which the supervisor checks whether the stopping condition has been met or not. + \item \finishState{}: the final state the supervisor ends in after the full algorithm has ended and the stopping condition is met. +\end{itemize} + +\subsubsection{\waitingAgentValues} +This is the main state the supervisor spends most time in. Here it collects values from agents in order to make its decision. +Messages received in this state: \begin{itemize} + \item \kickStart{}: this is directly answered with a \continueAlgo{} message. + \item \informVal{someVal}: these messages are put into the supervisors' \currentContext until it is filled. + The last one triggers a transition to \decidingStopContinue{}. +\end{itemize} + +\subsubsection{\startState} +Transiant state where the supervisor doesn't stay, no messages can be received here. + +\subsubsection{\decidingStopContinue} +Here the supervisor either continues or stops, according to the message it send itself before transitioning here from \waitingAgentValues{}. +Messages received in this state: \begin{itemize} + \item \informVal{}: is stashed to be handled in \waitingAgentValues{}. +\end{itemize} + +\subsubsection{\finishState} +Final state of the automaton, no messages are received here. + + +\subsection{Supervisor's mental state} +The supervisor only handles one mental state variable: \currentContext{}. +In it it stores the current values all variables have. + +\subsection{Supervisor messages} \begin{itemize} \item \beginAlgo{}: is the initial message sent once by the supervisor to all agents to launch the process. - \item \whatToDo{Continue}: is sent by the supervisor to indicate that another round shoudld be carried out. - \item \whatToDo{Stop}: is sent by the supervisor when the halting condition has been met. + \item \continueAlgo{}: is sent by the supervisor to indicate that another round shoudld be carried out. + \item \stopAlgo{}: is sent by the supervisor when the halting condition has been met. \end{itemize} diff --git a/doc/report/main.tex b/doc/report/main.tex index 4592c1f96e21f69abd0e43268c472e594053679c..b0003c57520fd113116addc91e06c46a63bc45f7 100644 --- a/doc/report/main.tex +++ b/doc/report/main.tex @@ -80,6 +80,10 @@ \newcommand{\continue}{\texttt{Continue}} \newcommand{\final}{\texttt{Final}} +\newcommand{\decidingStopContinue}{\texttt{DecidingToStopOrContinue}} +\newcommand{\waitingAgentValues}{\texttt{WaitingForAgentValues}} +\newcommand{\startState}{\texttt{Start}} +\newcommand{\finishState}{\texttt{Finish}} %MESSAGES @@ -95,10 +99,11 @@ \newcommand{\giveNoGo}{\texttt{GiveNoGo}} \newcommand{\beginAlgo}{\texttt{Trigger}} \newcommand{\kickStart}{\texttt{KickStartMe}} -\newcommand{\whatToDo}[1]{\texttt{WhatToDo}(#1)} \newcommand{\stopAlgo}{\texttt{StopAlgo}} \newcommand{\continueAlgo}{\texttt{ContinueAlgo}} +\newcommand{\trigger}{\texttt{Trigger}} + %MENTAL STATE @@ -111,6 +116,8 @@ \newcommand{\neighbourDeltas}{\texttt{mind.deltas}} \newcommand{\currentBestOffer}{\texttt{mind.currBestOffer}} +\newcommand{\currentContext}{\texttt{supervisorMind.currentContext}} + %METHODS \newcommand{\initRandomVal}[1]{\texttt{mind.choose(variable)}(#1)} \newcommand{\reset}{\texttt{mind.reset()}}