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:
884 bytes
|
Rev | Line | |
---|
[127] | 1 | package agents.anac.y2015.pnegotiator;
|
---|
| 2 |
|
---|
| 3 | import java.util.Comparator;
|
---|
| 4 |
|
---|
| 5 | import genius.core.issue.ValueDiscrete;
|
---|
| 6 |
|
---|
| 7 | public class ValueFrequency {
|
---|
| 8 | public ValueDiscrete value;
|
---|
| 9 | public double utility;
|
---|
| 10 | public int[] opponentFrequency;
|
---|
| 11 | public int ourFrequency;
|
---|
| 12 |
|
---|
| 13 | public ValueFrequency(ValueDiscrete val, double util, int P) {
|
---|
| 14 | value = val;
|
---|
| 15 | utility = util;
|
---|
| 16 | opponentFrequency = new int[P];
|
---|
| 17 | for (int i = 0; i < opponentFrequency.length; i++)
|
---|
| 18 | opponentFrequency[i] = 1;
|
---|
| 19 | ourFrequency = 0;
|
---|
| 20 | }
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | class VFComp implements Comparator<ValueFrequency> {
|
---|
| 24 | @Override
|
---|
| 25 | public int compare(ValueFrequency vf1, ValueFrequency vf2) {
|
---|
| 26 | return (vf1.utility < vf2.utility) ? 1 : -1;
|
---|
| 27 | }
|
---|
| 28 | }
|
---|
| 29 | /*
|
---|
| 30 | * class VFComp implements Comparator<ValueDiscrete>{
|
---|
| 31 | *
|
---|
| 32 | * @Override public int compare(ValueDiscrete v1, ValueDiscrete v2) { return
|
---|
| 33 | * v1.value.compareTo(v2.value); } }
|
---|
| 34 | */
|
---|
Note:
See
TracBrowser
for help on using the repository browser.