diff options
| author | Paul Buetow <paul@buetow.org> | 2008-05-26 23:08:31 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-05-26 23:08:31 +0000 |
| commit | 39e9eb74c011ee5351ac1796e5df529a70aa8945 (patch) | |
| tree | 599657259a17c31ff5eb089af83a3d4202c350f2 /sources/core/VSProcess.java | |
| parent | 2b35beeefeccb82afae8d259f11ccecc8b218417 (diff) | |
new option: "sim.message.prob.mean"
new brainstorm.
Diffstat (limited to 'sources/core/VSProcess.java')
| -rw-r--r-- | sources/core/VSProcess.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sources/core/VSProcess.java b/sources/core/VSProcess.java index 03b980f..1a7f319 100644 --- a/sources/core/VSProcess.java +++ b/sources/core/VSProcess.java @@ -584,9 +584,11 @@ public class VSProcess extends VSPrefs { * * @return the a random message outage time */ - public synchronized long getARandomMessageOutageTime(final long durationTime) { + public synchronized long getARandomMessageOutageTime(final long durationTime, VSProcess receiverProcess) { + int percentage = (int) ((getInteger("message.prob.outage") + + receiverProcess.getInteger("message.prob.outage")) / 2); /* Check if the message will have an outage or not */ - if (random.nextInt(100) < getInteger("message.prob.outage")) { + if (getRandomPercentage() <= percentage) { /* Calculate the random outage time! */ final long outageTime = globalTime + random.nextLong(durationTime+1) % simulationCanvas.getUntilTime(); return outageTime; |
