···109109 \hline
110110 Scoring updated & Release the players \\
111111 \hline
112112- \end{tabular}
112112+ \end{tabular}
113113+ \caption{Summary of percepts and actions in the system}
113114 \label{table:inout}
114114- \caption{Summary of percepts and actions in the system}
115115\end{table}
116116117117+Figure~\ref{fig:analysis} provides the analysis overview diagram for our game.
117118118119\begin{figure}[htp]
119120 \centering
120121 \includegraphics[keepaspectratio,scale=0.4]{pdt/images/system_specification/analysis_overview.png}
121121- \label{fig:analysis}
122122 \caption{Analysis overview diagram}
123123+ \label{fig:analysis}
123124\end{figure}
124124-125125-Figure~\ref{fig:analysis} provides the analysis overview diagram for our game.
126126-127125128126\subsection{Scenarios Diagram}
129127···131129132130\begin{figure}[htp]
133131 \centering
134134- \includegraphics[keepaspectratio,scale=0.5]{pdt/images/system_specification/scenarios.png}
135135- \label{fig:scenarios}
132132+ \includegraphics[keepaspectratio,scale=0.5]{pdt/images/system_specification/scenarios.png}
136133 \caption{Scenarios diagram}
134134+ \label{fig:scenarios}
137135\end{figure}
138136139137\subsection{Goals Diagram}
···142140143141\begin{figure}[htp]
144142 \centering
145145- \includegraphics[keepaspectratio,scale=0.45]{pdt/images/system_specification/goal_overview.png}
146146- \label{fig:goals}
143143+ \includegraphics[keepaspectratio,scale=0.45]{pdt/images/system_specification/goal_overview.png}
147144 \caption{Goals diagram}
145145+ \label{fig:goals}
148146\end{figure}
149147150148\subsection{System Roles Diagram}
···167165\begin{figure}[htp]
168166 \centering
169167 \includegraphics[keepaspectratio,scale=0.4]{pdt/images/system_specification/system_roles.png}
170170- \label{fig:sysroles}
171168 \caption{System roles diagram}
169169+ \label{fig:sysroles}
172170\end{figure}
173171174172\newpage
···194192195193\begin{figure}[htp]
196194 \centering
197197- \includegraphics[keepaspectratio,scale=0.45]{pdt/images/architectural_design/data_coupling.png}
198198- \label{fig:datacoupl}
195195+ \includegraphics[keepaspectratio,scale=0.45]{pdt/images/architectural_design/data_coupling.png}
199196 \caption{Data coupling diagram}
197197+ \label{fig:datacoupl}
200198\end{figure}
201199202200\subsection{Agent-Role Grouping Diagram}
···204202In this diagram we group the roles into agent types. The agent-role coupling diagram shows the group of roles that come under an agent. Here follows the list of the agent types that we have identified:
205203\begin{itemize}
206204 \item ``Dealer'' that is the that represents the dealer that is in charge of dealing cards
207207- \item ``Gatekeeper'' that is the that represents the agent that let the players come in and out the system
205205+ \item ``Gatekeeper'' that is the that represents the agent that let players come in and out the system
208206 \item ``Non-player charcter'' that is the that represents the actual players in the system
209207 \item ``Notary'' that is the that agent type represents the agent in charge of controlling the flow of the game
210208\end{itemize}
···213211214212\begin{figure}[htp]
215213 \centering
216216- \includegraphics[keepaspectratio,scale=0.45]{pdt/images/architectural_design/aget-role_grouping.png}
217217- \label{fig:agentrole}
214214+ \includegraphics[keepaspectratio,scale=0.45]{pdt/images/architectural_design/aget-role_grouping.png}
218215 \caption{Agent-role grouping diagram}
216216+ \label{fig:agentrole}
219217\end{figure}
220218221219\subsection{Agent Acquaintance Diagram}
···224222225223\begin{figure}[htp]
226224 \centering
227227- \includegraphics[keepaspectratio,scale=0.45]{pdt/images/architectural_design/agent_acquaintance.png}
228228- \label{fig:agentacq}
225225+ \includegraphics[keepaspectratio,scale=0.45]{pdt/images/architectural_design/agent_acquaintance.png}
229226 \caption{Agent acquaintance diagram}
227227+ \label{fig:agentacq}
230228\end{figure}
231229232230\subsection{System Overview Diagram}
···236234\begin{figure}[htp]
237235 \centering
238236 \includegraphics[keepaspectratio,scale=0.45]{pdt/images/architectural_design/system_overview.png}
239239- \label{fig:sysovervw}
240237 \caption{System overview diagram}
238238+ \label{fig:sysovervw}
241239\end{figure}
242240243243-In the context of the system overview diagram, simple internal protocols are developed for the game to let agent communicate. Figure~\ref{fig:protocols} provides diagrams for them all.
241241+In the context of the system overview diagram, simple internal protocols are developed for the game to let agents communicate. Figure~\ref{fig:protocols} provides diagrams for them all.
244242245243\begin{figure}[htp]
246244 \centering
···250248 \subfloat[First bid protocol]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/protocols/First_bid_protocol.png}}
251249 \subfloat[Communication protocol]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/protocols/Communication_protocol.png}}\\
252250 \subfloat[Join the game protocol]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/protocols/Join_game_protocol.png}}
253253- \subfloat[Wake up dealer procotol]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/protocols/Wake_up_dealer_protocol.png}}
254254- \label{fig:protocols}
251251+ \subfloat[Wake up dealer procotol]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/protocols/Wake_up_dealer_protocol.png}}
255252 \caption{Protocols for agent coordination}
253253+ \label{fig:protocols}
256254\end{figure}
257255258256···265263266264\begin{figure}[htp]
267265 \centering
268268- \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/dealer_overview_diagram.png}
269269- \label{fig:dealer}
266266+ \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/dealer_overview_diagram.png}
270267 \caption{Agent overview diagram for the dealer agent}
268268+ \label{fig:dealer}
271269\end{figure}
272270\begin{figure}[htp]
273271 \centering
274272 \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/notary_overview_diagram.png}
275275- \label{fig:notary}
276273 \caption{Agent overview diagram for the notary agent}
274274+ \label{fig:notary}
277275\end{figure}
278276\begin{figure}[htp]
279277 \centering
280280- \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/gatekeeper_overview_diagram.png}
281281- \label{fig:gatekeeper}
278278+ \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/gatekeeper_overview_diagram.png}
282279 \caption{Agent overview diagram for the gatekeeper agent}
280280+ \label{fig:gatekeeper}
283281\end{figure}
284282\begin{figure}[htp]
285285- \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/non-player_character_overview_diagram.png}
286286- \label{fig:nonplay-char}
283283+ \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/non-player_character_overview_diagram.png}
287284 \caption{Agent overview diagram for the non-player character agent}
285285+ \label{fig:nonplay-char}
288286\end{figure}
289287290288···293291294292\begin{figure}[htp]
295293 \centering
296296- \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/dealing_capability_overview_diagram.png}
297297- \label{fig:dealing-cap}
294294+ \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/dealing_capability_overview_diagram.png}
298295 \caption{Capability overview diagram of the dealer agent}
296296+ \label{fig:dealing-cap}
299297\end{figure}
300298\begin{figure}[htp]
301299 \centering
···303301 \subfloat[End the game]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/end_the_game_capability_overview_diagram.png}}\\
304302 \subfloat[Start dealing]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/start_dealing_capability_overview_diagram.png}}
305303 \subfloat[Control bidding]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/control_bidding_capability_overview_diagram.png}}\\
306306- \subfloat[Count points]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/count_points_capability_overview_diagram.png}}
307307- \label{fig:notary-cap}
304304+ \subfloat[Count points]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/count_points_capability_overview_diagram.png}}
308305 \caption{Capability overview diagram of the notary agent}
306306+ \label{fig:notary-cap}
309307\end{figure}
310308\begin{figure}[htp]
311309 \centering
312310 \subfloat[Release player]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/release_player_capability_overview_diagram.png}}
313313- \subfloat[Join players]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/join_players_capability_overview_diagram.png}}
311311+ \subfloat[Join players]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/join_players_capability_overview_diagram.png}}
312312+ \caption{Capability overview diagram of the gatekeeper agent}
314313 \label{fig:gatekeeper-cap}
315315- \caption{Capability overview diagram of the gatekeeper agent}
316314\end{figure}
317315\begin{figure}[htp]
318316 \centering
···320318 \subfloat[Bidding]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/bidding_capability_overview_diagram.png}}\\
321319 \subfloat[Playing]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/playing_capability_overview_diagram.png}}\\
322320 \subfloat[Declare briscola]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/declare_briscola_capability_overview_diagram.png}}
323323- \subfloat[Join the game]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/join_to_game_capability_overview_diagram.png}}
324324- \label{fig:non-player-cap}
321321+ \subfloat[Join the game]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/join_to_game_capability_overview_diagram.png}}
325322 \caption{Capability overview diagram of the non-player character agent}
323323+ \label{fig:non-player-cap}
326324\end{figure}
327325328326\section{Prototype}\label{sec:proto}
···334332335333\begin{figure}[htp]
336334 \centering
337337- \includegraphics[keepaspectratio,scale=0.3]{fig/gui1.png}
338338- \label{fig:gui1}
335335+ \includegraphics[keepaspectratio,scale=0.3]{fig/gui1.png}
339336 \caption{Screenshot from the graphical user interface}
337337+ \label{fig:gui1}
340338\end{figure}
341339342340%The agents were designed separately using prolog, and saved in separate files depending on the strategy they were programmed to have.
343341Since there are five players in a Briscola Chiamata game, we were able to have up to five agents having different strategies fighting against each other and we would be able to see the victorious strategy.
344342%Even though Prolog is mainly used to create the agent, it is of limited use in the belief base and the usage of extra libraries could give the user more freedom when designing them (and stronger strategies too).
345343346346-The prototype however, as its name indicates, is merely a prototype and thus implements the most simplistic aspects . The agents were implemented to follow straight forward strategies with very little cooperation and even ``cheating'' in order to find their partners during a game round. It is worth mentioning that during the testing part, the 2APL parser was in most cases completely useless as the error messages it provides as feedback are unclear and unhelpful. This makes the task of perfectioning the prototype hard and tedious. %Finally it is worth mentioning that this prototype was built so that it could easily be extended. For example it could be extended into an application which accepts both human and agent players, and even further to be played using a network and/or the internet in order to fight other agents.
344344+The prototype however, as its name indicates, is merely a prototype and thus implements the most simplistic aspects . The agents were implemented to follow straight forward strategies with very little cooperation and even ``cheating'' in order to find their partners during a game round. %It is worth mentioning that during the testing part, the 2APL parser was in most cases completely useless as the error messages it provides as feedback are unclear and unhelpful. This makes the task of perfectioning the prototype hard and tedious. %Finally it is worth mentioning that this prototype was built so that it could easily be extended. For example it could be extended into an application which accepts both human and agent players, and even further to be played using a network and/or the internet in order to fight other agents.
347345348346We would have loved to add some of those more advanced features such as having completely radical strategies fighting each other, or even some form of reinforcement learning would have been fantastic to see in action, but time and the difficulty of extending things in 2APL have made it impossible for now.
349347···357355358356The negative aspects of 2APL are few, but certainly relevant. Firstly it is clearly a tool designed primarily for research and not for industry development. The documentation for 2APL is still relatively vague and requires some updating, while the examples given are few and sadly not fully detailed. The environment and the agents we built were done mostly by scanning the code of the blockworld example and thus we lacked the true ability to implement a full application (this was never our intention, but knowing that implementing a fully operational high scale piece of software would be made harder due to the poor support is worth mentioning).
359357360360-Even though declarative programming does give us a very powerful logic system, 2APL does lack to provide agents with the capability to compute things on their own. In its current state the designer is forced to have the environment calculate it for the agent, instead of allowing the agent to encapsulate the calculation method in its own code. Finally, even though it was previously mentioned, the 2APL parser was so unhelpful that it barely provided us with any useful information. Clearer instructions or error messages would be necessary if any serious development was to be made in this language.
358358+Even though declarative programming offers a powerful way to program agents, in our opinion, a good balance of the following two ingredients are still missing for the perfect receipt: the capability of integrating the declarative programming with imperative programming also on agent side (not only with the environment) and the availability of a set of extra libraries to make the life of a Prolog programmer easier. Finally, even though it was previously mentioned, clearer instructions or error messages would be necessary if any serious development was to be made in this language as well as a faster execution would be also appreciated.
361359362360So even though we praised 2APL for some things and despised it for others, as a whole we were pleased to develop with 2APL and do believe that with more work it can become the ``go to'' language of multi-agent systems, at least from a research point of view.
363361