1 | package genius.core.qualitymeasures;
|
---|
2 |
|
---|
3 | import java.util.ArrayList;
|
---|
4 |
|
---|
5 | /**
|
---|
6 | * Simple class to hold the results of the opponent model measures.
|
---|
7 | *
|
---|
8 | * @author Mark Hendrikx
|
---|
9 | */
|
---|
10 | public class OpponentModelMeasuresResults {
|
---|
11 |
|
---|
12 | private ArrayList<Double> timePointList;
|
---|
13 | private ArrayList<Double> pearsonCorrelationCoefficientOfBidsList;
|
---|
14 | private ArrayList<Double> rankingDistanceOfBidsList;
|
---|
15 | private ArrayList<Double> rankingDistanceOfIssueWeightsList;
|
---|
16 | private ArrayList<Double> averageDifferenceBetweenBidsList;
|
---|
17 | private ArrayList<Double> averageDifferenceBetweenIssueWeightsList;
|
---|
18 | private ArrayList<Double> kalaiDistanceList;
|
---|
19 | private ArrayList<Double> nashDistanceList;
|
---|
20 | private ArrayList<Double> averageDifferenceOfParetoFrontierList;
|
---|
21 | private ArrayList<Double> percentageOfCorrectlyEstimatedParetoBidsList;
|
---|
22 | private ArrayList<Double> percentageOfIncorrectlyEstimatedParetoBidsList;
|
---|
23 | private ArrayList<Double> paretoFrontierDistanceList;
|
---|
24 | private ArrayList<Double> bidIndices;
|
---|
25 | private double[][] empty;
|
---|
26 |
|
---|
27 | public OpponentModelMeasuresResults() {
|
---|
28 | timePointList = new ArrayList<Double>();
|
---|
29 | pearsonCorrelationCoefficientOfBidsList = new ArrayList<Double>();
|
---|
30 | rankingDistanceOfBidsList = new ArrayList<Double>();
|
---|
31 | rankingDistanceOfIssueWeightsList = new ArrayList<Double>();
|
---|
32 | averageDifferenceBetweenBidsList = new ArrayList<Double>();
|
---|
33 | averageDifferenceBetweenIssueWeightsList = new ArrayList<Double>();
|
---|
34 | kalaiDistanceList = new ArrayList<Double>();
|
---|
35 | nashDistanceList = new ArrayList<Double>();
|
---|
36 | averageDifferenceOfParetoFrontierList = new ArrayList<Double>();
|
---|
37 | percentageOfCorrectlyEstimatedParetoBidsList = new ArrayList<Double>();
|
---|
38 | percentageOfIncorrectlyEstimatedParetoBidsList = new ArrayList<Double>();
|
---|
39 | paretoFrontierDistanceList = new ArrayList<Double>();
|
---|
40 | bidIndices = new ArrayList<Double>();
|
---|
41 | empty = new double[2][1];
|
---|
42 | empty [0][0] = 0;
|
---|
43 | empty [1][0] = 0;
|
---|
44 | }
|
---|
45 |
|
---|
46 | public void addTimePoint(double timePoint) {
|
---|
47 | timePointList.add(timePoint);
|
---|
48 | }
|
---|
49 |
|
---|
50 | public void addPearsonCorrelationCoefficientOfBids(double pearsonCorrelationCoefficientOfBids) {
|
---|
51 | pearsonCorrelationCoefficientOfBidsList.add(pearsonCorrelationCoefficientOfBids);
|
---|
52 | }
|
---|
53 |
|
---|
54 | public void addRankingDistanceOfBids(double rankingDistanceOfBids) {
|
---|
55 | rankingDistanceOfBidsList.add(rankingDistanceOfBids);
|
---|
56 | }
|
---|
57 |
|
---|
58 | public void addRankingDistanceOfIssueWeights(double rankingDistanceOfIssueWeights) {
|
---|
59 | rankingDistanceOfIssueWeightsList.add(rankingDistanceOfIssueWeights);
|
---|
60 | }
|
---|
61 |
|
---|
62 | public void addAverageDifferenceBetweenBids(double averageDifferenceBetweenBids) {
|
---|
63 | averageDifferenceBetweenBidsList.add(averageDifferenceBetweenBids);
|
---|
64 | }
|
---|
65 |
|
---|
66 | public void addAverageDifferenceBetweenIssueWeights(double averageDifferenceBetweenIssueWeights) {
|
---|
67 | averageDifferenceBetweenIssueWeightsList.add(averageDifferenceBetweenIssueWeights);
|
---|
68 | }
|
---|
69 |
|
---|
70 | public void addKalaiDistance(double kalaiDistance) {
|
---|
71 | kalaiDistanceList.add(kalaiDistance);
|
---|
72 | }
|
---|
73 |
|
---|
74 | public void addNashDistance(double nashDistance) {
|
---|
75 | nashDistanceList.add(nashDistance);
|
---|
76 | }
|
---|
77 |
|
---|
78 | public void addAverageDifferenceOfParetoFrontier(double averageDifferenceOfParetoFrontier) {
|
---|
79 | averageDifferenceOfParetoFrontierList.add(averageDifferenceOfParetoFrontier);
|
---|
80 | }
|
---|
81 |
|
---|
82 | public void addPercentageOfCorrectlyEstimatedParetoBids(double percentageOfCorrectlyEstimatedParetoBids) {
|
---|
83 | percentageOfCorrectlyEstimatedParetoBidsList.add(percentageOfCorrectlyEstimatedParetoBids);
|
---|
84 | }
|
---|
85 |
|
---|
86 | public void addPercentageOfIncorrectlyEstimatedParetoBids(double percentageOfIncorrectlyEstimatedParetoBids) {
|
---|
87 | percentageOfIncorrectlyEstimatedParetoBidsList.add(percentageOfIncorrectlyEstimatedParetoBids);
|
---|
88 | }
|
---|
89 |
|
---|
90 | public void addBidIndex(int bidIndex) {
|
---|
91 | bidIndices.add((double)bidIndex);
|
---|
92 | }
|
---|
93 |
|
---|
94 | public void addParetoFrontierDistance(double paretoFrontierDistance) {
|
---|
95 | paretoFrontierDistanceList.add(paretoFrontierDistance);
|
---|
96 | }
|
---|
97 |
|
---|
98 | public ArrayList<Double> getTimePointList() {
|
---|
99 | return timePointList;
|
---|
100 | }
|
---|
101 |
|
---|
102 | public double[][] getPearsonCorrelationCoefficientOfBidsListData() {
|
---|
103 | return convertToChartData(timePointList, pearsonCorrelationCoefficientOfBidsList);
|
---|
104 | }
|
---|
105 |
|
---|
106 | public double[][] getRankingDistanceOfBidsListData() {
|
---|
107 | return convertToChartData(timePointList, rankingDistanceOfBidsList);
|
---|
108 | }
|
---|
109 |
|
---|
110 | public double[][] getRankingDistanceOfIssueWeightsListData() {
|
---|
111 | return convertToChartData(timePointList, rankingDistanceOfIssueWeightsList);
|
---|
112 | }
|
---|
113 |
|
---|
114 | public double[][] getAverageDifferenceBetweenBidsListData() {
|
---|
115 | return convertToChartData(timePointList, averageDifferenceBetweenBidsList);
|
---|
116 | }
|
---|
117 |
|
---|
118 | public double[][] getAverageDifferenceBetweenIssueWeightsListData() {
|
---|
119 | return convertToChartData(timePointList, averageDifferenceBetweenIssueWeightsList);
|
---|
120 | }
|
---|
121 |
|
---|
122 | public double[][] getKalaiDistanceListData() {
|
---|
123 | return convertToChartData(timePointList, kalaiDistanceList);
|
---|
124 | }
|
---|
125 |
|
---|
126 | public double[][] getNashDistanceListData() {
|
---|
127 | return convertToChartData(timePointList, nashDistanceList);
|
---|
128 | }
|
---|
129 |
|
---|
130 | public double[][] getAverageDifferenceOfParetoFrontierListData() {
|
---|
131 | return convertToChartData(timePointList, averageDifferenceOfParetoFrontierList);
|
---|
132 | }
|
---|
133 |
|
---|
134 | public double[][] getPercentageOfCorrectlyEstimatedParetoBidsListData() {
|
---|
135 | return convertToChartData(timePointList, percentageOfCorrectlyEstimatedParetoBidsList);
|
---|
136 | }
|
---|
137 |
|
---|
138 | public double[][] getPercentageOfIncorrectlyEstimatedParetoBidsListData() {
|
---|
139 | return convertToChartData(timePointList, percentageOfIncorrectlyEstimatedParetoBidsList);
|
---|
140 | }
|
---|
141 |
|
---|
142 | public double[][] getParetoFrontierDistanceListData() {
|
---|
143 | return convertToChartData(timePointList, paretoFrontierDistanceList);
|
---|
144 | }
|
---|
145 |
|
---|
146 | private double[][] convertToChartData(ArrayList<Double> timeSnaps, ArrayList<Double> items) {
|
---|
147 | if (timeSnaps.size() != items.size()) {
|
---|
148 | return empty;
|
---|
149 | }
|
---|
150 |
|
---|
151 | double[][] data = new double[2][items.size()];
|
---|
152 | try
|
---|
153 | {
|
---|
154 | for (int i = 0; i < items.size(); i++) {
|
---|
155 | data [0][i] = timeSnaps.get(i);
|
---|
156 | data [1][i] = items.get(i);
|
---|
157 | }
|
---|
158 | } catch (Exception e) {
|
---|
159 | e.printStackTrace();
|
---|
160 | return null;
|
---|
161 | }
|
---|
162 | return data;
|
---|
163 | }
|
---|
164 |
|
---|
165 | public ArrayList<Double> getPearsonCorrelationCoefficientOfBidsList() {
|
---|
166 | return pearsonCorrelationCoefficientOfBidsList;
|
---|
167 | }
|
---|
168 |
|
---|
169 | public ArrayList<Double> getRankingDistanceOfBidsList() {
|
---|
170 | return rankingDistanceOfBidsList;
|
---|
171 | }
|
---|
172 |
|
---|
173 | public ArrayList<Double> getRankingDistanceOfIssueWeightsList() {
|
---|
174 | return rankingDistanceOfIssueWeightsList;
|
---|
175 | }
|
---|
176 |
|
---|
177 | public ArrayList<Double> getAverageDifferenceBetweenBidsList() {
|
---|
178 | return averageDifferenceBetweenBidsList;
|
---|
179 | }
|
---|
180 |
|
---|
181 | public ArrayList<Double> getAverageDifferenceBetweenIssueWeightsList() {
|
---|
182 | return averageDifferenceBetweenIssueWeightsList;
|
---|
183 | }
|
---|
184 |
|
---|
185 | public ArrayList<Double> getKalaiDistanceList() {
|
---|
186 | return kalaiDistanceList;
|
---|
187 | }
|
---|
188 |
|
---|
189 | public ArrayList<Double> getNashDistanceList() {
|
---|
190 | return nashDistanceList;
|
---|
191 | }
|
---|
192 |
|
---|
193 | public ArrayList<Double> getAverageDifferenceOfParetoFrontierList() {
|
---|
194 | return averageDifferenceOfParetoFrontierList;
|
---|
195 | }
|
---|
196 |
|
---|
197 | public ArrayList<Double> getPercentageOfCorrectlyEstimatedParetoBidsList() {
|
---|
198 | return percentageOfCorrectlyEstimatedParetoBidsList;
|
---|
199 | }
|
---|
200 |
|
---|
201 | public ArrayList<Double> getPercentageOfIncorrectlyEstimatedParetoBidsList() {
|
---|
202 | return percentageOfIncorrectlyEstimatedParetoBidsList;
|
---|
203 | }
|
---|
204 |
|
---|
205 | public ArrayList<Double> getBidIndices() {
|
---|
206 | return bidIndices;
|
---|
207 | }
|
---|
208 |
|
---|
209 | public ArrayList<Double> getParetoFrontierDistanceList() {
|
---|
210 | return paretoFrontierDistanceList;
|
---|
211 | }
|
---|
212 | } |
---|