2-APL UPC project.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

final doc

fdesan 8ebdcaa3 a8370406

+39 -41
+39 -41
docs/briscola_chiamata/bc-doc.tex
··· 109 109 \hline 110 110 Scoring updated & Release the players \\ 111 111 \hline 112 - \end{tabular} 112 + \end{tabular} 113 + \caption{Summary of percepts and actions in the system} 113 114 \label{table:inout} 114 - \caption{Summary of percepts and actions in the system} 115 115 \end{table} 116 116 117 + Figure~\ref{fig:analysis} provides the analysis overview diagram for our game. 117 118 118 119 \begin{figure}[htp] 119 120 \centering 120 121 \includegraphics[keepaspectratio,scale=0.4]{pdt/images/system_specification/analysis_overview.png} 121 - \label{fig:analysis} 122 122 \caption{Analysis overview diagram} 123 + \label{fig:analysis} 123 124 \end{figure} 124 - 125 - Figure~\ref{fig:analysis} provides the analysis overview diagram for our game. 126 - 127 125 128 126 \subsection{Scenarios Diagram} 129 127 ··· 131 129 132 130 \begin{figure}[htp] 133 131 \centering 134 - \includegraphics[keepaspectratio,scale=0.5]{pdt/images/system_specification/scenarios.png} 135 - \label{fig:scenarios} 132 + \includegraphics[keepaspectratio,scale=0.5]{pdt/images/system_specification/scenarios.png} 136 133 \caption{Scenarios diagram} 134 + \label{fig:scenarios} 137 135 \end{figure} 138 136 139 137 \subsection{Goals Diagram} ··· 142 140 143 141 \begin{figure}[htp] 144 142 \centering 145 - \includegraphics[keepaspectratio,scale=0.45]{pdt/images/system_specification/goal_overview.png} 146 - \label{fig:goals} 143 + \includegraphics[keepaspectratio,scale=0.45]{pdt/images/system_specification/goal_overview.png} 147 144 \caption{Goals diagram} 145 + \label{fig:goals} 148 146 \end{figure} 149 147 150 148 \subsection{System Roles Diagram} ··· 167 165 \begin{figure}[htp] 168 166 \centering 169 167 \includegraphics[keepaspectratio,scale=0.4]{pdt/images/system_specification/system_roles.png} 170 - \label{fig:sysroles} 171 168 \caption{System roles diagram} 169 + \label{fig:sysroles} 172 170 \end{figure} 173 171 174 172 \newpage ··· 194 192 195 193 \begin{figure}[htp] 196 194 \centering 197 - \includegraphics[keepaspectratio,scale=0.45]{pdt/images/architectural_design/data_coupling.png} 198 - \label{fig:datacoupl} 195 + \includegraphics[keepaspectratio,scale=0.45]{pdt/images/architectural_design/data_coupling.png} 199 196 \caption{Data coupling diagram} 197 + \label{fig:datacoupl} 200 198 \end{figure} 201 199 202 200 \subsection{Agent-Role Grouping Diagram} ··· 204 202 In 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: 205 203 \begin{itemize} 206 204 \item ``Dealer'' that is the that represents the dealer that is in charge of dealing cards 207 - \item ``Gatekeeper'' that is the that represents the agent that let the players come in and out the system 205 + \item ``Gatekeeper'' that is the that represents the agent that let players come in and out the system 208 206 \item ``Non-player charcter'' that is the that represents the actual players in the system 209 207 \item ``Notary'' that is the that agent type represents the agent in charge of controlling the flow of the game 210 208 \end{itemize} ··· 213 211 214 212 \begin{figure}[htp] 215 213 \centering 216 - \includegraphics[keepaspectratio,scale=0.45]{pdt/images/architectural_design/aget-role_grouping.png} 217 - \label{fig:agentrole} 214 + \includegraphics[keepaspectratio,scale=0.45]{pdt/images/architectural_design/aget-role_grouping.png} 218 215 \caption{Agent-role grouping diagram} 216 + \label{fig:agentrole} 219 217 \end{figure} 220 218 221 219 \subsection{Agent Acquaintance Diagram} ··· 224 222 225 223 \begin{figure}[htp] 226 224 \centering 227 - \includegraphics[keepaspectratio,scale=0.45]{pdt/images/architectural_design/agent_acquaintance.png} 228 - \label{fig:agentacq} 225 + \includegraphics[keepaspectratio,scale=0.45]{pdt/images/architectural_design/agent_acquaintance.png} 229 226 \caption{Agent acquaintance diagram} 227 + \label{fig:agentacq} 230 228 \end{figure} 231 229 232 230 \subsection{System Overview Diagram} ··· 236 234 \begin{figure}[htp] 237 235 \centering 238 236 \includegraphics[keepaspectratio,scale=0.45]{pdt/images/architectural_design/system_overview.png} 239 - \label{fig:sysovervw} 240 237 \caption{System overview diagram} 238 + \label{fig:sysovervw} 241 239 \end{figure} 242 240 243 - 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. 241 + 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. 244 242 245 243 \begin{figure}[htp] 246 244 \centering ··· 250 248 \subfloat[First bid protocol]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/protocols/First_bid_protocol.png}} 251 249 \subfloat[Communication protocol]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/protocols/Communication_protocol.png}}\\ 252 250 \subfloat[Join the game protocol]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/protocols/Join_game_protocol.png}} 253 - \subfloat[Wake up dealer procotol]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/protocols/Wake_up_dealer_protocol.png}} 254 - \label{fig:protocols} 251 + \subfloat[Wake up dealer procotol]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/protocols/Wake_up_dealer_protocol.png}} 255 252 \caption{Protocols for agent coordination} 253 + \label{fig:protocols} 256 254 \end{figure} 257 255 258 256 ··· 265 263 266 264 \begin{figure}[htp] 267 265 \centering 268 - \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/dealer_overview_diagram.png} 269 - \label{fig:dealer} 266 + \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/dealer_overview_diagram.png} 270 267 \caption{Agent overview diagram for the dealer agent} 268 + \label{fig:dealer} 271 269 \end{figure} 272 270 \begin{figure}[htp] 273 271 \centering 274 272 \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/notary_overview_diagram.png} 275 - \label{fig:notary} 276 273 \caption{Agent overview diagram for the notary agent} 274 + \label{fig:notary} 277 275 \end{figure} 278 276 \begin{figure}[htp] 279 277 \centering 280 - \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/gatekeeper_overview_diagram.png} 281 - \label{fig:gatekeeper} 278 + \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/gatekeeper_overview_diagram.png} 282 279 \caption{Agent overview diagram for the gatekeeper agent} 280 + \label{fig:gatekeeper} 283 281 \end{figure} 284 282 \begin{figure}[htp] 285 - \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/non-player_character_overview_diagram.png} 286 - \label{fig:nonplay-char} 283 + \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/non-player_character_overview_diagram.png} 287 284 \caption{Agent overview diagram for the non-player character agent} 285 + \label{fig:nonplay-char} 288 286 \end{figure} 289 287 290 288 ··· 293 291 294 292 \begin{figure}[htp] 295 293 \centering 296 - \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/dealing_capability_overview_diagram.png} 297 - \label{fig:dealing-cap} 294 + \includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/dealing_capability_overview_diagram.png} 298 295 \caption{Capability overview diagram of the dealer agent} 296 + \label{fig:dealing-cap} 299 297 \end{figure} 300 298 \begin{figure}[htp] 301 299 \centering ··· 303 301 \subfloat[End the game]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/end_the_game_capability_overview_diagram.png}}\\ 304 302 \subfloat[Start dealing]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/start_dealing_capability_overview_diagram.png}} 305 303 \subfloat[Control bidding]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/control_bidding_capability_overview_diagram.png}}\\ 306 - \subfloat[Count points]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/count_points_capability_overview_diagram.png}} 307 - \label{fig:notary-cap} 304 + \subfloat[Count points]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/count_points_capability_overview_diagram.png}} 308 305 \caption{Capability overview diagram of the notary agent} 306 + \label{fig:notary-cap} 309 307 \end{figure} 310 308 \begin{figure}[htp] 311 309 \centering 312 310 \subfloat[Release player]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/release_player_capability_overview_diagram.png}} 313 - \subfloat[Join players]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/join_players_capability_overview_diagram.png}} 311 + \subfloat[Join players]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/join_players_capability_overview_diagram.png}} 312 + \caption{Capability overview diagram of the gatekeeper agent} 314 313 \label{fig:gatekeeper-cap} 315 - \caption{Capability overview diagram of the gatekeeper agent} 316 314 \end{figure} 317 315 \begin{figure}[htp] 318 316 \centering ··· 320 318 \subfloat[Bidding]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/bidding_capability_overview_diagram.png}}\\ 321 319 \subfloat[Playing]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/playing_capability_overview_diagram.png}}\\ 322 320 \subfloat[Declare briscola]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/declare_briscola_capability_overview_diagram.png}} 323 - \subfloat[Join the game]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/join_to_game_capability_overview_diagram.png}} 324 - \label{fig:non-player-cap} 321 + \subfloat[Join the game]{\includegraphics[keepaspectratio,scale=0.45]{pdt/images/detailed_design/join_to_game_capability_overview_diagram.png}} 325 322 \caption{Capability overview diagram of the non-player character agent} 323 + \label{fig:non-player-cap} 326 324 \end{figure} 327 325 328 326 \section{Prototype}\label{sec:proto} ··· 334 332 335 333 \begin{figure}[htp] 336 334 \centering 337 - \includegraphics[keepaspectratio,scale=0.3]{fig/gui1.png} 338 - \label{fig:gui1} 335 + \includegraphics[keepaspectratio,scale=0.3]{fig/gui1.png} 339 336 \caption{Screenshot from the graphical user interface} 337 + \label{fig:gui1} 340 338 \end{figure} 341 339 342 340 %The agents were designed separately using prolog, and saved in separate files depending on the strategy they were programmed to have. 343 341 Since 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. 344 342 %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). 345 343 346 - 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. 344 + 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. 347 345 348 346 We 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. 349 347 ··· 357 355 358 356 The 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). 359 357 360 - 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. 358 + 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. 361 359 362 360 So 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. 363 361