source: src/test/java/agents/nastyagent/Accepter.java@ 127

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

Initial import : Genius 9.0.0

File size: 628 bytes
Line 
1package agents.nastyagent;
2
3import java.util.List;
4
5import genius.core.actions.Accept;
6import genius.core.actions.Action;
7import genius.core.actions.ActionWithBid;
8import genius.core.actions.Offer;
9
10/**
11 * Accepts blindly if other side made an offer. Offers first available bid
12 * otherwise. throw.
13 *
14 * @author W.Pasman
15 *
16 */
17public class Accepter extends NastyAgent {
18 @Override
19 public Action chooseAction(List<Class<? extends Action>> possibleActions) {
20 if (!(lastReceivedAction instanceof Offer)) {
21 return new Offer(id, bids.get(0));
22 }
23 return new Accept(id, ((ActionWithBid) lastReceivedAction).getBid());
24 }
25}
Note: See TracBrowser for help on using the repository browser.