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

Method updateDeliveryPredFor

routing/ProphetRouter.java:115–119  ·  view source on GitHub ↗

Updates delivery predictions for a host. P(a,b) = P(a,b)_old + (1 - P(a,b)_old) P_INIT @param host The host we just met

(DTNHost host)

Source from the content-addressed store, hash-verified

113 * @param host The host we just met
114 */
115 private void updateDeliveryPredFor(DTNHost host) {
116 double oldValue = getPredFor(host);
117 double newValue = oldValue + (1 - oldValue) * P_INIT;
118 preds.put(host, newValue);
119 }
120
121 /**
122 * Returns the current prediction (P) value for a host or 0 if entry for

Callers 1

changedConnectionMethod · 0.95

Calls 2

getPredForMethod · 0.95
putMethod · 0.45

Tested by

no test coverage detected