From e907e4dace3c054c8458687bc687c488a0aa53b6 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Wed, 18 Feb 2009 10:35:31 +0000 Subject: [PATCH] quickstart uses main random generator --- tools/cooja/java/se/sics/cooja/GUI.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/GUI.java b/tools/cooja/java/se/sics/cooja/GUI.java index ac140f850..6de88bcb1 100644 --- a/tools/cooja/java/se/sics/cooja/GUI.java +++ b/tools/cooja/java/se/sics/cooja/GUI.java @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: GUI.java,v 1.103 2009/02/18 10:09:32 fros4943 Exp $ + * $Id: GUI.java,v 1.104 2009/02/18 10:35:31 fros4943 Exp $ */ package se.sics.cooja; @@ -1305,6 +1305,8 @@ public class GUI extends Observable { Simulation simulation = new Simulation(gui); simulation.setTitle("Quickstarted: " + filename); simulation.setDelayTime(delayTime); + simulation.setRandomSeed(new Random().nextLong()); + simulation.setRandomSeedGenerated(true); simulation.setSimulationTime(0); String radioMediumClassName = null; try { @@ -1325,7 +1327,7 @@ public class GUI extends Observable { // Create nodes logger.info("> Creating motes"); Vector motes = new Vector(); - Random random = new Random(); + Random random = simulation.getRandomGenerator(); int nextMoteID = 1; int nextIP = 0; for (int i = 0; i < numberOfNodes; i++) {