source: src/main/java/negotiator/parties/TimeoutNegotiationParty.java@ 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: 1.4 KB
Line 
1package negotiator.parties;
2
3import java.util.List;
4
5import genius.core.AgentID;
6import genius.core.actions.Accept;
7import genius.core.actions.Action;
8import genius.core.actions.ActionWithBid;
9import genius.core.parties.AbstractNegotiationParty;
10
11/**
12 * Agent that sleeps..
13 * <p/>
14 * The class was created as part of a series of agents used to understand the
15 * api better
16 *
17 * @author David Festen
18 */
19public class TimeoutNegotiationParty extends AbstractNegotiationParty {
20
21 /**
22 * If offer was proposed: Accept offer, otherwise: Propose random offer
23 *
24 * @param possibleActions
25 * List of all actions possible.
26 * @return Accept or Offer action
27 */
28 @Override
29 public Action chooseAction(final List<Class<? extends Action>> possibleActions) {
30
31 try {
32 Thread.sleep(Long.MAX_VALUE);
33 } catch (InterruptedException e) {
34 // do nothing
35 }
36
37 return new Accept(getPartyId(), ((ActionWithBid) getLastReceivedAction()).getBid());
38 }
39
40 /**
41 * We ignore any messages received.
42 *
43 * @param sender
44 * The initiator of the action
45 * @param arguments
46 * The action performed
47 */
48 @Override
49 public void receiveMessage(final AgentID sender, final Action arguments) {
50 super.receiveMessage(sender, arguments);
51 }
52
53 @Override
54 public String getDescription() {
55 return "Sleeping Party";
56 }
57
58}
Note: See TracBrowser for help on using the repository browser.