[83] | 1 | package genius.gui.tree;
|
---|
| 2 |
|
---|
[84] | 3 | import genius.core.utility.UncertainAdditiveUtilitySpace;
|
---|
| 4 | import genius.core.utility.UtilitySpace;
|
---|
[83] | 5 | import genius.gui.panels.BooleanModel;
|
---|
[87] | 6 | import genius.gui.panels.SpinnerModel;
|
---|
[83] | 7 |
|
---|
| 8 | /**
|
---|
| 9 | * Holds the uncertainty settings (while editing a profile)
|
---|
| 10 | */
|
---|
| 11 | public class UncertaintySettingsModel {
|
---|
[86] | 12 | private BooleanModel isEnabled;
|
---|
[87] | 13 | private SpinnerModel<Integer> comparisons;
|
---|
| 14 | private SpinnerModel<Integer> errors;
|
---|
[83] | 15 | private BooleanModel isExperimental = new BooleanModel(false);
|
---|
| 16 | private long totalBids;
|
---|
| 17 |
|
---|
| 18 | /**
|
---|
| 19 | * @oaran nbids the number of bids in the space.
|
---|
[86] | 20 | * @param enable
|
---|
| 21 | * the default value for enabledness of Uncertainty.
|
---|
[83] | 22 | */
|
---|
[86] | 23 | public UncertaintySettingsModel(UtilitySpace space, boolean enable) {
|
---|
| 24 | isEnabled = new BooleanModel(enable);
|
---|
[84] | 25 | totalBids = space.getDomain().getNumberOfPossibleBids();
|
---|
| 26 | UncertainAdditiveUtilitySpace uspace = (space instanceof UncertainAdditiveUtilitySpace)
|
---|
| 27 | ? (UncertainAdditiveUtilitySpace) space : null;
|
---|
[87] | 28 | comparisons = new SpinnerModel<Integer>(
|
---|
| 29 | uspace != null ? uspace.getComparisons() : 0, 0,
|
---|
| 30 | (int) totalBids, 1);
|
---|
| 31 | errors = new SpinnerModel<Integer>(
|
---|
| 32 | uspace != null ? uspace.getErrors() : 0, 0, (int) totalBids, 1);
|
---|
[83] | 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 | }
|
---|