source: doc/userguide.tex@ 1

Last change on this file since 1 was 1, checked in by Wouter Pasman, 6 years ago

Initial import : Genius 9.0.0

File size: 83.2 KB
Line 
1
2% Created by Colin Williams on 2012-01-06.
3% Copyright (c) 2012 __MyCompanyName__. All rights reserved.
4%
5\documentclass[]{article}
6
7% Use utf-8 encoding for foreign characters
8\usepackage[utf8]{inputenc}
9
10% the page geometry.
11\usepackage[a4paper,top=2cm, bottom=2cm, left=1cm, right=1cm]{geometry}
12\usepackage{minibox}
13% Uncomment some of the following if you use the features
14%
15% Running Headers and footers
16%\usepackage{fancyhdr}
17
18% Multipart figures
19%\usepackage{subfigure}
20
21% More symbols
22%\usepackage{amsmath}
23%\usepackage{amssymb}
24%\usepackage{latexsym}
25
26% Surround parts of graphics with box
27\usepackage{boxedminipage}
28
29% Package for including code in the document
30\usepackage{listings}
31
32% If you want to generate a toc for each chapter (use with book)
33\usepackage{minitoc}
34
35% This is now the recommended way for checking for PDFLaTeX:
36\usepackage{ifpdf}
37\usepackage{comment}
38
39%\newif\ifpdf
40%\ifx\pdfoutput\undefined
41%\pdffalse % we are not running PDFLaTeX
42%\else
43%\pdfoutput=1 % we are running PDFLaTeX
44%\pdftrue
45%\fi
46
47
48\usepackage{array}
49\usepackage{url}
50\usepackage{listings}
51\usepackage{color}
52\usepackage{amsmath}
53\usepackage{mathtools}
54
55% clickable links in the contents section
56\usepackage{hyperref}
57\hypersetup{
58 colorlinks,
59 citecolor=black,
60 filecolor=black,
61 linkcolor=black,
62 urlcolor=black
63}
64
65
66\definecolor{dkgreen}{rgb}{0,0.6,0}
67\definecolor{gray}{rgb}{0.5,0.5,0.5}
68\definecolor{mauve}{rgb}{0.58,0,0.82}
69
70
71\newcommand*\vtick{\textsc{\char13}}
72
73\lstset{
74 language=Java,
75 tabsize=4,
76 showstringspaces=false,
77 basicstyle=\tt,
78 numberstyle=\tiny\color{gray}, % line number style
79 keywordstyle=\color{blue}, % keyword style
80 commentstyle=\color{dkgreen}, % comment style
81 stringstyle=\color{mauve}, % string literal style
82}
83
84\ifpdf
85\usepackage[pdftex]{graphicx}
86\else
87\usepackage{graphicx}
88\fi
89
90% this gives us \FloatBarrier to prevent images to float all to the end
91\usepackage{placeins}
92\newcommand\Genius{{\sc Genius\ }}
93
94% Alter some LaTeX defaults for better treatment of figures:
95 % See p.105 of "TeX Unbound" for suggested values.
96 % See pp. 199-200 of Lamport's "LaTeX" book for details.
97 % General parameters, for ALL pages:
98 \renewcommand{\topfraction}{0.9} % max fraction of floats at top
99 \renewcommand{\bottomfraction}{0.8} % max fraction of floats at bottom
100 % Parameters for TEXT pages (not float pages):
101 \setcounter{topnumber}{2}
102 \setcounter{bottomnumber}{2}
103 \setcounter{totalnumber}{4} % 2 may work better
104 \setcounter{dbltopnumber}{2} % for 2-column pages
105 \renewcommand{\dbltopfraction}{0.9} % fit big float above 2-col. text
106 \renewcommand{\textfraction}{0.07} % allow minimal text w. figs
107 % Parameters for FLOAT pages (not text pages):
108 \renewcommand{\floatpagefraction}{0.7} % require fuller float pages
109 % N.B.: floatpagefraction MUST be less than topfraction !!
110 \renewcommand{\dblfloatpagefraction}{0.7} % require fuller float pages
111
112 % remember to use [htp] or [htpb] for placement
113
114
115
116%===========================================================================
117\title{Using the \Genius Framework for Running Autonomous Negotiating Agents}
118\author{T. Baarslag, W. Pasman, K. Hindriks, D. Tykhonov}
119
120\date{\today}
121
122
123\begin{document}
124
125\ifpdf
126\DeclareGraphicsExtensions{.pdf, .jpg, .tif}
127\else
128\DeclareGraphicsExtensions{.eps, .jpg}
129\fi
130
131\maketitle
132
133
134\abstract{\noindent \Genius \cite{Genius}~is a negotiation environment that implements an open architecture for heterogeneous negotiating agents. \Genius~can be used to implement, or simulate, real life negotiations. This document describes how you can install the environment, work with the provided scenarios and negotiation agents, and write, compile, and run an agent yourself.}
135
136\pagebreak
137\tableofcontents
138
139\pagebreak
140
141
142%=========================================================================================
143\section{Theory Crash Course}
144This section provides a crash course on some essential theory needed to understand the negotiation system. Furthermore, it provides an overview of the features of a negotiation implemented in \Genius.
145
146\subsection{Negotiation Objects}
147Parties participating in a negotiation interact in a domain. The domain specifies the possible bids. The parties all have their own preferences, which is reflected in their profile. Figure~\ref{Fig:domain} shows a picture of a domain that describes the issues in the negotiation.
148
149\begin{figure}[htb]
150 \centering
151 \includegraphics[width=0.4\textwidth]{media/domain.png}
152 \caption{An example domain for laptop negotiation. Issues are orange, values are green}\label{Fig:domain}
153\end{figure}
154
155The \textit{Domain} describes which issues are the subject of the negotiation and which values an issue can attain. A domain contains $n$ issues: $D=(I_1,\ldots,I_n)$. Each issue $i$ consists of $k$ values: $I_i=(v^i_1,\ldots,v^i_k)$. Combining these concepts, an agent can formulate a \textit{Bid}: a mapping from each issue to a chosen value (denoted by $c$), $b=(v^i_{c},\ldots,v^n_{c})$.
156
157To give an example, in the laptop domain the issues are ``laptop'', ``harddisk'' and ``monitor''. In this domain the issues can only attain discrete values, e.g. the ``harddisk'' issue can only have the values ``60 Gb'', ``80 Gb'' and ``120 Gb''. These issues are all instance of \textit{IssueDiscrete}. A valid bid in the laptop domain is a Dell laptop with 80 Gb and a 17' inch monitor.
158
159The \textit{Utility Space} specifies the preferences of the bids for an agent using an evaluator. It is basically just a function that maps bids into a real number in the range [0,1] where 0 is the minimum utility and 1 is the maximum utility of a bid.
160
161A common form of the Utility space is the \textit{Additive Utility Space}. Such a space is additive because each of the issues in the domain have their own utility of their own. For instance, we like Apple with 0.7 and Dell with 0.4, completely independent of how much memory the computer has. Figure~\ref{Fig:utilspace} shows a picture of a utility space for the example domain that we gave above.
162
163\begin{figure}[htb]
164 \centering
165 \includegraphics[width=0.6\textwidth]{media/utilspace.png}
166 \caption{An example additive utility space for the laptop domain.}\label{Fig:utilspace}
167\end{figure}
168
169In an additive space the evaluator also specifies the importance of the issue relative to the other issues in the form of a weight. The weights of all issues sum up to 1.0 to simplify calculating the utility of a bid. The utility is the weighted sum of the scaled evaluation values.
170
171\begin{equation}
172 U(v^i_{c},\ldots,v^n_{c}) = \sum_{i=1}^{n} w_i \dfrac{\text{eval}(v^i_{c})}{\text{max}(\text{eval}(I_i))}
173 \label{eqn:Utility}
174\end{equation}
175
176
177\subsection{Optimality of a Bid}
178In general, given the set of all bids, there are a small subset of bids which are more preferred as outcomes by both agents. Identifying these special bids may lead to a better agreement for both parties.
179
180For a single agent, the optimal bid is of maximum utility for the agent. Often this bid has a low utility for the other party, and therefore the chance of agreement is low. A more general notion of optimality of a negotiation involves the utility of both agents.
181
182\begin{figure}[htb]
183 \centering
184 \includegraphics[width=0.37\textwidth]{media/image5.png}
185\caption{A point indicates the utility for both agents of a bid. The red line is the Pareto optimal frontier.}\label{Fig:utility plot}
186\end{figure}
187
188There are multiple ways to define a more global ``optimum''. One approach to optimality is that a bid is not optimal for both parties if there is another bid that has the higher utility for one party, and at least equal utility for the other party. Thus, only bids in Figure~\ref{Fig:utility plot} for which there is no other bid at the top right is optimal. This type of optimality is called Pareto optimality and forms an important concept in automated negotiation. The collection of Pareto optimal bids is called the Pareto optimal frontier.
189
190A major challenge in a negotiation is that agents can hide their preferences. This entails that an agent does not know which bid the opponent prefers given a set of bids. This problem can be partly resolved by building an \textit{opponent model} of the opponent's preferences by analyzing the negotiation trace. Each turn the agent can now offer the best bid for the opponent given a set of similar preferred bids. \Genius provides a number of components that can estimate an opponent model.
191
192\subsection{Negotiation Protocol}
193The negotiation protocol determines the overall order of actions during a negotiation. Agents are obliged to stick to this protocol, as deviations from the protocol are caught and penalized. \Genius supports multiple protocols. These are discussed in detail in section \ref{sec:protocols}.
194
195
196\subsection{Reservation Value}
197A reservation value is a real-valued constant that sets a threshold below which a rational agent should not accept any offers. Intuitively, a reservation value is the utility associated with the Best Alternative to a Negotiated Agreement (BATNA).
198
199A reservation value is the minimum acceptable utility, offers with a utility would normally not be accepted by an agent. Reservation values typically differ for each negotiation agent. In case no reservation value is set in a profile, it is assumed to be 0. Notice that if a negotiation ends with no agreement, agents normally get a utility of 0, regardless of the reservation value.
200
201\subsection{Time Pressure}
202A negotiation lasts a predefined time in seconds, or alternatively rounds. In \Genius~the time line is \emph{normalized}, i.e.: time $t \in [0, 1]$, where $t = 0$ represents the start of the negotiation and $t = 1$ represents the deadline. Notice that manipulation of the remaining time can be a factor influencing the outcome.
203
204There is an important difference between a time-based and rounds-based protocol. In a time-based protocol the computational cost of an agent should be taken into account as it directly influences the amount of bids which can be made. In contrast, for a rounds-based negotiation the time can be thought of as paused within a round; therefore computational cost does not play a role.
205
206Apart from a deadline, a scenario may also feature \emph{discount factors}. Discount factors decrease the utility of the bids under negotiation as time passes. While time is shared between both agents, the discount generally differs per agent.
207The default implementation of discount factors is as follows: let $d$ in $[0, 1]$ be the discount factor that is specified in the preference profile of an agent; let $t$ in $[0, 1]$ be the current normalized time, as defined by the timeline; we compute the discounted utility $U_D^t$ of an outcome $\omega$ from the undiscounted utility function $U$ as follows:
208\begin{eqnarray}
209U_D^t(\omega) = U(\omega) \cdot d^t
210\end{eqnarray}
211If $d = 1$, the utility is not affected by time, and such a scenario is considered to be undiscounted, while if $d$ is very small there is high pressure on the agents to reach an agreement. Note that discount factors are part of the preference profiles and therefore different agents may have a different discount factor.
212
213If a discount factor is present, reservation values will be discounted in exactly the same way as the utility of any other outcome. It is worth noting that, by having a discounted reservation value, it may be rational for an agent to end the negotiation early and thereby default to the reservation value.
214
215%=========================================================================================
216\section{Protocols}\label{sec:protocols}
217This section describes the various negotiation protocols. The protocol determines the overall order of actions during a negotiation.
218This section focuses on the MultiParty protocols as these have been properly developed. There is also a protocol class for the bilateral negotiation, but this is basically a hard coded Stacked Alternating Offers Protocol and not further developed.
219
220 The (Multilateral) protocol describes if the negotiation is finished, what the agreement is, which actions can be done in the next round. Briefly, to run a session the system checks with the protocol if the negotiation is already finished, and if not which calls need to be made to the parties (both chooseAction and receiveMessage). We recommend checking the javadoc of MultilateralProtocol for up-to-date detail information and how the protocol is used by the system to run sessions.
221
222 The Multilateral protocol uses the notion of rounds and turns to describe the negotiation layout. A round is a part of the negotiation where all participants get a turn to respond to the current state of the negotiation. A turn refers to the opportunity of one party to make a response to the current state of the negotiation.
223
224If an agent violates the protocol -- for instance by sending an action that is not one of the allowed ones, or by crashing, the negotiation ends and the outcome usually is 'no agreement' for all parties. In bilateral negotiation we have a special case then: the agent's utility is set to its reservation value, whereas the opponent is awarded the utility of the last offer.
225
226All protocols are found in the package \verb|genius.core.protocol| and have the names matching the subsections below.
227
228
229\subsection{Stacked Alternating Offers Protocol}
230According to this protocol \cite{MultilateralOffersProtocols} , all of the participants around the table get a turn per round. Turns are taken clock-wise around the table. One of the negotiating parties starts the negotiation with an offer that is observed by all others immediately. Whenever an offer is made, the next party in line gets a call to receiveMessage containing the bid, followed by a call to chooseAction from which it can return the following actions:
231\begin{itemize}
232\item Accept the offer (not available the very first turn).
233\item send an Offer to make a counter offer (thus rejecting and overriding the previous offer, if there was any)
234\item send an EndNegotiation and ending the negotiation without any agreement.
235\end{itemize}
236
237This protocol is the default protocol for Parties (as returned by getProtocol()).
238
239
240\subsection{Alternating Multiple Offers Protocol}
241According to this protocol \cite{MultilateralOffersProtocols} , all agents have a bid from all agents available to them, before they vote on these bids. This implemented in the following way: The protocol has a bidding phase followed by voting phases. In the bidding phase all participants put their offer on the table. These offers appear to all agents through receiveMessage() in a specific order. In the voting phases all participants vote on all of the bids on the negotiation table, in the same order as received. For each offer, the agent chooseAction() is called. If one of the bids on the negotiation table is accepted by all of the parties, then the negotiation ends with this bid.
242
243In each even round (we start in round 0), each party gets only one turn for an OfferForVoting.
244
245In each odd round there are N voting turns for each party (N being the number of offers), one for each offer in order of reception. these are the available options:
246\begin{itemize}
247\item Accept the offer
248\item Reject the offer
249\end{itemize}
250
251
252\subsection{Alternating Majority Consensus Protocol}
253
254This protocol is essentially equal to the Alternating Multiple Offers Protocol, but now an offer the protocol keeps track of the acceptable offer that got most accepts.
255Initially, this may be the first offer that got one accept. After a number of rounds, some offers receive multiple accepts and these then become the new acceptable offer.
256
257If an offer is accepted by all parties, the negotiation ends. Otherwise, the negotiation continues (unless the deadline is reached). If the deadline is reached, the acceptable offer becomes the agreement.
258
259
260\subsection{Simple Mediator Based Protocol}
261In this protocol, the parties do not hear the other parties directly. Instead, they only hear the mediator and the mediator hears the bids of all the parties. The mediator determines which bid will be voted on, collects the votes and determines the outcome. The mediator is just another NegotiationParty, but it extends Mediator.
262
263The protocol requires that exactly one party is a Mediator. The \Genius GUI enforces this presence of a Mediator. When you run a negotiation from the command line you have to ensure the presence of a single Mediator.
264
265This protocol uses the following turns in every round:
266\begin{enumerate}
267\item Mediator proposes an OfferForVoting
268\item The other parties (not the mediator) place a VoteForOfferAcceptance on the OfferForVoting
269\item The mediator makes a InformVotingResult that informs all parties about the outcome of this round.
270\end{enumerate}
271
272With this protocol, the last InformVotingResult with an accept determines the current outcome.
273
274As mentioned, you have to provide one mediator. There is the following options
275\begin{itemize}
276\item RandomFlippingMediator. This mediator generates random bids until all agents accept. Then, it
277 randomly flips one issue of the current offer to generate a new offer. It
278 keeps going until the deadline is reached.
279 \item FixedOrderFlippingMediator. This mediator behaves exactly like the RandomFlippingMediator, except that it uses a fixed-seed Random generator for every run. This makes it easier for testing.
280
281\end{itemize}
282
283\subsection{Mediator Feedback Based Protocol}
284Like the Simple Mediator Based Protocol, the parties do not hear the other parties directly. Instead, they only hear the mediator and the mediator hears the bids of all the parties. The mediator determines which bid will be voted on, collects the votes and determines the outcome. The mediator is just another NegotiationParty, but it extends Mediator.
285
286 The mediator generates its first bid randomly and sends it to the negotiating agents. After each bid, each party compares the mediator\vtick s new bid with his previous bid and gives feedback (`better', `worse' or `same') to the mediator. For its further bids, the mediator updates the previous bid, hopefully working towards some optimum. The negotiation runs on until the deadline (unless some party crashes). This protocol is explained in detail in \cite{MultiMediatedNegoProtocolsWithFeedback}.
287
288This protocol uses the following turns in every round:
289\begin{enumerate}
290\item Mediator proposes an OfferForFeedback.
291\item The other parties (not the mediator) place a GiveFeedback, indicateing whether the last bid placed by the mediator is better or worse than the previous bid.
292\end{enumerate}
293
294The accepted bid is the last bid that was not receiving a `worse' vote.
295
296\subsection{Beyond the Protocol}
297This section outlines the procedures for the parts of the session outside the scope of the protocol specification.
298
299Before the protocol can be started, the parties have to be loaded and initialized. During initialization, the party's persistent data may have to be loaded from a file. If the persistent data can not be read, a default empty dataset is created for the agent. Then the party's init code is called to set up the agent. All the time spent in this initialization phase is already being subtracted from the total available negotiation time.
300
301After the protocol has been completed, the protocol is called a last time to determine the final outcome.
302The parties are called to inform them that the negotiation ended, and what the outcome was. This happens even when agents crashed or did illegal actions. The negotiation has already finished, so these calls are not weighing in on the total negotiation time. Instead, these calls are typically limited to 1 second.
303
304Finally, if the agent has modified the persistent data, this data needs to be saved. Again, this action is limited to a 1 second duration.
305
306Errors surrounding these out-of-protocol procedures are not part of the negotiation itself and therefore logged and handled separately. These errors are printed only to the console/terminal \footnote{To see the console output, run from Eclipse or start up Genius from a separate terminal. }
307, and only from the single session runner.
308
309
310%=========================================================================================
311\section{Install and Run \Genius }
312\Genius can run on any machine running Java 8. Java 9 is not yet supported. Please report any bugs found to \url{negotiation@ii.tudelft.nl}.
313
314To install the environment, the file \texttt{genius-XXX.zip} can be downloaded from \url{http://ii.tudelft.nl/genius/?q=article/releases}. Unzip the file at a convenient location on your machine. This will result in a folder ``genius-XXX" containing the following files:
315
316\begin{itemize}
317 \item a \texttt{userguide.pdf} which is this document.
318 \item \texttt{genius-XXX.jar}, the \Genius negotiation simulator;
319 \item a few example folders, containing ready-to-compile agents and components.
320 \item a \texttt{multilateraltournament.xml} example file
321\end{itemize}
322
323You start \Genius by double-clicking the genius-XXX.jar file, or using "open with" and then selecting Java.
324
325 After starting the simulator a screen similar to Figure~\ref{Fig:negosimulator start} is shown. This screen is divided in three portions:
326
327\begin{itemize}
328 \item The \textbf{Menubar} allows us to start a new negotiation.
329 \item The \textbf{Components Window} shows all available scenarios, agents, and BOA components.
330 \item The \textbf{Status Window} shows the negotiation status or selected domain/preference profile.
331\end{itemize}
332
333\begin{figure}[htb]
334 \centering
335 \includegraphics[width=0.6\textwidth]{media/start.png}
336\caption{\Genius right after start-up. The left half is the components panel, the right half the status panel.}\label{Fig:negosimulator start}
337\end{figure}
338
339
340Progress messages and error messages are printed mainly to the standard output. On Mac OSX you can view these messages by opening the console window (double-click on Systemdisk/Applications/Utilities/Console.app). On Windows this is not directly possible. Console output can be read only if you start the application from the console window by hand, as follows. Go to the directory with the genius-XXX.jar and enter
341\texttt{java -jar genius-XXX.jar}.
342This will start the simulator, and all messages will appear in the console window. You may see some errors and warnings that are non-critical.
343
344In some rare cases, agents and scenarios require more memory than allocated by default to Java. This problem can be resolved by using the Xmx and Xms parameters when launching the executable jar, for example \texttt{java -Xmx1536M -Xms1536M -jar genius-XXX.jar}. But usually, if your agent runs out of memory then there is some design flaw or bug. Competitions usually are run with the default amount of java memory so it is recommended to ensure that your agent performs properly without requiring additional memory.
345
346Please refer to chapter \ref{sec:debugging} for instructions on running \Genius in debug mode to debug your agent.
347
348%=========================================================================================
349\section{Scenario Creation}
350A negotiation can be modeled in \Genius by creating a scenario. A scenario consists of a domain specifying the possible bids and a set of preference profiles corresponding to the preferences of the bids in the domain. This section discusses how to create a domain and a preference profile.
351
352
353\subsection{Creating a Domain}
354By right clicking on the list of available scenarios in the Components Window a popup menu with the option to create a new domain is shown. After clicking this option it is requested how the domain should be called. Next the domain is automatically created and a window similar to Figure~\ref{Fig:newdomain} is shown. Initially, a domain contains zero issues. We can simply add an issue by pressing the ``Add issue'' button. This results in the opening of a dialog similar to Figure~\ref{fig:createIssueD}.
355
356\begin{figure}[htb]
357 \centering
358 \includegraphics[width=0.9\textwidth]{media/exampledomain.png}
359\caption{\Genius after creating a new Example domain.}\label{Fig:newdomain}
360\end{figure}
361
362The current version of \Genius~supports the creation of discrete and integer issues. Starting with a discrete issue, the values of the issue should be specified. In Figure~\ref{fig:createIssueD} we show the values of the issue ``Harddisk''. Note the empty evaluation values window, later on when creating a preference profile we will use this tab to specify the preference of each value.
363
364Instead of a discrete issue, we can also add an integer issue as shown in Figure~\ref{fig:createIssueI}. For an integer issue we first need to specify the lowest possible value and the highest value, for example the price range for a second hand car may be $[500, 700]$. Next, when creating a preference profile we need to specify the utility of the lowest possible value (500) and the highest value (700). During the negotiation we can offer any value for the issue within the specified range.
365
366The next step is to press ``Ok'' to add the issue. Generally, a domain consists of multiple issues. We can simply add the other issues by repeating the process above. If you are satisfied with the domain, you can save it by pressing ``Save changes''.
367
368Finally, note that the issues of a domain can only be edited if the scenario does not (yet) specify preference profiles. This is to avoid inconsistencies between the preference profiles and the domains.
369
370\begin{figure}[ht]
371\center
372\begin{minipage}[b]{0.35\linewidth}
373 \includegraphics[width=0.95\textwidth]{media/image7a.png}
374\caption{Creating a discrete issue.}
375\label{fig:createIssueD}
376\end{minipage}
377\begin{minipage}[b]{0.55\linewidth}
378 \includegraphics[width=1.0\textwidth]{media/image7b.png}
379\caption{Creating an integer issue.}\label{fig:createIssueI}
380\end{minipage}
381\end{figure}
382
383\subsection{Creating a Preference Profile}
384Now that we created a domain, the next step is to add a set of preference profiles. Make sure that your domain is correct before proceeding, as \textbf{the domain can not be changed when it contains profiles}. By right clicking on the domain a popup menu is opened which has an option to create a new preference profile. Selecting this option results in the opening of a new window which looks similar to Figure~\ref{fig:utilcreated}.
385
386\begin{figure}[htb]
387 \centering
388 \includegraphics[width=0.8\textwidth]{media/laptop.png}
389\caption{\Genius after creating a new utility space.}\label{fig:utilcreated}
390\end{figure}
391
392Now you are ready to start customizing the preference profile. There are three steps: setting the importance of the issues, determining the preference of the values of the issues, and configuring the reservation value and discount. To start with the first step, you can adjust the relative weights of the issues by using the sliders next to that issue. Note that when you move a slider, the weights of the other sliders are automatically updated such that the all weights still sum up to one. If you do not want that the weight of another issue automatically changes, you can lock its weight by selecting the checkbox behind it. Now that we set the weights of the issues, it is a good idea to save the utility space.
393
394The next and final step is to set the evaluation of the issues. To specify the evaluation of an issue you can double click it to open a new window looking similar to Figure~\ref{fig:createIssueD} or Figure~\ref{fig:createIssueI} depending on the type of the issue.
395
396For a discrete issue we need to specify the evaluation value of each discrete value. A specific value can be assigned any positive non-zero integer as evaluation value. During the negotiation the utility of a value is determined by dividing the value by the highest value for that particular issue. To illustrate, if we give 60 Gb evaluation 5, 80 Gb evaluation 8, and 120 Gb evaluation 10; then the utilities of these values are respectively 0.5, 0.8, and 1.0.
397
398Specifying the preference of a integer issue is even easier. In this case we simply need to specify the utility of the lowest possible value and the highest possible value. The utility of a value in this range is calculated during the negotiation by using linear interpolation of the utilities of both given utilities.
399
400The final step is to set the reservation value and discount of a preference profile. If you are satisfied with the profile you can save it by pressing ``Save changes''. Finally, you can create additional preference profiles for the domain and run a negotiation.
401
402
403%=========================================================================================
404\section{Running Negotiations}
405This section discusses how to run a negotiation. There are two modes to run a negotiation:
406
407\begin{itemize}
408 \item \textbf{Session}. A single negotiation session in which a number of agents negotiate.
409 \item \textbf{Tournament}. A tournament of multiparty sessions.
410\end{itemize}
411
412you start one of these by selecting them from the Start menu (Figure \ref{Fig:negosimulator start}).
413
414Before going into detail on how each of these modes work, we first discuss the two types of agents that can be used: automated agents and non-automated agents. Automated agents are agents that can compete against other agents in a negotiation without relying on input by a user. In general, these agents are able to make a large amount of bids in a limited amount of time.
415
416In contrast, non-automated agents are agents that are fully controlled by the user. These types of agents ask the user each round which action they should make. \Genius~by default includes the UIAgent -- which has a simple user interface -- and the more extensive Extended UIAgent.
417
418
419\subsection{Running a Session}\label{sec:singlesessionrun}
420To run a negotiation session select the menu ``Start'' and then ``Session''. This opens a window similar to Figure~\ref{Fig:multipartysession}.
421
422\begin{figure}[h!]
423 \centering
424 \includegraphics[width=0.5\textwidth]{media/multipartysession.png}
425\caption{A multi-party negotiation session.}\label{Fig:multipartysession}
426\end{figure}
427
428The following parameters need to be specified to run a negotiation:
429
430\medskip
431\begin{minipage}{.8 \textwidth}
432\begin{itemize}
433 \item \textbf{Negotiation protocol}. The set of available protocols. See Chapter \ref{sec:protocols}.
434 \item \textbf{Mediator}. The mediator ID and strategy that is to be used for this session. This is only visible if the protocol uses a mediator.
435 \item \textbf{Participant Information}. The information (ID, strategy, profile) for the a party in the session. This information is copied into the table of participants when you click "Add Party".
436 \item \textbf{A table with participants}. This table shows all currently added participants. You can add a party by setting the participant information above, and then clicking "Add Party". You can remove a party by selecting the party to remove in the table, and then clicking "Remove Party".
437 \item \textbf{Deadline}. The deadline to use. Can be "Round" or "Time". This determines the maximum duration of the session.
438 \item \textbf{Data Persistency}. What kind of persistent data is available to the parties. The options are discussed in section \ref{sec:sessiongeneration}.
439 \item \textbf{Enable System.out print}. If disabled, all system.out.print is suppressed during the negotiation. This is useful if for instance agents are flooding the output console, slowing down the system.
440 \item \textbf{Enable progress graph}. If enabled (default), a progress chart is shown during the negotiation. You can disable this e.g. if the drawing is slowing down the system.
441\item \textbf{Bilateral options} These appear only if you have exactly 2 parties added. The sub-options of this panel are
442 \begin{itemize}
443 \item \textbf{Show Util-Util Graph}. If enabled, the progress panel will show a graph where the utilities of the 2 parties are set along the X and Y axes. Also, the pareto frontier and nash point are shown in this graph. If disabled, it will show the default: a graph where the utilities of all parties are along the Y axis, and the time along the X axis.
444 \item \textbf{Show all bids}. If enabled, and if 'Show Util-Util Graph' is enabled, this will show all the possible bids in the Util-Util graph.
445 \end{itemize}
446
447\end{itemize}
448\end{minipage}
449\medskip
450
451
452The negotiation is started when you press the start button. The tab contents will change to a progress overview panel
453showing you the results of the negotiation (Figure \ref{fig:biprogress} and Figure \ref{fig:multiprogress}). The results are also stored in a log file.
454 These results can be easily analyzed by importing them into Excel (cf. Section~\ref{sec:analysisExcel})
455
456 \begin{figure}[ht]
457 \center
458 \begin{minipage}[b]{0.4\linewidth}
459 \includegraphics[width=0.95\textwidth]{media/bilateralprogress.png}
460 \caption{Bilateral progress panel.}
461 \label{fig:biprogress}
462 \end{minipage}
463 \begin{minipage}[b]{0.4\linewidth}
464 \includegraphics[width=0.95\textwidth]{media/multilateralprogress.png}
465 \caption{Multilateral progress.}\label{fig:multiprogress}
466 \end{minipage}
467 \end{figure}
468
469
470\subsection{Running a Tournament}
471A tournament is a set of sessions. To prepare a tournament, select ``Start'' and then ``Tournament''.
472
473\begin{figure}[htb]
474 \centering
475 \includegraphics[width=0.7\textwidth]{media/multipartytournament.png}
476\caption{Tournament}\label{Fig:multipartytournament}
477\end{figure}
478
479The Tournament tab will appear similar to Figure~\ref{Fig:multipartytournament}. This panel shows a set of tournament options. The detailed meaning of all these settings is explained in \ref{sec:sessiongeneration}.
480
481\begin{itemize}
482 \item \textbf{Protocol}. The protocol to use for each session.
483 \item \textbf{Deadline}. The limits on time and number of rounds for each session.
484 \item \textbf{Number of tournaments}. The number of times the entire tournament will be run.
485 \item \textbf{Agents per Session}. The number of agents N to use for each session.
486 \item \textbf{Agent Repetition}. whether to draw parties with or without return.
487 \item \textbf{Randomize session order}. whether to randomize the session order
488 \item \textbf{Data persistency}. The type of persistent data available to the parties. Same options as in section \ref{sec:singlesessionrun}.
489 \item \textbf{Mediator}. The mediator to use. This option is visible only if the selected protocol needs a mediator.
490 \item \textbf{Agents}. The pool of agents to draw from. Click or drag in the agents area to (de)select agents. Click "Clear" to clear the pool.
491 \item \textbf{Profiles}. The profiles pool. Click or drag in the profiles area to (de)select agents. Click "Clear" to clear the pool.
492 \item \textbf{Special bilateral options}. These options appear only if Agents per session is set to 2 and is discussed in below .
493\end{itemize}
494
495
496
497\subsubsection{Bilateral special options}
498If you have set 'Agents per session' to 2, and deselect 'Agent play both sides', you get an additional panel where you can select different Agents and Profiles for the B side of the 2-sided negotiation as in Figure~\ref{Fig:multipartytournament2}.
499
500\begin{figure}[htb]
501 \centering
502 \includegraphics[width=0.7\textwidth]{media/multipartytournament2.png}
503\caption{Bilateral Tournament}\label{Fig:multipartytournament2}
504\end{figure}
505
506After you click "Start Tournament", the tournament starts. The panel then is swapped for a tournament progress panel (Figure \ref{Fig:tournamentprogress}).
507In the top there is a progress bar showing the total number of sessions and the current session. The table shows all session results. The table is also saved to a $.csv$ log file in the log directory.
508
509\begin{figure}[htb]
510 \centering
511 \includegraphics[width=0.9\textwidth]{media/tournamentprogress.png}
512\caption{Tournament Progress panel}\label{Fig:tournamentprogress}
513\end{figure}
514
515The results of the tournament are shown on screen and also stored in a log file. These results can be easily analyzed by importing them into Excel (cf. Section~\ref{sec:analysisExcel})
516
517
518\subsection{Running from the command line}
519You can run a multi-party tournament from the command line, as follows.
520
521\begin{enumerate}
522\item Prepare an xml file that describes the settings for the tournament
523\item Run the command runner and give it the prepared file
524\end{enumerate}
525
526\subsubsection{Prepare the XML settings file}
527The first step is to create an xml file containing the values needed for session generation (Section \ref{sec:sessiongeneration}).
528Make a copy of the \verb|multilateraltournament.xml| file inside your genius directory and edit it (with a plain text editor). Inside the \verb|<tournaments>| element you will find a number of \verb|<tournament>| elements. Each of these \verb|<tournament>| elements defines a complete tournament so you can run multiple tournaments using one xml file.
529
530The contents of each \verb|<tournament>| element is as follows. The meaning of the fields is detailed in section \ref{sec:sessiongeneration}.
531
532\begin{itemize}
533\item \textbf{protocolItem}. Contains the protocol to use, in the form of a protocolItem.
534\item \textbf{deadline}. the Deadline value.
535\item \textbf{repeats}. the repeats value.
536\item \textbf{persistentDataType}. The type of the persistent data.
537\item \textbf{numberOfPartiesPerSession}. the Parties per session value.
538\item \textbf{repetitionAllowed}. the value for the Party Repetition.
539\item \textbf{partyRepItems}. This element contains a number of \verb|<item>| elements. Each of these party items contains a description of a party as discussed below.
540\item \textbf{mediator}. the mediator, if needed. This is similar in contents to a party item discussed below.
541 \item \textbf{partyProfileItems}. This element contains a number of items. There must be at least as much as numberOfNonMediatorsPerSession.
542 \end{itemize}
543
544We have a number of items:
545\begin{itemize}
546
547\item A profile item : contains
548 \begin{itemize}
549 \item \textbf{url} that contains the description of that party profile. These URIs point to files and therefore are of the form \verb|file:path/to/file.xml|
550 \end{itemize}
551
552\item A party item (and mediator) contains:
553 \begin{itemize}
554 \item \textbf{classPath} the java.party.class.path to the main class. That class must implement the NegotiationParty interface
555 \item \textbf{properties} can contain a number of \verb|<property>| nodes with these values
556 \begin{itemize}
557 \item isMediator: this property indicates the party item is a mediator. If not set, the party will be
558 run as a normal party instead of a mediator, which will probably cause protocol violations
559 \end{itemize}
560 \end{itemize}
561
562\item protocol item. This item contains the protocol information:
563 \begin{itemize}
564 \item \textbf{hasMediator} which is true iff protocol requires mediator
565 \item \textbf{description} a one-line textual description of the mediator
566 \item \textbf{classPath} the java full.class.path of the protocol class
567 \item \textbf{protocolName} a brief protocol name
568 \end{itemize}
569\end{itemize}
570
571
572
573The tournament will consist of sessions created creating all permutations of \verb|<numberOfNonMediatorsPerSession>| from the partyRepItems (with or without reuse, depending on \textbf{repetitionAllowed}. The randomization also is applied to the profile items.
574
575
576\subsubsection{Run the tournament}
577To run the tournament, open a terminal/console and change the working directory to the genius directory.
578Then enter this command (where yourfile.xml is the name of the file you just edited and XXX the version of genius that you use):
579
580\vspace{0.5cm}
581\verb|java -cp genius-XXX-jar-with-dependencies.jar genius.cli.Runner yourfile.xml|
582\vspace{0.5cm}
583
584Press return if the app prompts you for the log file location to log to the default \verb|logs/...csv| file.
585
586\subsection{Tournament Session Generation}\label{sec:sessiongeneration}
587Instead of manually setting all the setting, a tournament generates the exact session settings from the tournament settings. These
588settings are specified either in the user interface settings, or in an XML file. The parameters are:
589
590\begin{itemize}
591\item \textbf{Protocol} The protocol value is used for all sessions. See section \ref{sec:protocols}.
592\item \textbf{Mediator} The mediator to use for all sessions (ignored if the protocol does not need a mediator)
593\item \textbf{Deadline} The deadline is used for all sessions. A deadline contains two values:
594 \begin{itemize}
595 \item \textbf{value}. This is the maximum value determining the deadline. Must be an integer $\ge 1$.
596 \item \textbf{type.} Can be either $ROUND$ or $TIME$. If $ROUND$, the value is the number of rounds. If $TIME$, value is a time in seconds.
597 \end{itemize}
598\item \textbf{Data persistency}. The type of persistent data available to the parties. The next time an agent of the same class and same profile runs in a tournament, it will receive the previously stored data. The options are
599 \begin{itemize}
600 \item \textbf{Disabled}. Parties do not receive any persistent data. This is the default.
601 \item \textbf{Serializable}. Parties can save anything serializable in the $PersistentDataContainer$.
602 \item \textbf{Standard}. Parties receive a prepared, read only StandardInfo object inside the $PersistentDataContainer$..
603 \end{itemize}
604\item \textbf{repeats} This is also called 'number of tournaments' and determines the number of times a complete tournament will be run.
605\item \textbf{Randomize Session Order} Whether all generated sessions within a tournament must be randomized.
606\item \textbf{Parties per session} The number of agents to draw for each session. This excludes a possible mediator.
607\item \textbf{Party Repetition} true if agents are to be drawn from the agents pool with return, false if they are to be drawn without return.
608\item \textbf{Parties and Profile pool for side A} A list from which parties and profiles will be drawn
609\item \textbf{Parties and Profile pool for side B} Another list of parties and profiles. Only used with bilateral generation (see below).
610\end{itemize}
611
612The tournament generation works as follows.
613
614If there are exactly 2 agents per session and the agents and profiles for side B have been set, then bilateral generation is used. Otherwise, multilateral generation is used. This generation method creates an ordered list of sessions for 1 tournament. If the 'Randomize Session Order' is set, the list is randomized. All sessions use the same protocol, mediator, deadline and data persistency.
615This generation is called repeatedly, as set in 'repeats', and all generated session lists are accumulated in a big session list. This is the final result of the tournament generation.
616
617\subsubsection{Multilateral generation}
618In multilateral generation, all possible combinations of parties and profiles (using pool A) are generated as follows. the indicated number of parties per session $N$ are drawn from agent pool A, with our without return as specified in 'Party Repetition'. Also, $N$ profile items are drawn, ordered without return, from the profiles pool. These two lists are then paired into groups of $N$ party-profile pairs.
619
620\subsubsection{Bilateral generation}
621In bilateral generation, first a set of participants P of all combinations of 1 party and 1 profile are drawn from the side A pool. Similarly a set of participants Q is drawn for the B pool. Then, the sessions set consists of all combinations of one participant from P and another participant from Q .
622
623
624
625
626
627%=========================================================================================
628\section{Quality Measures}\label{sec:qm}
629
630Genius logs quality measures to log files. Logs are written both in \verb|.csv| and \verb|.xml| format.
631Logs are written to the \verb|log/| directory. Filenames contain the date and time the session/tournament started.
632
633The output of the log files differs, depending on whether you ran a tournament or a single session. The following subsections discuss the output for these.
634
635Agent names are printed as follows. If the agent is a normal NegotiationParty, then the agent will print out as something like \verb|Atlas32016@2|. The part before the '@' is the agent name, the part after the '@' is added by the runner to make the name unique. If the agent is a BOA agent, the name is "boa-" followed by the concatenation of its offering strategy, acceptance condition, opponentmodel and omstrategy. For example you may get this as boa agent name:
636
637\begin{verbatim}
638boa-genkus.core.boaframework.offeringstrategy.anac2012.CUHKAgent_Offering-
639genius.core.boaframework.acceptanceconditions.anac2012.AC_CUHKAgent-
640genius.core.boaframework.opponentmodel.CUHKFrequencyModelV2-
641genius.core.boaframework.omstrategy.TheFawkes_OMS@3
642\end{verbatim}
643
644
645\subsection{Session logs}
646Both the XML and CSV log files from a session get the filename \verb|Log-Session_| followed by day and time. The contents however differ.
647
648\subsubsection{Session CSV file}
649 The \verb|.csv| file contains one line for each turn, like this:
650\verb|1,1,0.0055248618784530384,AgentHP2_main@0,(Offer bid:Bid[Food: Chips and Nuts, ...ials, ])|
651
652The columns are, in order:
653\begin{enumerate}
654\item round number.
655\item turn number
656\item the time of agreement, in the range [0,1] where 0 means the start of the session and 1 the maximum time/number of rounds allowed for the negotiation.
657\item the agent that acted.
658\item the action that the agent did. The action consists of the action type name ("Offer", "Accept", "EndNegotiation", etc) and the bid details if available.
659\end{enumerate}
660
661
662\subsubsection{Session XML file}
663When running a session, the XML file contains only the details of the final outcome of the negotiation.
664
665The fields in the \verb|NegotiationOutcome| element:\label{table:NegotiationOutcome}
666\begin{enumerate}
667\item currentTime: the moment when the final outcome was available.
668\item timeOfAgreement, agreement time in the range [0,1] where 0 means the start of the session and 1 the maximum time/number of rounds allowed for the negotiation.
669\item lastAction: the last action that was done
670\item the domain that was being run
671\item bids: the total number of bids that have been done in this session
672\item the total run time in seconds
673\item the outcome : the final accepted bid , or "-" if there was no final agreement
674\item the startingAgent,
675\item the deadline = maximum amount of time/rounds for this session.
676\end{enumerate}
677
678and then, for each of the agents that participated a "resultsOfAgent" element containing:
679\begin{enumerate}
680\item the agent name.
681\item the agent's description
682\item the agent's utilityspace filename
683\item the full agent class path
684\item the final utility (un-discounted) of this agent, or 0 if there was no agreement
685\item the final utility (discounted)
686\item the value of discount(1,1). This is the remaining utility that a un-discounted utility of 1 would have at the end time (t=1). For default discount formulas, this equals the 'discount factor'.
687\end{enumerate}
688
689
690Here's an example
691\begin{verbatim}
692<?xml version="1.0"?>
693<Session>
694 <NegotiationOutcome currentTime="Thu Mar 08 12:50:33 CET 2018"
695 timeOfAgreement="0.3425414364640884"
696 lastAction="(Accept bid:Bid[Food: Chips and Nuts, Drinks: Handmade ...oap, ])"
697 domain="etc/templates/partydomain/party_domain.xml" bids="175" runtime="0.652346172"
698 finalOutcome="Bid[Food: Chips and Nuts, Drinks: .....d Soap, ]"
699 startingAgent="-" deadline="180rounds">
700 <resultsOfAgent agent="AgentHP2_main@0" agentDesc="ANAC2016 agenthp2"
701 utilspace="etc/templates/partydomain/party1_utility.xml"
702 agentClass="agents.anac.y2016.agenthp2.AgentHP2_main"
703 finalUtility="0.8483333333333334" discountedUtility="0.8483333333333334" discount="1.0">
704 </resultsOfAgent>
705 <resultsOfAgent agent="AgentLight@1" agentDesc="ANAC2016 agentLight"
706 utilspace="etc/templates/partydomain/party2_utility.xml"
707 agentClass="agents.anac.y2016.agentlight.AgentLight"
708 finalUtility="0.8564909885811369" discountedUtility="0.8564909885811369" discount="1.0">
709 </resultsOfAgent>
710 <resultsOfAgent agent="Atlas32016@2" agentDesc="ANAC2016 Atlas3"
711 utilspace="etc/templates/partydomain/party3_utility.xml"
712 agentClass="agents.anac.y2016.atlas3.Atlas32016"
713 finalUtility="0.6924080946242358"
714 discountedUtility="0.6924080946242358" discount="1.0">
715 </resultsOfAgent>
716 </NegotiationOutcome>
717</Session>\end{verbatim}
718
719
720
721\subsection{Tournament logs}
722All log files from a tournament get the filename \verb|tournament-| followed by day and time followed by the domain name and an extension.
723There are 3 log files created: a log.csv file, a log.xml file and a logStats.xml file.
724
725If you terminate a tournament before it completes, the .log. files will be written up to the last completed session and there will be no logStats file.
726
727\subsubsection{Tournament log.csv file}
728
729tournament .csv files start with these a line containing \verb|sep=;| indicating that we use the comma as separator character for fields.
730Then there is a table header typically looking like this (if there are 3 parties in each session, and all this on 1 line)
731\begin{verbatim}
732Run time (s);Round;Exception;deadline;Agreement;Discounted;#agreeing;min.util.;max.util.;
733 Dist. to Pareto;Dist. to Nash;Social Welfare;
734 Agent 1;Agent 2;Agent 3;
735 Utility 1;Utility 2;Utility 3;
736 Disc. Util. 1;Disc. Util. 2;Disc. Util. 3;
737 Profile 1;Profile 2;Profile 3
738\end{verbatim}
739
740The rest of the log file contains one line for each final session outcome, matching the columns in the header:
741
742\begin{enumerate}
743\item the run time of that session (seconds).
744\item the number of rounds that were completed
745\item the exception message, if an exception occured
746\item the deadline = maximum amount of time/rounds for this session.
747\item whether an agreement was reached (Yes) or not (No).
748\item whether there was a discount factor (i.e. discount(1,1) is not 1) (Yes or No).
749\item the final number of agreeing parties
750\item the minimum utility achieved by the parties
751\item the maximum utility achieved by the parties
752\item the distance to the pareto curve (the nearest bidpoint on the pareto)
753\item the distance to the nash optimum point
754\item the distance to the social welfare point
755\item the names of all parties
756\item the un-discounted utilities of all parties
757\item the discounted utilities of all parties
758\item the profile names of all the parties
759\end{enumerate}
760
761
762For example, one line of the output can look like this (all on 1 line)
763
764\begin{verbatim}
7654.965;173;;180rounds;Yes;No;3;0.58083;0.95256;0.00000;0.44991;2.13706;
766ClockworkAgent@14;Farma@15;Caduceus@16;
7670.5808333333333333;0.6036696609166442;0.9525594478616071;
7680.5808333333333333;0.6036696609166442;0.9525594478616071;
769party1_utility.xml;party2_utility.xml;party3_utility.xml
770\end{verbatim}
771
772\subsubsection{Tournament log.xml file}
773
774The .log.xml file contains one \verb|<NegotiationOutcome>| element for each completed round.
775These elements are formatted exactly as in \ref{table:NegotiationOutcome}.
776
777\subsubsection{Tournament logStats.xml file}
778The logStats.xml file contains for each of the agents that participated in the tournament statistical info:
779
780\begin{enumerate}
781\item agentname: the agent name (full class path)
782\item totalUndiscounted: the total sum of the un-discounted utilities that it achieved
783\item totalDiscounted: the total sum of the discounted utilities that it achieved
784\item numberOfSessions: the total number of sessions that it participated in
785\item totalNashDist: the accumulated distances to the Nash Point
786\item totalWelfare: the accumulated distances to the Social Welfare Point
787\item totalParetoDistance: the accumulated distances to the Pareto frontier
788\item meanDiscounted: totalDiscounted / numberOfSessions
789\item meanUndiscounted: totalUndiscounted / numberOfSessions
790\item meanNashDistance: totalNashDistance / numberOfSessions
791\item meanWelfare: totalWelfare / numberOfSessions
792\item meanPareto: totalPareto / numberOfSessions
793\end{enumerate}
794
795
796%
797%
798%\subsection{Analyzing Logs using Excel}~\label{sec:analysisExcel}
799%The logs are in XML and CSV format, so we can easily analyze them with Excel. Note that the following discussion does not apply to the starter edition of Excel, as it does not support Pivot tables.
800%
801%The XML data of the standard log can be converted to a normal table by importing the data into Excel using the default options. This results in a large table showing the result for both agents A and B for each session. Analyzing these results manually is complicated, therefore we recommend to use pivot tables. Pivot tables allow to summarize a large set of data using statistics and can be created by selecting ``Insert'' and then ``Pivot Table''. To illustrate, by dragging the \textit{agentName} in ``Row Labels'' and the \textit{discountedUtility} in ``Values'' (see Figure~\ref{fig:pivottable}), we can easily see which agent scored best in the tournament. If solely the amount of matches of each agent is displayed, you need to set the ``Value Field Settings'' of \textit{discountedUtility} to average instead of count.
802%
803%\begin{figure}[htb]
804% \centering
805% \includegraphics[width=0.4\textwidth]{media/PivotTable.png}
806%\caption{Configuration required to summarize the discounted utility of each agent.}\label{fig:pivottable}
807%\end{figure}
808
809
810%=========================================================================================
811
812\section{Creating a Negotiation Party}\label{sec:createagent}
813To create an negotiation party, we suggest to follow the instructions in the Appendix and start with one of the examples.
814You can then proceed by changing the example.
815
816
817\subsection{Example agents}
818The \Genius zip file contains two examples: the Multiparty example and the Storage example. To compile an example, set up your workspace as in the appendix (Section \ref{sec:appendix}) and copy an example folder into \verb|src/|.
819
820The multiparty example just accepts any acceptable bid with a random probability of 0.5.
821
822The storage example demonstrates using the persistent data storage. This example is showing how the storage can be used to wait a little longer every next time the party is in a negotiation.
823
824To run this example, you need to set up \Genius to allow persistent data storage (the default is off). In the \Genius tournament setup panel, use the following settings
825\begin{itemize}
826\item number of tournaments= 20
827\item agents per session =2
828\item persistency=standard
829\item agent side A: GroupX, \verb|party1_utility.xml|
830\item agent side B: Random Party, \verb|party6_utility.xml|
831\end{itemize}
832
833and start the tournament and check the number of rounds till agreement: it will increase every session.
834
835Now run another tournament with the same settings but pick select both \verb|party1_utility.xml| and \verb|party2_utility.xml|. Run the tournament.
836Now you will see that the the number of rounds till agreement goes up every other run. This is because your agent gets a different profile every other run and thus there are persistent data stores, one for each profile.
837
838
839
840
841\subsection{Implementing NegotiationParty}
842This section discusses details of implementing a NegotiationParty.
843
844Every agent must at least implement the \texttt{genius.core.parties.NegotiationParty} interface (Table \ref{table:NegotiationPartyInterface}), Also the implementation must have a public default (no-argument) constructor. Please refer to the javadocs for details on the parameters.
845
846\begin{table*}[t]
847 \centering
848 \begin{tabular}{|p{4cm}|p{7cm}|}
849 \hline
850 Method & description \\
851 \hline\hline
852 init &Initializes the party, informing it of many negotiation details. This is be called exactly once by the negotiation system, immediately after construction of the class \\
853 chooseAction & When this function is called, it is expected that the Party chooses one of the actions from the possible action list and returns an instance of the chosen action. \\
854 receiveMessage & This method is called to inform the party that another NegotiationParty chose an Action.\\
855 getDescription & Returns a human-readable description for this party \\
856 getProtocol & The actual supported MultilateralProtocol. Usually this returns StackedAlternating\-Offers\-Protocol. Your agent should override this if it supports a another protocol\\
857 negotiationEnded & This is called to inform the agent that the negotiation has been ended. This allows the agent to record some final conclusions about the run\\
858 \hline
859 \end{tabular}
860 \caption{Methods of NegotiationParty. Check the javadoc for all the details}
861 \label{table:NegotiationPartyInterface}
862\end{table*}
863
864
865For convenience, you can also extend the class \texttt{genius.core.parties.AbstractNegotiationParty} which is a basic implementation of NegotiationParty. This class also provides convenient support functions for building your agent.
866
867Your agent might need to check the exact type of the provided AbstractUtilitySpace (inside NegotiationInfo), for instance if your agent supports for example only AdditiveutilitySpace.
868
869A number of useful classes is given in \ref{tab:agentclass}. The javadoc contains the full details of all available classes. We recommend to use the javadoc included with the distribution to check the details of all the involved classes. Notice that some classes, e.g. SortedOutcomeSpace, may take a long time and large amounts of memory to sort a large bid space, which may exceed the available time and space for your agent. Therefore these methods should be used with caution.
870
871
872
873
874\begin{table}[h]
875\begin{tabular}{m{0.9\textwidth}}
876\hline
877\texttt{NegotiationInfo}\\
878The context of the negotiation: the utility space, the timeline and deadline, the agentID and persistent data container.\\
879\hline
880\texttt{UtilitySpace}\\
881The preference profile of the scenario allocated to the agent. It is recommended to use this class when implementing a model of the opponent's preference profile.\\
882\hline
883\texttt{Timeline }\\
884Use timeline for every time-related by using \texttt{getTime()}.\\
885\texttt{Action chooseAction(List<Class<? extends Action>> possibleActions)}\\
886This function should return the action your agent wants to make next.\\
887\hline
888\texttt{Action}\\
889Superclass of negotiation actions like Offer, Accept and EndNegotiation..\\
890\hline
891\texttt{BidHistory}\\
892a structure to keep track of the bids presented by the agent and the opponent.\\
893\hline
894\texttt{SortedOutcomeSpace}\\
895a structure which stores all possible bids and their utilities by using BidIterator. In addition, it implements search algorithms that can be used to search the space of possible bids for bids near a given utility or within a given utility range. WARNING (1) SortedOutcomeSpace iterates over all bids and thus might be unusable in large bidspaces (2) Some agents have created their own copy of SortedOutcomeSpace, so be careful to pick the genius.core version. \\
896\hline
897\texttt{BidIterator}\\
898a class used to enumerate all possible bids. Also refer to \textit{SortedOutcomeSpace}.\\
899\hline
900\texttt{BidDetails}\\
901a structure to store a bid and its utility.\\
902\hline
903\end{tabular}
904
905\caption{Important classes used for creating a NegotiationParty.}
906\label{tab:agentclass}
907\end{table}
908
909\FloatBarrier
910
911\subsubsection{Receiving the Opponent's Action}\label{sec:receiveAction}
912The \texttt{ReceiveMessage(Action opponentAction)} informs you that the opponent just performed the action \texttt{opponentAction}. The \texttt{opponentAction} may be \texttt{null} if you are the first to place a bid, or an \texttt{Offer}, \texttt{Accept} or \texttt{EndNegotiation} action.
913The \texttt{chooseAction()} asks you to specify an \texttt{Action} to send to the opponent.
914
915In the SimpleAgent code, the following code is available for \texttt{receiveMessage}. The SimpleAgent stores the opponent's action to use it when choosing an action.
916
917\begin{lstlisting}
918public void receiveMessage(Action opponentAction) {
919 actionOfPartner = opponentAction;
920}
921\end{lstlisting}
922
923\subsubsection{Choosing an Action}\label{sec:chooseAction}
924The code block below shows the code of the method \texttt{chooseAction} for SimpleAgent. For safety, all code was wrapped in a try-catch block, because if our code would accidentally contain a bug we still want to return a good action (failure to do so is a protocol error and results in a utility of 0.0).
925
926The sample code works as follows. If we are the first to place a bid, we place a random bid with sufficient utility (see the .java file for the details on that). Else, we determine the probability to accept the bid, depending on the utility of the offered bid and the remaining time. Finally, we randomly accept or pose a new random bid.
927
928While this strategy works, in general it will lead to suboptimal results as it does not take the opponent into account. More advanced agents try to model the opponent's strategy or preference profile.
929
930\begin{lstlisting}
931public Action chooseAction() {
932 Action action = null;
933 Bid partnerBid = null;
934 try {
935 if (actionOfPartner == null)
936 action = chooseRandomBidAction();
937 if (actionOfPartner instanceof Offer) {
938 partnerBid = ((Offer) actionOfPartner).getBid();
939 double offeredUtilFromOpponent = getUtility(partnerBid);
940 double time = timeline.getTime();
941 action = chooseRandomBidAction();
942 Bid myBid = ((Offer) action).getBid();
943 double myOfferedUtil = getUtility(myBid);
944 // accept under certain circumstances
945 if (isAcceptable(offeredUtilFromOpponent, myOfferedUtil, time))
946 action = new Accept(getAgentID(), partnerBid);
947 }
948 if (timeline.getType().equals(Timeline.Type.Time)) {
949 sleep(0.005); // just for fun
950 }
951 } catch (Exception e) {
952 // best guess if things go wrong. Notice this may still fail
953 action = new Accept(getAgentID(), partnerBid);
954 }
955 return action;
956}
957\end{lstlisting}
958
959The method \textit{isAcceptable} implements the probabilistic acceptance function$P_\text{accept}$:
960
961\begin{equation}
962 P_\text{accept} = \dfrac{u - 2ut + 2\left(t - 1 + \sqrt{(t - 1)^2 + u(2t - 1)}\right)}{2t - 1}
963\end{equation}
964where $u$ is the utility of the bid made by the opponent (as measured in our utility space), and $t$ is the current time as a fraction of the total available time. Figure~\ref{Fig:Paccept} shows how this function behaves depending on the utility and remaining time. Note that this function only decides if a bid is acceptable or not. More advanced acceptance strategies also use the \texttt{EndNegotiation} action.
965\begin{figure}[htb]
966 \centering
967 \includegraphics[width=0.3\textwidth]{media/image21.png}
968 \caption{$P_\text{accept}$ value as function of the utility and time (as a fraction of the total available time).}\label{Fig:Paccept}
969\end{figure}
970
971
972
973\subsection{Loading a NegotiationParty}
974
975You need to load your custom party into the \Genius party repository in order to use it. After adding, your agent will appear in the combo boxes in the multilateral tournament runner and session runner where you can select the party to use.
976
977Locate the Parties repository tab in the GUI (Figure \ref{fig:partiesrepo}). Right click in this area and select "Add Party". A file browser panel pops up. Browse to your compiled \verb|.class| file that implements the NegotiationParty and select it. Typically Eclipse compiles into \verb|bin|. Your party will appear at the bottom of the parties repository. The \verb|partyrepository.xml| file is automatically updated accordingly.
978
979\begin{figure}[h!]
980 \center
981 \includegraphics[width=10cm]{media/partiesrepo.png}
982 \caption{The parties repository.}
983 \label{fig:partiesrepo}
984\end{figure}
985
986
987To do this manually without using the GUI, quit \Genius, open the \verb|partyrepository.xml| file \footnote{This file is automatically created the first time you run \Genius} and add a section like this
988
989\begin{lstlisting}
990<partyRepItem classPath="full.class.of.your.party" <properties/> />
991\end{lstlisting}
992
993After that you can restart \Genius so that it loads the new party.
994\FloatBarrier
995
996\subsection{Third party code}
997You should not use maven or jars to add dependencies for your agent. The reason is \Genius or other agents might already have another version of your library in use. Java 8 can not deal properly with multiple versions of the same library in within a JVM. The result would be inconsistent, incorrect or buggy behaviour, or even crashes.
998
999Instead, if you want to use a third party library, you will have to include all the source code of that library with your code, including all sub-dependencies. The code should be copied inside the package name of your agent, instead of using the original package name of that library (so do not use "org.apache" for instance). This is to ensure that we are really running your agent on the specific version of the library that your agent needs and to avoid version conflicts (java will run an unspecified version of the library in case of conficts).
1000
1001
1002%=========================================================================================
1003\section{Creating a BOA Agent}\label{sec:boa}
1004Instead of implementing your negotiating agent from scratch, you can create a BOA agent using the \textit{BOA framework}.
1005The BOA negotiation agent architecture allows to reuse existing components from other BOA agents. Many of the sophisticated agent strategies that currently exist are comprised of a fixed set of modules. Generally, a distinction can be made between four different modules: one module that decides whether the opponent's bid is acceptable (\textit{acceptance strategy}); one that decides which set of bids could be proposed next (\textit{bidding strategy}); one that tries to guess the opponent's preferences (\textit{opponent model}), and finally a component which specifies how the opponent model is used to select a bid for the opponent (\textit{opponent model strategy}). The overall negotiation strategy is a result of the interaction between these components.
1006
1007The advantages of separating the negotiation strategy into these four components (or equivalently, fitting an agent into the BOA framework) are threefold: first, it allows to \textit{study the performance of individual components}; second, it allows to \textit{systematically explore the space of possible negotiation strategies}; third, the reuse of existing components \textit{simplifies the creation of new negotiation strategies}.
1008
1009\begin{tabular}{|l|}
1010\hline
1011{\bf WARNING} \\
1012Many of the provided BOA components currently assume a single opponent party. \\
1013These will behave incorrectly when used with multiple opponents. \\
1014We recommend checking the source code of the BOA components you want to use, \\
1015or write your own components if you are creating a NegotiationParty.\\
1016\hline
1017\end{tabular}
1018
1019
1020\subsection{Components of the BOA Framework}
1021A negotiation agent in the BOA framework, called a \textit{BOA agent}, consists of four components:
1022\begin{description}
1023 \item[Bidding strategy] A bidding strategy is a mapping which maps a negotiation trace to a bid. The bidding strategy can interact with the opponent model by consulting with it.%, passing one or multiple bids and see how they compare within the opponent's utility space.
1024
1025 \item[Opponent model] An opponent model is in the BOA framework a learning technique that constructs a model of the opponent's preference profile.% In our approach, the opponent model should be able to estimate the opponent's utility of a given bid.
1026 \item[Opponent model strategy] An opponent model strategy specifies how the opponent model is used to select a bid for the opponent and if the opponent model may be updated in a specific turn.
1027 \item[Acceptance strategy] The acceptance strategy determines whether the opponent's bid is acceptable and may even decide to prematurely end the negotiation.
1028\end{description}
1029The components interact in the following way (the full process is visualized in Figure~\ref{fig:flowchart}). When receiving a bid, the BOA agent first updates the \textit{bidding history}. Next, the \textit{opponent model strategy} is consulted if the \textit{opponent model} may be updated this turn. If so, the \textit{opponent model} is updated.
1030
1031Given the opponent's bid, the \textit{bidding strategy} determines the counter offer by first generating a set of bids with a similar preference for the agent. The \textit{bidding strategy} uses the \textit{opponent model strategy} to select a bid from this set taking the opponent's utility into account.
1032
1033Finally, the \textit{acceptance strategy} decides whether the opponent's action should be accepted. If the opponent's bid is not accepted by the acceptance strategy, then the generated bid is offered instead.
1034
1035\begin{figure}[t]
1036 \center
1037 \includegraphics[width=15.0cm]{media/BOAflow.png}
1038 \caption{The BOA Framework Architecture.}
1039 \label{fig:flowchart}
1040\end{figure}
1041
1042\FloatBarrier
1043
1044\subsection{Create a BOA Party}
1045A boa agents can be edited in the "Boa Parties" repository tab (Figure \ref{fig:boaparties}). Right-click in the panel to add items. Select an item and right-click to remove or edit an item.
1046
1047
1048\begin{figure}[!ht]
1049 \center
1050 \includegraphics[width=10.0cm]{media/boacomponants.png}
1051 \caption{The BOA Parties repository tab.}
1052 \label{fig:boaparties}
1053\end{figure}
1054
1055
1056After you selected to add or edit a BOA party (Figure \ref{fig:editboaparty}). Here you can select a different Bidding Strategy, Acceptance Strategy, Opponent Model and Opponent Model Strategy by selecting the appropriate strategy with the combo boxes. If the strategy has parameters, the current parameter settings are shown and the respective "Change" button enables.
1057
1058
1059\begin{figure}[!ht]
1060 \center
1061 \includegraphics[width=10.0cm]{media/EditBoaParty.png}
1062 \caption{Editing a BOA party.}
1063 \label{fig:editboaparty}
1064\end{figure}
1065
1066If you click on the "Change" button, another panel pops up where you can edit the parameters (Figure \ref{fig:editparameters}). You can click directly in the table to edit values.
1067
1068\begin{figure}[!ht]
1069 \center
1070 \includegraphics[width=10.0cm]{media/EditParameters.png}
1071 \caption{Editing the Parameters of a BOA party.}
1072 \label{fig:editparameters}
1073\end{figure}
1074
1075When you have correctly set all strategies and their parameters, you can click the "OK" button in the BOA party editor (Figure \ref{fig:editboaparty}). Then, agents with the given name are generated, one for each permutation of the range of settings you set in the parameters. For example, if you set you want parameter m to have values 0,1 and 2 and x to have values 7 and 8, there will appear 6 new agents, with settings [0,7],[0,8],[1,7],[1,8],[2,7], and [2,8]. Be careful with this generation as it is easy to create an excessive amount of boa parties this way.
1076
1077\subsection{Set up a Workspace}
1078BOA components must be compiled before they can be loaded into Genius.
1079To compile a BOA component, follow the steps in (Section \ref{sec:appendix}). Then, create your BOA code into \verb|src|. For a quick start, you can copy the boaexample folder into \verb|src|. Eclipse automatically compiles your BOA components into \verb|bin|.
1080
1081Please refer to chapter \ref{sec:debugging} for instructions on running \Genius in debug mode to debug your components.
1082
1083\subsection{Creating BOA Components}
1084This section discusses how create your own components. An example implementation of each component is included in the ``boaexamplepackage'' folder. The next section discusses how these components can be added to the list of available components in the BOA framework GUI.
1085
1086
1087\subsubsection{Parameters}
1088All BOA components have the same mechanism to be tuned with parameters. They should have no constructor : the default empty constructor will be called. They initialize through a call to init().
1089
1090The parameters and their default parameters are indicated by the component by overriding the getParameters() function. This function should return a set of $BAOparameter$ objects, each parameter having a unique name, description and default value.
1091
1092
1093\begin{table}[h]
1094\begin{tabular}{m{0.9\textwidth}}
1095\hline
1096\texttt{public Set<BOAparameter> getParameterSpec() }\\
1097 Override this function to add parameters to the module.\\
1098\hline
1099\end{tabular}
1100\caption{The getParameters method. Override if your component has parameters.}
1101\label{tab:parameters}
1102\end{table}
1103
1104
1105When the component is actually used, the actual values for the parameters (which may differ from the default) are passed to the init function when the component is initialized.
1106
1107\subsubsection{Creating a Bidding Strategy}
1108A bidding strategy can be easily created by extending the \textit{OfferingStrategy} class. Table~\ref{tab:BOAbs} depicts the methods which need to be overridden. The \textit{init} method of the bidding strategy is automatically called by the BOA framework with four parameters: the negotiation session, the opponent model, the opponent model strategy, and the parameters of the component. The negotiation session object keeps track of the negotiation state, which includes all offers made by both agents, the timeline, the preference profile, and the domain. The parameters object specifies the parameters as specified in the GUI. In the previous section we specified the parameter $b$ for the acceptance strategy $Other - Next$ to be 0.0. In this case the agent can retrieve the value of the parameter by calling \textit{parameters.get(``b'')}.
1109
1110An approach often taken by many bidding strategies is to first generate all possible bids. This can be efficiently done by using the \textit{SortedOutcomeSpace} class. For an example on using this class see the \textit{TimeDependent\_Offering} class in the \textit{boaexamplepackage} directory.
1111
1112\begin{table}[h]
1113\begin{tabular}{m{0.9\textwidth}}
1114\hline
1115\texttt{void init(NegotiationSession negotiationSession, OpponentModel opponentModel,
1116 OMStrategy omStrategy, Map<String, Double> parameters)}\\
1117Method directly called after creating the agent which should be used to initialize the component.\\
1118\hline
1119\texttt{BidDetails determineOpeningBid()}\\
1120Method which determines the first bid to be offered to the component.\\
1121\hline
1122\texttt{BidDetails determineNextBid()}\\
1123Method which determines the bids offered to the opponent after the first bid.\\
1124\hline
1125\end{tabular}
1126\caption{The main methods of the bidding strategy component.}
1127\label{tab:BOAbs}
1128\end{table}
1129
1130
1131\subsubsection{Creating an Acceptance Condition}
1132This section discusses how to create an acceptance strategy class by extending the abstract class \textit{AcceptanceStrategy}. Table~\ref{tab:BOAas} depicts the two methods which need to specified.
1133
1134\begin{table}[h]
1135\begin{tabular}{m{0.9\textwidth}}
1136\hline
1137\texttt{void init(NegotiationSession negotiationSession, OfferingStrategy offeringStrategy,
1138 OpponentModel opponentModel, Map<String, Double> parameters)}\\
1139Method directly called after creating the agent which should be used to initialize the component.\\
1140\hline
1141\texttt{Actions determineAcceptability()}\\
1142Method which determines if the agent should accept the opponent's bid (\textit{Actions.Accept}), reject it and send a counter offer (\textit{Actions.Reject}), or leave the negotiation (\textit{Actions.Break}).\\
1143\hline
1144\end{tabular}
1145\caption{The main methods of the acceptance strategy component.}
1146\label{tab:BOAas}
1147\end{table}
1148
1149\subsubsection{Creating an Opponent Model}
1150This section discusses how to create an opponent model by extending the abstract class \textit{OpponentModel}. Table~\ref{tab:BOAom} provides an overview of the main methods which need to specified. For performance reasons it is recommended to use the \textit{UtilitySpace} class.
1151
1152\begin{table}[h]
1153\begin{tabular}{m{0.9\textwidth}}
1154\hline
1155\texttt{void init(NegotiationSession negotiationSession, Map<String, Double> parameters)}\\
1156Method directly called after creating the agent which should be used to initialize the component.\\
1157\hline
1158\texttt{double getBidEvaluation(Bid bid)}\\
1159Returns the estimated utility of the given bid.\\
1160\hline
1161\texttt{double updateModel(Bid bid)}\\
1162Updates the opponent model using the given bid.\\
1163\hline
1164\texttt{UtilitySpace getOpponentUtilitySpace()}\\
1165Returns the opponent's preference profile. Use the \textit{UtilitySpaceAdapter} class when not using the UtilitySpace class for the opponent's preference profile.\\
1166\hline
1167\end{tabular}
1168\caption{The main methods of the opponent model component.}
1169\label{tab:BOAom}
1170\end{table}
1171
1172\subsubsection{Creating an Opponent Model Strategy}
1173This section discusses how to create an opponent model strategy by extending the abstract class \textit{OMStrategy}. Table~\ref{tab:BOAoms} provides an overview of the main methods which need to specified.
1174
1175\begin{table}[h]
1176\begin{tabular}{m{0.9\textwidth}}
1177\hline
1178\texttt{void init(NegotiationSession negotiationSession, OpponentModel model, Map<String, Double> parameters)}\\
1179Method directly called after creating the agent which should be used to initialize the component.\\
1180\hline
1181\texttt{BidDetails getBid(List<BidDetails> bidsInRange);}\\
1182This method returns a bid to be offered from a set of given similarly preferred bids by using the opponent model.\\
1183\hline
1184\texttt{boolean canUpdateOM();}\\
1185Determines if the opponent model may be updated this turn.\\
1186\hline
1187\end{tabular}
1188\caption{The main methods of the opponent model strategy component.}
1189\label{tab:BOAoms}
1190\end{table}
1191
1192
1193
1194
1195\subsection{SessionData}
1196The BOA framework stores an object \textit{SessionData} that includes the data saved by all three components. This object is loaded and saved automatically by the BOA framework. A component can easily access the data it saved by using the \textit{loadData} method. A component can at each moment during the negotiation update the saved information by using the \textit{storeData} method, although we recommend updating the information at the end of the negotiation by using the the \textit{endSession} method. The \textit{endSession} method of each method is automatically called at the end of the negotiation to inform the component of the result obtained and should be used to update the \textit{SessionData} object before it is automatically stored.
1197
1198\subsection{Advanced: Converting a BOA Agent to an Agent}
1199To convert a BOA agent to a normal agent you have to create a class that extends \textit{BOA agent} and override the \textit{agentSetup} method. Below is an example of a BOA agent wrapped as a normal agent.
1200
1201\begin{lstlisting}
1202public class SimpleBOAagent extends BOAagent{
1203
1204 @Override
1205 public void agentSetup() {
1206 OpponentModel om = new FrequencyModel(negotiationSession, 0.2, 1);
1207 OMStrategy oms = new NullStrategy(negotiationSession);
1208 OfferingStrategy offering = new TimeDependent_Offering(
1209 negotiationSession, om, oms, 0.2, 0, 1, 0);
1210 AcceptanceStrategy ac =
1211 new AC_Next(negotiationSession, offering, 1, 0);
1212 setDecoupledComponents(ac, offering, om, oms);
1213 }
1214
1215 @Override
1216 public String getName() {
1217 return "SimpleBOAagent";
1218 }
1219}
1220\end{lstlisting}
1221
1222\subsection{Advanced: Multi-Acceptance Criteria (MAC)}
1223The \textit{BOA framework} allows us to better explore a large space of negotiation strategies. MAC can be used to scale down the negotiation space, and thereby make it better computationally explorable.
1224
1225As discussed in the introduction of this chapter, the acceptance condition determines solely if a bid should be accepted. This entails that it does not influence the bidding trace, except for when it is stopped. In fact, the only difference between \textit{BOA agents} where only the acceptance condition vary, is the time of agreement (assuming that the computational cost of the acceptance conditions are negligible).
1226
1227Given this property, multiple acceptance criteria can be tested in parallel during the same negotiation trace. In practice, more than 50 variants of a simple acceptance condition as for example $\textbf{AC}_{next}$ can be tested in the same negotiation at a negligible computational cost.
1228
1229To create a multi-acceptance condition component you first need to extend the class \textit{Mulit Acceptance Condition}, this gives access to the ACList which is a list of acceptance conditions to be tested in parallel. Furthermore, the method \textit{isMac} should be overwritten to return \textit{true} and the name of the components in the repository should be \textit{Multi Acceptance Criteria}. An acceptance can be added to the MAC by appending it to the AClist as shown below.
1230
1231\begin{lstlisting}[language=Java, caption={Example code for Acceptance condition}]
1232public class AC_MAC extends Multi_AcceptanceCondition {
1233 @Override
1234 public void init(NegotiationSession negoSession,
1235 OfferingStrategy strat, OpponentModel opponentModel,
1236 HashMap<String, Double> parameters) throws Exception {
1237 this.negotiationSession = negoSession;
1238 this.offeringStrategy = strat;
1239 outcomes = new ArrayList<OutcomeTuple> ();
1240 ACList = new ArrayList<AcceptanceStrategy>();
1241 for (int e = 0; e < 5; e++) {
1242 ACList.add(new AC_Next(negotiationSession,
1243 offeringStrategy, 1, e * 0.01));
1244 }
1245 }
1246}
1247\end{lstlisting}
1248
1249
1250
1251
1252%=========================================================================================
1253
1254\section{Debugging}\label{sec:debugging}
1255This section explains how to debug your agent using Eclipse. It is assumed you set up your agent already as in Chapter \ref{sec:createagent}.
1256
1257To run or debug your agent as it runs in Genius, right click on the project root and select Run As.../Java Application. Then select \verb|Application - genius| and click ok.
1258
1259Once you have Genius running in Eclipse, you can simply place a breakpoint in your agent and run Genius from Eclipse in debug mode.
1260
1261\subsection{Source code and javadocs}
1262The genius core source codes and javadocs are included in the genius.jar file. But if you like you can browse and download all sources at \url{https://tracinsy.ewi.tudelft.nl/trac/Genius}.
1263
1264\FloatBarrier
1265
1266
1267
1268
1269
1270
1271\section{Conclusion}
1272This concludes the manual of \Genius. If you experience problems or have suggestions on how to improve \Genius, please send them to \url{negotiation@ii.tudelft.nl}.
1273
1274\Genius\ is actively used in academic research. If you want to cite \Genius\ in your paper, please refer to \cite{Genius}.
1275
1276%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1277
1278\newpage
1279\section{Appendix}
1280This appendix describes how to set up Eclipse to create and debug your own agent.
1281
1282\label{sec:appendix}
1283
1284\subsection{Connect Genius to Eclipse}
1285\label{sec:appendix-run-genius}
1286We expect that you installed Eclipse (Neon or higher) and Java version 8 on your computer.
1287\begin{enumerate}
1288
1289\item Open the Eclipse Navigator with the menu Window/Show View/Navigator. You can close the Package Explorer.
1290
1291\item Right click in the Navigator area and select New/Java Project. Create a new Java project. We name it \texttt{Group3assignment} but you can use any convenient name. Make sure you select "JavaSE-1.8" or equivalent to ensure your code will be java 8 compatible (Figure \ref{fig:run-genius-1}). Click Finish.
1292
1293\begin{figure}[h!]
1294 \centering
1295 \includegraphics[width=0.5\textwidth]{media/dialogNewJavaProject.png}
1296 \caption{Create a new java project with the proper name and settings.}
1297 \label{fig:run-genius-1}
1298\end{figure}
1299
1300\item Drag the genius.jar file (from your unzipped download) into the project in the Eclipse Navigator area. Select "Copy files" and press OK.
1301
1302\FloatBarrier
1303
1304\item{Connect \texttt{genius} Jar:
1305 \begin{enumerate}
1306 \item Right click on the \texttt{Group3assignment} icon and select "Properties".
1307 \item Select the Java Build Path.
1308 \item Select the Libraries Tab.
1309 \item Select "Add JARs", in the JAR Selection window (Figure \ref{fig:run-genius-3}).
1310 \item Open the \texttt{Group3assignment} folder and scroll down to select \texttt{genius.jar}.
1311 \item click a few times ok to close all dialog boxes.
1312 \end{enumerate}
1313 }
1314
1315\begin{figure}[h!]
1316 \centering
1317 \includegraphics[width=0.6\textwidth]{media/selectjar.png}
1318 \caption{Attach the negosimulator jar to the project.}
1319 \label{fig:run-genius-3}
1320\end{figure}
1321
1322
1323
1324\item Now you can run G\textsc{enius} as a Java application, by launching it as a \texttt{Application} (Figure \ref{fig:startgenius}). To do this, right click on the project, select \texttt{Run As}, select \texttt{Java Application} and then in the browser select \texttt{Application - genius}.
1325
1326\begin{figure}[h!]
1327 \centering
1328 \includegraphics[width=0.6\textwidth]{media/startup.png}
1329 \caption{Starting Genius in Eclipse.}
1330 \label{fig:startgenius}
1331\end{figure}
1332\end{enumerate}
1333
1334\FloatBarrier
1335
1336\subsection{Insert example party}
1337To compile an example party, just drag an example folder, eg storageexample, from your unzipped genius download entirely into the src folder in Eclipse. Select "Copy files and folders" and click ok.
1338
1339\subsection{Debugging}
1340Once you have Genius running in Eclipse, you can simply place a breakpoint in your agent and run Genius from Eclipse in debug mode.
1341
1342
1343
1344
1345\bibliographystyle{plain}
1346\bibliography{genius}
1347
1348\end{document}
Note: See TracBrowser for help on using the repository browser.