Last change
on this file since 50 was 1, checked in by Wouter Pasman, 6 years ago |
Initial import : Genius 9.0.0
|
File size:
628 bytes
|
Line | |
---|
1 | package agents.nastyagent;
|
---|
2 |
|
---|
3 | import java.util.List;
|
---|
4 |
|
---|
5 | import genius.core.actions.Accept;
|
---|
6 | import genius.core.actions.Action;
|
---|
7 | import genius.core.actions.ActionWithBid;
|
---|
8 | import 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 | */
|
---|
17 | public 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.