61 | | This module contains the basic objects that make up a bid: issues, values, domains, and bids. The issues are just String objects. There are 2 types of values: numeric and discrete. DiscreteValueSet contains the list of DiscreteValue which is a basically a possible (string) values for the issue. NumberValueSet contains a Range which is a set of numbers defined by the minimum, maximum and stepsize (upwards from the minimum). A Domain contains a map, with each key the issue (string) and the value a ValueSet. Finally, a Bid is a Map where the key is the issue and the value either a DiscreteValue or NumberValue that is valid for that issue. DiscreteValues are serialized to json inside double quotes, NumberValues are just the numbers (no double quotes). |
| 61 | This module contains the basic objects that make up a bid: issues, values, domains, and bids. |
| 62 | |
| 63 | The issues are just String objects. |
| 64 | |
| 65 | A ValueSet indicates the possible values for an issue. There are 2 types of valuesets: numeric and discrete. DiscreteValueSet contains the list of DiscreteValue which is a basically a possible (string) values for the issue. NumberValueSet contains a Range which is a set of numbers defined by the minimum, maximum and stepsize (upwards from the minimum). |
| 66 | * a DiscreteValueSet contains a set of possible discrete values. It looks like "values", a column and then a list of discrete values (all strings) Form example, {{{ "values":["yes","no"] }}}. Discrete values are always strings. So "1" is a good discrete value. |
| 67 | * a number valueset contains a range of numbers and looks like {{{ {"range":[12.2,12.6,0.3]} }}} so "range:" followed by a list of 3 values. The first value is the minimum value in the range, the second the maximum value in the range, and the third the step value. This example range thus contains 12.2 and 12.5 (the next one would be 12.8 but that is already outside the range). Numbers are without quotes. |
| 68 | |
| 69 | A Domain contains a map, with each key the issue (string) and the value a ValueSet. |
| 70 | |
67 | | Here is an example of a bid in JSON format. issue 2 and issue 3 are number values, issue 1 is a discrete issue. All values in quotes are discrete values, while values without quotes are number values. |
68 | | |
69 | | {{{ |
70 | | {"issuevalues":{ |
71 | | "issue3":9012345678901234567.89, |
72 | | "issue2":1, |
73 | | "issue1":"b" |
74 | | }} |
75 | | }}} |
76 | | |
77 | | * The issueValues contains a dictionary with issues. Each issue is indicated by a name (a string), followed by a column (:) and then a dictionary. The dictionary can contain either a discrete valueset or a number valueset |
78 | | * a discrete valueset looks like "values", a column and then a list of discrete values (all strings) |
79 | | * a number valueset contains a range of numbers and looks like {{{ {"range":[12.2,12.6,0.3]} }}} so "range:" followed by a list of 3 values. The first value is the minimum value in the range, the second the maximum value in the range, and the third the step value. This example range thus contains 12.2 and 12.5 (the next one would be 12.8 but that is already outside the range). |
| 92 | |
| 93 | * The issueValues contains a dictionary with issues. Each issue is indicated by a name (a string), followed by a column (:) and then a dictionary. The dictionary can contain either a discrete valueset or a number valueset as discussed above. |
| 94 | |
| 95 | Finally, a Bid is a Map where the key is the issue and the value either a DiscreteValue or NumberValue that is valid for that issue. DiscreteValues are serialized to json inside double quotes, NumberValues are just the numbers (no double quotes). |
| 96 | |
| 97 | Here is an example of a bid in JSON format. issue 2 and issue 3 are number values, issue 1 is a discrete issue. All values in quotes are discrete values, while values without quotes are number values. |
| 98 | |
| 99 | {{{ |
| 100 | {"issuevalues":{ |
| 101 | "issue3":9012345678901234567.89, |
| 102 | "issue2":1, |
| 103 | "issue1":"b" |
| 104 | }} |
| 105 | }}} |
| 106 | |