persistable srecord noeq PriceDigitizer2(PriceCells cells) { settable int cellNumber; settable bool verbose; // returns new digitized price double digitize(double price) { double cn = cells.toCellNumber(price); cellNumber = iroundTowards(cn, cellNumber); ret digitizedPrice(); } double digitizedPrice() { ret cells.fromCellNumber(price); } // digitize price without looking at history double digitizeIndividually(double price) { double cn = cells.toCellNumber(price); ret fromCellNumber(round(cn)); } }