Ages all entries in the delivery predictions. P(a,b) = P(a,b)_old (GAMMA ^ k) , where k is number of time units that have elapsed since the last time the metric was aged. @see #SECONDS_IN_UNIT_S
()
| 167 | * @see #SECONDS_IN_UNIT_S |
| 168 | */ |
| 169 | private void ageDeliveryPreds() { |
| 170 | double timeDiff = (SimClock.getTime() - this.lastAgeUpdate) / |
| 171 | secondsInTimeUnit; |
| 172 | |
| 173 | if (timeDiff == 0) { |
| 174 | return; |
| 175 | } |
| 176 | |
| 177 | double mult = Math.pow(GAMMA, timeDiff); |
| 178 | for (Map.Entry<DTNHost, Double> e : preds.entrySet()) { |
| 179 | e.setValue(e.getValue()*mult); |
| 180 | } |
| 181 | |
| 182 | this.lastAgeUpdate = SimClock.getTime(); |
| 183 | } |
| 184 | |
| 185 | /** |
| 186 | * Returns a map of this router's delivery predictions |
no test coverage detected