source: src/main/java/genius/core/NegotiationResult.java@ 256

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

#41 ROLL BACK of rev.126 . So this version is equal to rev. 125

File size: 1.2 KB
Line 
1package genius.core;
2
3import genius.core.actions.Accept;
4import genius.core.actions.Action;
5
6public class NegotiationResult {
7
8 /** The utility received by the agent at the end of the negotiation. */
9 private final double myDiscountedUtility;
10 /** The last action conducted in the negotiation. */
11 private final Action lastAction;
12 /** The last bid in the negotiation. */
13 private final Bid lastBid;
14
15 public NegotiationResult(double myDiscountedUtility, Action lastAction, Bid lastBid) {
16 this.myDiscountedUtility = myDiscountedUtility;
17 this.lastAction = lastAction;
18 this.lastBid = lastBid;
19 }
20
21 /**
22 * @return true when the match ended in acceptance.
23 */
24 public boolean isAgreement() {
25 return lastAction instanceof Accept;
26 }
27
28 /**
29 * @return the utility received at the end of the negotiation.
30 */
31 public double getMyDiscountedUtility() {
32 return myDiscountedUtility;
33 }
34
35 /**
36 * @return last action executed in the negotiation.
37 */
38 public Action getLastAction() {
39 return lastAction;
40 }
41
42 /**
43 * @return last bid offered in the negotiation.
44 */
45 public Bid getLastBid() {
46 return lastBid;
47 }
48
49 public String toString() {
50 return myDiscountedUtility + "\n" + lastAction + "\n" + lastBid;
51 }
52}
Note: See TracBrowser for help on using the repository browser.