MCPcopy Create free account
hub / github.com/akeranen/the-one / ageDeliveryPreds

Method ageDeliveryPreds

routing/ProphetRouter.java:169–183  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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

Callers 3

getPredForMethod · 0.95
getDeliveryPredsMethod · 0.95
getRoutingInfoMethod · 0.95

Calls 2

getTimeMethod · 0.95
getValueMethod · 0.80

Tested by

no test coverage detected