Changes between Version 139 and Version 140 of WikiStart


Ignore:
Timestamp:
02/28/19 13:46:20 (5 years ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v139 v140  
    198198}}}
    199199|----------------------------
    200 === Value representation in Json
     200
     201
     202== Bids ==
     203A Bid is a map with the issue names as keys (strings) and the values being an element from the valueset as in the domain description.
     204
     205A bid typically looks like
     206{{{
     207{ "salary":"2000", "fte":"0.8", "work from home","0.6" ...}
     208}}}
     209
     210This example also illustrates a problem with the json parser. In our jobs example domain, all issues have discrete values, so "2000" is just a string, not a number.
     211
     212In this case, a specific problem occured that we had to figure a workaround for. Suppose we have a bid in the jobs domain:
     213
     214
    201215
    202216Internally BigDecimal is used for computing and storing issue values, utilities etc. Doubles always give rounding problems and can not be assumed to sum properly to 1 and therefore can not be used.
     217
     218In the special case of issue values, we can not determine a priori if the values are
    203219
    204220Since JSON parses normal number directly into doubles, it is necessary to place numbers also inside string objects ("..."). That in turn forces us to put some hard marker in the string to see if "1" would be a discrete value or number value. To do this, any Value contained in a string that is of the form "=X.Y" where X is a positive or negative integer and Y a positive integer is a NumberValue. Anything else is interpreted as a DiscreteValue.