From 429991e1f153aa200caaabda48b331ad7b65d05f Mon Sep 17 00:00:00 2001 From: Robert Sharp <rmsharp@student.unimelb.edu.au> Date: Mon, 21 Oct 2019 21:46:36 +1100 Subject: [PATCH] More brownian --- fuzzer/Fuzzer.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fuzzer/Fuzzer.java b/fuzzer/Fuzzer.java index 792ffb3..c0a338c 100644 --- a/fuzzer/Fuzzer.java +++ b/fuzzer/Fuzzer.java @@ -28,6 +28,8 @@ public class Fuzzer { //Brownian values private static boolean USEBROWNIAN = true; + private static final double MAX_FREQ = 200; + private static final double PUT_START = 100; private static final double GET_START = 10; private static final double REM_START = 10; @@ -40,8 +42,8 @@ public class Fuzzer { private static final double SAVE_VAR = 5; private static final double LIST_VAR = 5; - //public static void Fuzzer() throws IOException { - public static void main(String[] args) throws IOException { + public static void Fuzzer() throws IOException { + //public static void main(String[] args) throws IOException { //Rob's code Double[] freqValues = null; @@ -248,6 +250,8 @@ public class Fuzzer { for (i = 0; i < INSTS.length-1; i++) { freqValues[i] = freqValues[i] + ((random.nextDouble() * 2) -1) * varValues[i]; + //Put in a ceiling to ensure doesn't do infinite PUTs + if (Math.abs(freqValues[i]) > MAX_FREQ) {freqValues[i] = MAX_FREQ;} //System.out.println("The index of: "+i + "has the frequency values of: "+freqValues[i]); } @@ -389,4 +393,4 @@ public class Fuzzer { } } -} +} \ No newline at end of file -- GitLab