1
2
3
4
5
6
7 package net.sf.bddbddb.order;
8
9 import net.sf.bddbddb.FindBestDomainOrder;
10
11
12 public class TrialPrediction {
13
14 public double score;
15
16 public double[][] predictions;
17
18 public static int VARIABLE = 0;
19
20 public static int ATTRIBUTE = 1;
21
22 public static int DOMAIN = 2;
23
24 public static int LOW = 0;
25
26 public static int HIGH = 1;
27 public TrialPrediction(double score,
28 double varLowerBound, double varUpperBound, double attrLowerBound,
29 double attrUpperBound, double domLowerBound, double domUpperBound) {
30 this.score = score;
31 predictions = new double[3][];
32 predictions[VARIABLE] = new double[2];
33 predictions[VARIABLE][LOW] = varLowerBound;
34 predictions[VARIABLE][HIGH] = varUpperBound;
35 predictions[ATTRIBUTE] = new double[2];
36 predictions[ATTRIBUTE][LOW] = attrLowerBound;
37 predictions[ATTRIBUTE][HIGH] = attrUpperBound;
38 predictions[DOMAIN] = new double[2];
39 predictions[DOMAIN][LOW] = domLowerBound;
40 predictions[DOMAIN][HIGH] = domUpperBound;
41 }
42 public double getVarLowerBound(){ return predictions[VARIABLE][LOW]; }
43 public double getVarUpperBound(){ return predictions[VARIABLE][HIGH]; }
44 public double getAttrLowerBound(){ return predictions[ATTRIBUTE][LOW]; }
45 public double getAttrUpperBound(){ return predictions[ATTRIBUTE][HIGH]; }
46 public double getDomLowerBound(){ return predictions[DOMAIN][LOW]; }
47 public double getDomUpperBound(){ return predictions[DOMAIN][HIGH]; }
48 public String toString() {
49 return "score="+FindBestDomainOrder.format(score)+", var=("+FindBestDomainOrder.format(predictions[VARIABLE][LOW])+".."+FindBestDomainOrder.format(predictions[VARIABLE][HIGH])+"),"+
50 "attr=("+FindBestDomainOrder.format(predictions[ATTRIBUTE][LOW])+".."+FindBestDomainOrder.format(predictions[ATTRIBUTE][HIGH])+"),"+
51 "domain=("+FindBestDomainOrder.format(predictions[DOMAIN][LOW])+".."+FindBestDomainOrder.format(predictions[DOMAIN][HIGH])+")";
52 }
53 public double getScore() {
54 return score;
55 }
56 }