| | |
| | | BigDecimal nationalProvincial = vehicle.get(HolidayConstants.ROAD_NATIONAL_PROVINCIAL); |
| | | BigDecimal comparisonBase = comparisonBaseByDate.get(day.getHolidayDate()); |
| | | BigDecimal nationalProvincialRingRatio = nationalProvincialRingRatio( |
| | | year, nationalProvincial, previousNationalProvincial, comparisonBase); |
| | | nationalProvincial, previousNationalProvincial); |
| | | BigDecimal nonBusinessPersonFlow = null; |
| | | if (coefficient != null && (expressway != null || nationalProvincial != null)) { |
| | | nonBusinessPersonFlow = HolidayNumberUtils.multiply( |
| | |
| | | return total; |
| | | } |
| | | |
| | | private BigDecimal nationalProvincialRingRatio(int year, BigDecimal current, |
| | | BigDecimal previous, BigDecimal comparisonBase) { |
| | | // The national/provincial ring ratio always compares the current day with the previous day of |
| | | // the same year. The stored comparison base (Excel column C) is kept as an operator backup |
| | | // value only and never feeds this calculation. |
| | | private BigDecimal nationalProvincialRingRatio(BigDecimal current, BigDecimal previous) { |
| | | if (current == null) return null; |
| | | if (HolidayConstants.supportsComparisonBase(year) && comparisonBase != null) { |
| | | return ratio(current, comparisonBase); |
| | | } |
| | | return previous == null ? null : ratio(current, previous); |
| | | } |
| | | |