From d7494e27ddc7e45a90831a72ecdb4fdc66f6dc0f Mon Sep 17 00:00:00 2001
From: MichaelThomas-1 <greeman2.9@gmail.com>
Date: Tue, 20 Oct 2020 16:16:42 +1100
Subject: [PATCH] Updated Fuzzer - Random numbers now seeded based on current
 time - Increased chance of full stack start

---
 fuzzer/Fuzzer.java      | 4 ++--
 fuzzer/Instruction.java | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fuzzer/Fuzzer.java b/fuzzer/Fuzzer.java
index 7cd9d50..8b4caca 100644
--- a/fuzzer/Fuzzer.java
+++ b/fuzzer/Fuzzer.java
@@ -13,7 +13,7 @@ public class Fuzzer {
     private static final String OUTPUT_FILE = "fuzz.txt";
     
     // The percentage of outputs that will start with a full stack
-    private static final int STACK_FULL_PERCENTAGE = 5;
+    private static final int STACK_FULL_PERCENTAGE = 20;
     // The percentage of inputs that will be incorrect
     private static final int INPUT_ERROR_PERCENTAGE = 5;
     // The percentage of instructions that will be incorrect
@@ -34,7 +34,7 @@ public class Fuzzer {
     private static final int MAX_STACK_SIZE = 512;
 
     // Random number generator
-    private static Random rand = new Random();
+    private static Random rand = new Random(System.currentTimeMillis());
 
     private static ArrayList<String> vars = new ArrayList<>();
 
diff --git a/fuzzer/Instruction.java b/fuzzer/Instruction.java
index 20c0c43..c9b509e 100644
--- a/fuzzer/Instruction.java
+++ b/fuzzer/Instruction.java
@@ -76,7 +76,7 @@ public enum Instruction {
     private static Integer ONE_MAX_CUML_PROB = 0;
 
     // Random generator
-    private static Random rand = new Random();
+    private static Random rand = new Random(System.currentTimeMillis());
 
 
 
-- 
GitLab