1 | package genius.core.events;
|
---|
2 |
|
---|
3 | import java.util.List;
|
---|
4 |
|
---|
5 | import genius.core.Bid;
|
---|
6 | import genius.core.actions.Action;
|
---|
7 | import genius.core.parties.NegotiationPartyInternal;
|
---|
8 |
|
---|
9 | /**
|
---|
10 | * Agent did an action.
|
---|
11 | */
|
---|
12 | public class MultipartyNegoActionEvent implements NegotiationEvent {
|
---|
13 | private int round;
|
---|
14 | private int turn;
|
---|
15 | private double time; // current run time in seconds.
|
---|
16 | private List<NegotiationPartyInternal> parties;
|
---|
17 | private Bid agreement;
|
---|
18 | private Action action;
|
---|
19 |
|
---|
20 | /**
|
---|
21 | *
|
---|
22 | * @param action
|
---|
23 | * the action done by the agent
|
---|
24 | * @param round
|
---|
25 | * the current round number
|
---|
26 | * @param turn
|
---|
27 | * the turn within the round
|
---|
28 | * @param time
|
---|
29 | * the time, running from t = 0 (start) to t = 1 (deadline). The
|
---|
30 | * time is normalized, so agents need not be concerned with the
|
---|
31 | * actual internal clock.
|
---|
32 | *
|
---|
33 | * @param parties
|
---|
34 | * the discounted utils of the parties
|
---|
35 | * @param agreed
|
---|
36 | * the agreement {@link Bid} that the parties agreed on , or null
|
---|
37 | * if no agreement yet.
|
---|
38 | */
|
---|
39 | public MultipartyNegoActionEvent(Action action, int round, int turn, double time,
|
---|
40 | List<NegotiationPartyInternal> parties, Bid agreed) {
|
---|
41 | this.action = action;
|
---|
42 | this.round = round;
|
---|
43 | this.turn = turn;
|
---|
44 | this.time = time;
|
---|
45 | this.parties = parties;
|
---|
46 | this.agreement = agreed;
|
---|
47 | }
|
---|
48 |
|
---|
49 | /**
|
---|
50 | *
|
---|
51 | * @return the current round number
|
---|
52 | */
|
---|
53 | public int getRound() {
|
---|
54 | return round;
|
---|
55 | }
|
---|
56 |
|
---|
57 | /**
|
---|
58 | *
|
---|
59 | * @return the current turn within this round
|
---|
60 | */
|
---|
61 | public int getTurn() {
|
---|
62 | return turn;
|
---|
63 | }
|
---|
64 |
|
---|
65 | /**
|
---|
66 | *
|
---|
67 | * @return the time, running from t = 0 (start) to t = 1 (deadline). The
|
---|
68 | * time is normalized, so agents need not be concerned with the
|
---|
69 | * actual internal clock.
|
---|
70 | *
|
---|
71 | *
|
---|
72 | */
|
---|
73 | public double getTime() {
|
---|
74 | return time;
|
---|
75 | }
|
---|
76 |
|
---|
77 | public String toString() {
|
---|
78 | return "MultipartyNegotiationOfferEvent[" + action + " at " + round + " round]";
|
---|
79 | }
|
---|
80 |
|
---|
81 | public Action getAction() {
|
---|
82 | return action;
|
---|
83 | }
|
---|
84 |
|
---|
85 | public List<NegotiationPartyInternal> getParties() {
|
---|
86 | return parties;
|
---|
87 | }
|
---|
88 |
|
---|
89 | public Bid getAgreement() {
|
---|
90 | return agreement;
|
---|
91 | }
|
---|
92 |
|
---|
93 | }
|
---|