summaryrefslogtreecommitdiff
path: root/sources/core/VSProcess.java
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-05-26 23:08:31 +0000
committerPaul Buetow <paul@buetow.org>2008-05-26 23:08:31 +0000
commit39e9eb74c011ee5351ac1796e5df529a70aa8945 (patch)
tree599657259a17c31ff5eb089af83a3d4202c350f2 /sources/core/VSProcess.java
parent2b35beeefeccb82afae8d259f11ccecc8b218417 (diff)
new option: "sim.message.prob.mean"
new brainstorm.
Diffstat (limited to 'sources/core/VSProcess.java')
-rw-r--r--sources/core/VSProcess.java6
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;