diff options
| author | Paul Buetow <paul@buetow.org> | 2008-05-27 18:10:49 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-05-27 18:10:49 +0000 |
| commit | 6c84bc4be038bc9004622f4ee2cac600a909aea1 (patch) | |
| tree | 9050a87bc7a1429731621ecaf09152b75d549c26 | |
| parent | e25e65adbe2753f115756a1518db54daf16494c3 (diff) | |
bugfix in the random numbers.
| -rw-r--r-- | sources/core/VSProcess.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sources/core/VSProcess.java b/sources/core/VSProcess.java index e0dd770..a39d918 100644 --- a/sources/core/VSProcess.java +++ b/sources/core/VSProcess.java @@ -326,7 +326,6 @@ public class VSProcess extends VSPrefs { if (randomCrashTask != null) taskManager.removeTask(randomCrashTask); - if (crashTime >= getGlobalTime()) { VSAbstractEvent event = new ProcessCrashEvent(); //event.init(this); @@ -588,7 +587,7 @@ public class VSProcess extends VSPrefs { int percentage = (int) ((getInteger("message.prob.outage") + receiverProcess.getInteger("message.prob.outage")) / 2); /* Check if the message will have an outage or not */ - if (getRandomPercentage() <= percentage) { + if (getRandomPercentage() < percentage) { /* Calculate the random outage time! */ final long outageTime = globalTime + random.nextLong(durationTime+1) % simulationCanvas.getUntilTime(); return outageTime; @@ -605,7 +604,7 @@ public class VSProcess extends VSPrefs { */ private long getARandomCrashTime() { /* Check if the process will crash or not */ - if (random.nextInt(100) <= getInteger("process.prob.crash")) { + if (getRandomPercentage() < getInteger("process.prob.crash")) { /* Calculate the random crash time! */ final long crashTime = random.nextLong(simulationCanvas.getUntilTime()+1) % simulationCanvas.getUntilTime(); return crashTime; |
