Last change
on this file since 126 was 126, checked in by Aron Hammond, 6 years ago |
Added function to calculate opposition to MultiLateralAnalysis.java
Moved code to add RLBOA listeners to RLBOAUtils is misc package
Added input for strategyParameters to SessionPanel (gui)
!! close SessionInfo after tournament; this caused /tmp/ to fill up with GeniusData files
Our own package:
- Added opponents and strategies that are mentioned in the report
- Change class hierarchy, agents can now extend from RLBOAagentBilateral to inherit RL functionality.
- States extend from AbstractState
|
File size:
1.1 KB
|
Rev | Line | |
---|
[126] | 1 | package negotiator.parties;
|
---|
| 2 |
|
---|
| 3 | import java.util.List;
|
---|
| 4 | import java.util.Random;
|
---|
| 5 |
|
---|
| 6 | import genius.core.Bid;
|
---|
| 7 | import genius.core.bidding.BidDetails;
|
---|
| 8 | import genius.core.misc.Range;
|
---|
| 9 | import genius.core.parties.NegotiationInfo;
|
---|
| 10 |
|
---|
| 11 | public class NonDeterministicConcederNegotiationParty extends AbstractTimeDependentNegotiationParty {
|
---|
| 12 |
|
---|
| 13 | public static final double DELTA = 0.05;
|
---|
| 14 | protected Random random;
|
---|
| 15 |
|
---|
| 16 | @Override
|
---|
| 17 | public void init(NegotiationInfo info) {
|
---|
| 18 | super.init(info);
|
---|
| 19 | random = new Random();
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | @Override
|
---|
| 23 | protected Bid getNextBid() {
|
---|
| 24 | final List<BidDetails> candidates = getCandidates(getTargetUtility(), DELTA);
|
---|
| 25 | final BidDetails chosen = getRandomElement(candidates);
|
---|
| 26 | return chosen.getBid();
|
---|
| 27 | }
|
---|
| 28 |
|
---|
| 29 | protected List<BidDetails> getCandidates(double target, double delta) {
|
---|
| 30 | return outcomeSpace.getBidsinRange(new Range(target - delta, target + delta));
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | protected <T> T getRandomElement(List<T> list) {
|
---|
| 34 | return list.get(random.nextInt(list.size()));
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | @Override
|
---|
| 38 | public double getE() {
|
---|
| 39 | return 2;
|
---|
| 40 | }
|
---|
| 41 |
|
---|
| 42 | @Override
|
---|
| 43 | public String getDescription() {
|
---|
| 44 | return "Nondeterministic Conceder Party";
|
---|
| 45 | }
|
---|
| 46 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.