Learn R Programming

Opportunistic (version 1.2)

MonteCarlo: Monte Carlo broadcasts/transmissions/receptions for an Opportunistic model

Description

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.

Usage

MonteCarlo(p, M = 10^4)

Arguments

p

vector of probabilities of length N where N represents the number of hops

M

Total number of Monte Carlo simulations

Value

A vector with the success probability and expected values (broadcast, transmissions and receptions) for an N Opportunistic model.

Details

N is computed from p length. M is code10^4 by default.

References

Biswas, S., & Morris, R. (2004). Opportunistic routing in multi-hop wireless networks. ACM SIGCOMM Computer Communication Review, 34(1), 69-74.

See Also

routes, Expected

Examples

Run this code
#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

Run the code above in your browser using DataLab