Skip to content
Snippets Groups Projects
Commit 429991e1 authored by Robert Sharp's avatar Robert Sharp
Browse files

More brownian

parent 1c8d003f
Branches
No related tags found
1 merge request!16Brownian motion fuzzer
...@@ -28,6 +28,8 @@ public class Fuzzer { ...@@ -28,6 +28,8 @@ public class Fuzzer {
//Brownian values //Brownian values
private static boolean USEBROWNIAN = true; private static boolean USEBROWNIAN = true;
private static final double MAX_FREQ = 200;
private static final double PUT_START = 100; private static final double PUT_START = 100;
private static final double GET_START = 10; private static final double GET_START = 10;
private static final double REM_START = 10; private static final double REM_START = 10;
...@@ -40,8 +42,8 @@ public class Fuzzer { ...@@ -40,8 +42,8 @@ public class Fuzzer {
private static final double SAVE_VAR = 5; private static final double SAVE_VAR = 5;
private static final double LIST_VAR = 5; private static final double LIST_VAR = 5;
//public static void Fuzzer() throws IOException { public static void Fuzzer() throws IOException {
public static void main(String[] args) throws IOException { //public static void main(String[] args) throws IOException {
//Rob's code //Rob's code
Double[] freqValues = null; Double[] freqValues = null;
...@@ -248,6 +250,8 @@ public class Fuzzer { ...@@ -248,6 +250,8 @@ public class Fuzzer {
for (i = 0; i < INSTS.length-1; i++) { for (i = 0; i < INSTS.length-1; i++) {
freqValues[i] = freqValues[i] + ((random.nextDouble() * 2) -1) * varValues[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]); //System.out.println("The index of: "+i + "has the frequency values of: "+freqValues[i]);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment