Title: | Routing Distribution, Broadcasts, Transmissions and Receptions in an Opportunistic Network |
---|---|
Description: | Computes the routing distribution, the expectation of the number of broadcasts, transmissions and receptions considering an Opportunistic transport model. It provides theoretical results and also estimated values based on Monte Carlo simulations. |
Authors: | Christian E. Galarza, Jonathan M. Olate |
Maintainer: | Christian E. Galarza <[email protected]> |
License: | GPL (>=2) |
Version: | 1.2 |
Built: | 2025-01-30 04:37:06 UTC |
Source: | https://github.com/chedgala/opportunistic |
This function computes the probability of success and the expected values of the number of broadcasts, transmissions and receptions for an Opportunistic model.
Expected(p)
Expected(p)
p |
vector of probabilities of length |
A matrix with the probabilities and expected values for an Opportunistic model for all hops sizes <= N
Christian E. Galarza and Jonathan M. Olate
Biswas, S., & Morris, R. (2004). Opportunistic routing in multi-hop wireless networks. ACM SIGCOMM Computer Communication Review, 34(1), 69-74.
#An N=3 Opportunistic system with probabilities p = c(0.0,0.4,0.1) res1 = Expected(p=c(0.9,0.4,0.1)) res1
#An N=3 Opportunistic system with probabilities p = c(0.0,0.4,0.1) res1 = Expected(p=c(0.9,0.4,0.1)) res1
This function estimates via Monte Carlo the probability of success and the expected values of the number of broadcasts, transmissions and receptions for an Opportunistic model.
MonteCarlo(p, M = 10^4)
MonteCarlo(p, M = 10^4)
p |
vector of probabilities of length |
M |
Total number of Monte Carlo simulations |
N is computed from p
length. M is code10^4 by default.
A vector with the success probability and expected values (broadcast, transmissions and receptions) for an N Opportunistic model.
Christian E. Galarza and Jonathan M. Olate
Biswas, S., & Morris, R. (2004). Opportunistic routing in multi-hop wireless networks. ACM SIGCOMM Computer Communication Review, 34(1), 69-74.
#Monte Carlo simulation for an N=3 Opportunistic system with probabilities #p = c(0.0,0.4,0.1) res2 = MonteCarlo(p=c(0.9,0.4,0.1),M=10^4) res2
#Monte Carlo simulation for an N=3 Opportunistic system with probabilities #p = c(0.0,0.4,0.1) res2 = MonteCarlo(p=c(0.9,0.4,0.1),M=10^4) res2
It provides the different
possible routes, their frequency as well as their respective
probabilities when considering uncertain probabilities lying
on a interval p
+- delta
.
routes(p, delta = 0)
routes(p, delta = 0)
p |
vector of probabilities of length |
delta |
Delta value when considering uncertain probabilities. The interval is of the type |
By default, delta
is considered to be zero disregarding uncertainty.
A data frame containing the routes, frequencies, and respective probabilities.
Christian E. Galarza and Jonathan M. Olate
## Not run: #An N=7 Opportunistic system with probabilities p1 = 0.7,...,p7 = 0.1 > p = seq(0.7,0.1,length.out = 7) > routes(p) Freq Probability Value route 1 1 p1^7 0.08235 route 2 6 p1^5*p2 0.10084 route 3 10 p1^3*p2^2 0.12348 route 4 4 p1*p2^3 0.1512 route 5 5 p1^4*p3 0.12005 route 6 12 p1^2*p2*p3 0.147 route 7 3 p2^2*p3 0.18 route 8 3 p1*p3^2 0.175 route 9 4 p1^3*p4 0.1372 route 10 6 p1*p2*p4 0.168 route 11 2 p3*p4 0.2 route 12 3 p1^2*p5 0.147 route 13 2 p2*p5 0.18 route 14 2 p1*p6 0.14 route 15 1 p7 0.1 Total 64 ## End(Not run)
## Not run: #An N=7 Opportunistic system with probabilities p1 = 0.7,...,p7 = 0.1 > p = seq(0.7,0.1,length.out = 7) > routes(p) Freq Probability Value route 1 1 p1^7 0.08235 route 2 6 p1^5*p2 0.10084 route 3 10 p1^3*p2^2 0.12348 route 4 4 p1*p2^3 0.1512 route 5 5 p1^4*p3 0.12005 route 6 12 p1^2*p2*p3 0.147 route 7 3 p2^2*p3 0.18 route 8 3 p1*p3^2 0.175 route 9 4 p1^3*p4 0.1372 route 10 6 p1*p2*p4 0.168 route 11 2 p3*p4 0.2 route 12 3 p1^2*p5 0.147 route 13 2 p2*p5 0.18 route 14 2 p1*p6 0.14 route 15 1 p7 0.1 Total 64 ## End(Not run)