Last change
on this file 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 | |
---|
1 | package negotiator.boaframework.offeringstrategy.other;
|
---|
2 |
|
---|
3 | import genius.core.Bid;
|
---|
4 | import genius.core.bidding.BidDetails;
|
---|
5 | import genius.core.boaframework.OfferingStrategy;
|
---|
6 |
|
---|
7 | /**
|
---|
8 | * This class implements the Simple Agent a.k.a. Zero Intelligence, Random
|
---|
9 | * Walker offering strategy. This will choose a bid at random to offer the
|
---|
10 | * opponent.
|
---|
11 | *
|
---|
12 | * This strategy has no straightforward extension of using opponent models.
|
---|
13 | *
|
---|
14 | * @author Alex Dirkzwager, Mark Hendrikx
|
---|
15 | */
|
---|
16 | public class Random_Offering extends OfferingStrategy {
|
---|
17 |
|
---|
18 | /**
|
---|
19 | * Empty constructor used for reflection. Note this constructor assumes that
|
---|
20 | * init is called next.
|
---|
21 | */
|
---|
22 | public Random_Offering() {
|
---|
23 | }
|
---|
24 |
|
---|
25 | @Override
|
---|
26 | public BidDetails determineNextBid() {
|
---|
27 | Bid bid = negotiationSession.getUtilitySpace().getDomain().getRandomBid(null);
|
---|
28 | try {
|
---|
29 | nextBid = new BidDetails(bid, negotiationSession.getUtilitySpace().getUtility(bid),
|
---|
30 | negotiationSession.getTime());
|
---|
31 | } catch (Exception e) {
|
---|
32 | e.printStackTrace();
|
---|
33 | }
|
---|
34 | return nextBid;
|
---|
35 | }
|
---|
36 |
|
---|
37 | @Override
|
---|
38 | public BidDetails determineOpeningBid() {
|
---|
39 | return determineNextBid();
|
---|
40 | }
|
---|
41 |
|
---|
42 | @Override
|
---|
43 | public String getName() {
|
---|
44 | return "Other - Random Offering";
|
---|
45 | }
|
---|
46 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.