//income processing protected override IEnumerable <DayIncomeObject> ConvertRawData(RawIncomeManager incomeManager) { var lastIncome = 0.0; var incomes = new List <DayIncomeObject>(); var startTime = UnixTimeHelper.GetCurrentDay(); while (true) { var rawIncome = incomeManager.GetRow(startTime); var income = new DayIncomeObject(rawIncome.time, rawIncome.value); if (income.time == 0) { break; } if (lastIncome > 0) { income.value = lastIncome - income.value; incomes.Add(income); lastIncome -= income.value; } else { lastIncome = income.value; } startTime -= 86400; } incomes.Reverse(); return(incomes.ToArray()); }
public void Update() { var rawIncomes = GetRawData(); var manager = new RawIncomeManager(rawIncomes); dayIncomes = ConvertRawData(manager); this.rawIncomes = rawIncomes.ToArray(); }
protected override IEnumerable <DayIncomeObject> ConvertRawData(RawIncomeManager incomeManager) { return(new DayIncomeObject[0]); }
public PredictionObject(DayIncomeManager manager, RawIncomeManager rawManager) { this.manager = manager; this.rawManager = rawManager; }
public StatisticObject(DayIncomeManager manager, RawIncomeManager rawManager) { this.manager = manager; this.rawManager = rawManager; }
protected abstract IEnumerable <DayIncomeObject> ConvertRawData(RawIncomeManager incomeManager);