1 | package genius.gui.tree;
|
---|
2 |
|
---|
3 | import genius.core.utility.UncertainAdditiveUtilitySpace;
|
---|
4 | import genius.core.utility.UtilitySpace;
|
---|
5 | import genius.gui.panels.BooleanModel;
|
---|
6 | import genius.gui.panels.SpinnerModel;
|
---|
7 |
|
---|
8 | /**
|
---|
9 | * Holds the uncertainty settings (while editing a profile)
|
---|
10 | */
|
---|
11 | public class UncertaintySettingsModel {
|
---|
12 | private BooleanModel isEnabled;
|
---|
13 | private SpinnerModel comparisons;
|
---|
14 | private SpinnerModel errors;
|
---|
15 | private BooleanModel isExperimental = new BooleanModel(false);
|
---|
16 | private long totalBids;
|
---|
17 |
|
---|
18 | /**
|
---|
19 | * @oaran nbids the number of bids in the space.
|
---|
20 | * @param enable
|
---|
21 | * the default value for enabledness of Uncertainty.
|
---|
22 | */
|
---|
23 | public UncertaintySettingsModel(UtilitySpace space, boolean enable) {
|
---|
24 | isEnabled = new BooleanModel(enable);
|
---|
25 | totalBids = space.getDomain().getNumberOfPossibleBids();
|
---|
26 | UncertainAdditiveUtilitySpace uspace = (space instanceof UncertainAdditiveUtilitySpace)
|
---|
27 | ? (UncertainAdditiveUtilitySpace) space : null;
|
---|
28 | comparisons = new SpinnerModel(
|
---|
29 | uspace != null ? uspace.getComparisons() : 0, 0,
|
---|
30 | (int) totalBids, 1);
|
---|
31 | errors = new SpinnerModel(uspace != null ? uspace.getErrors() : 0, 0,
|
---|
32 | (int) totalBids, 1);
|
---|
33 | }
|
---|
34 |
|
---|
35 | public SpinnerModel getComparisons() {
|
---|
36 | return comparisons;
|
---|
37 | }
|
---|
38 |
|
---|
39 | public SpinnerModel getErrors() {
|
---|
40 | return errors;
|
---|
41 | }
|
---|
42 |
|
---|
43 | public BooleanModel getIsExperimental() {
|
---|
44 | return isExperimental;
|
---|
45 | }
|
---|
46 |
|
---|
47 | public BooleanModel getIsEnabled() {
|
---|
48 | return isEnabled;
|
---|
49 | }
|
---|
50 |
|
---|
51 | public long getTotalBids() {
|
---|
52 | return totalBids;
|
---|
53 | }
|
---|
54 |
|
---|
55 | }
|
---|