Skip to content
Snippets Groups Projects
Commit b2a2213d authored by Alex's avatar Alex
Browse files

reviewed agent FSM

parent 06e4c792
Branches
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ The process is triggered by a supervisor agent who invites other agents to begin
Each agent $a_i$ is sent a \beginAlgo{} message by the supervisor and initiates its variable's value at random in the variable's domain.
The behaviour of each agent is defined by a finite state automata.
\subsection{States}
\subsection{ Agent States}
\subsubsection{General overview}
\begin{itemize}
......@@ -91,13 +91,13 @@ Messages received in this state: \begin{itemize}
\item \makeOff{someOffer}: message is still answered with a \reject.
\item \informDelta{someDelta}: messages received from neighbours which are one step ahead are stashed at this stage.
\item \accept{someCombinedMove}: it will transition to committed and set \commitment{} to true as well as set \partner{} to \accept{someOffer}'s sender, this data will also help to compute the new delta.\\
\informDelta{\currDelta} is sent to all neighbours after having computed its new \currDelta{} either through it's partner's \accept{someCombinedMove}'s delta or on its own if it has been rejected with \computeSoloDelta{}.
\item \reject{}: the agent will transition to \uncommitted{}, set \commitment{} to true and set \partner{} to \texttt{None}.
\informDelta{\currDelta}: sent to all neighbours after having computed its new \currDelta{} either through it's partner's \accept{someCombinedMove}'s delta or on its own if it has been rejected with \computeSoloDelta{}.
\informDelta{\neighbourDeltas.get(self.variable)} is sent to all neighbours after having computed its new delta either through it's partner's \accept{someCombinedMove}'s delta or on its own if it has been rejected with \computeSoloDelta{}.
\item \reject{someOffer}: the agent will transition to \uncommitted{}, set \commitment{} to true and set \partner{} to \texttt{None}.
\informDelta{\neighbourDeltas.get(self.variable)}: sent to all neighbours after having computed its new delta either through it's partner's \accept{someCombinedMove}'s delta or on its own if it has been rejected with \computeSoloDelta{}.
\end{itemize}
\subsection{\recWaitingValues{}}
\subsubsection{\recWaitingValues{}}
In this state the Receiver agent waits until it has been informed of all its neighbours' values.
Messages received in this state: \begin{itemize}
\item \informVal{someVal}: are stored in the \neighbourValues{} map and become relevant only if the receiver does not get any acceptable offer.
......@@ -121,10 +121,10 @@ This state is a fork between committed and uncommitted Receiver agents.
Messages received in this state: \begin{itemize}
\item \informDelta{someDelta}: will be stashed and handled in either \committed{} or \uncommitted{}.
\item \bestOfferFM{someOffer}: will cause the agent to transition to \committed{}, setting \commitment{} to \texttt{true} and setting its \partner{} variable to the agent it has committed with.
\currDelta{} value is computed with \computeJointDelta{somePartner}
the agent's current delta value is computed with \computeJointDelta{somePartner}.
it will send a \reject{} to all neighbours which are not the partner and an \accept{someCombinedMove} to the chosen partner.
\item \bestOfferFM{None}: will cause the agent to transition to \uncommitted{} and set its \commitment{} to \texttt{false}.
It will send a \reject{} to all neighbours. \currDelta{} value is computed with \linebreak\computeSoloDelta{}.
It will send a \reject{} to all neighbours. The agent's current delta value is computed with \linebreak\computeSoloDelta{} and added to \neighbourDeltas.
\end{itemize}
In both \bestOfferFM{None/someOffer} cases, \informDelta{someDelta} is sent to all neighbours, containing either the result of \computeJointDelta{someDelta} or \computeSoloDelta{}.
......@@ -133,7 +133,7 @@ In both \bestOfferFM{None/someOffer} cases, \informDelta{someDelta} is sent to a
This state can be reached from \recHavingRecAllOff{} or \offMakingOff{}.
Messages received in this state: \begin{itemize}
\item \informDelta{someDelta}: messages are added to \neighbourDeltas{} until they have been received from all neighbours.
When all deltas have been received, the best \currDelta{} of the neighbourhood can be computed.
When all deltas have been received, the best delta of the neighbourhood can be computed.
Once it is computed, the agent will send itself either \shouldAct{true} or \shouldAct{false} depending on whether it has the highest delta of its neighbourhood or not.
\end{itemize}
......@@ -181,37 +181,31 @@ This state is reached coming from \continue{} in the case where the Supervisor s
No messages are sent nor received here, it merely represents the end of the algorithm.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Mental state}
\subsection{Agent's Mental state}
The agent's mental state can be considered as the variables which hold the agent's perception of its surroundings and of its inner state.
In our case, each agent possesses several \textit{personal} variables and several other \textit{interpersonal} variables.
\subsubsection{Personal variables}
\begin{itemize}
\item \val{}: the current value $v_i \in d_i$ of the variable $x_i$ controlled by the agent $a_i$.
\item \partner{}: the neighbouring agent with which the agent is committed, only relevant when committed is set to true.
\item \currDelta{}: the current value of the best delta the agent can achive in its context.
\item \neighbourValues{} : the current assingments of values to variables in the vicinity including its own variable.
\item \commitment{}: a binary flag indicating whether an agent is committed or not, makes the variable \partner{} relevant.
\item \partner{}: the neighbouring agent with which the agent is committed, only relevant when committed is set to true.
\item \receivedOffers{}: all offers receives by the agent during this turn, potentially empty ones.
\item \nbReceivedOffers{}: the counter for all offers received in the current turn.
\item \neighbourDeltas{}: a map containing the agent's and all its neighbours' current deltas.
\item \currentBestOffer{} : the potential best offer the agent has as of now, might be empty.
\end{itemize}
\subsubsection{Interpersonal variables}
\begin{itemize}
\item \receivedOffers{}: a map of offers received from neighbours, only relevant when the agent is a Receiver.
\item \neighbourValues{}: a map with each neighbour's current value of variable.
\item \neighbourDeltas{}: a map with each neighbour's current delta.
\end{itemize}
\subsection{Messages}
In order to carry out negotiations, exchange information and coordiante themselves, agents can opt for a variety of messages.
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 \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 \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 \informDelta{\currDelta}: is sent by an agent which has computed its solo or joint delta to its neighbourhood upon transitioning to either \uncommitted{} or \uncommitted{} states.
\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.
\item \makeOff{someOffer/None}: is sent by an offerer.
An offer contains all coordinated moves between the offerer and the designated receiver with their respective delta from the offerer's perspective.
A \textit{None} offer is sent by an offerer to all receivers which have not been chosen by it for this round.
......@@ -228,10 +222,14 @@ Each message can only be handled in dedicated states and will therefore be stash
\item \continueAlgo{}: is sent by the supervisor to the agents to inform them that they should stop.
\end{itemize}
\subsubsection{Supervisor agent messages}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Supervisor agent behaviour}
\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.
\end{itemize}
......@@ -90,7 +90,7 @@
\newcommand{\accept}[1]{\texttt{Accept}(#1)}
\newcommand{\reject}{\texttt{Reject}}
\newcommand{\bestOfferFM}[1]{\texttt{BestOfferForMe}(#1)}
\newcommand{\shouldAct}[1]{\texttt{ShouldAct}(#1)}
\newcommand{\shouldAct}[1]{\texttt{Act}(#1)}
\newcommand{\giveGo}{\texttt{GiveGo}}
\newcommand{\giveNoGo}{\texttt{GiveNoGo}}
\newcommand{\beginAlgo}{\texttt{Trigger}}
......@@ -104,11 +104,11 @@
%MENTAL STATE
\newcommand{\val}{\texttt{mind.value}}
\newcommand{\partner}{\texttt{mind.partner}}
\newcommand{\currDelta}{\texttt{mind.currentDelta}}
\newcommand{\commitment}{\texttt{mind.isCommitted}}
\newcommand{\receivedOffers}{\texttt{mind.receivedOffers}}
\newcommand{\neighbourValues}{\texttt{mind.neighbourValues}}
\newcommand{\neighbourDeltas}{\texttt{mind.neighbourDeltas}}
\newcommand{\nbReceivedOffers}{\texttt{mind.nbReceivedOffers}}
\newcommand{\neighbourValues}{\texttt{mind.context}}
\newcommand{\neighbourDeltas}{\texttt{mind.deltas}}
\newcommand{\currentBestOffer}{\texttt{mind.currBestOffer}}
%METHODS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment