diff options
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; |
