make everything use same random number generator
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
import java.util.InputMismatchException;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
//
|
||||
public class InteractiveInterface {
|
||||
|
||||
final static Scanner sc = new Scanner(System.in);
|
||||
static int input;
|
||||
static boolean quit = false;
|
||||
private static final Random rand = BiGpairSEQ.getRand();
|
||||
private static final Scanner sc = new Scanner(System.in);
|
||||
private static int input;
|
||||
private static boolean quit = false;
|
||||
|
||||
public static void startInteractive() {
|
||||
|
||||
@@ -169,10 +167,11 @@ public class InteractiveInterface {
|
||||
if(maxPop < minPop) {
|
||||
throw new InputMismatchException("Max well population must be greater than min well population");
|
||||
}
|
||||
populations = new Integer[numSections];
|
||||
for(int i = 0; i < numSections; i++) {
|
||||
populations[i] = Equations.getRandomInt(minPop, maxPop);
|
||||
}
|
||||
//maximum should be inclusive, so need to add one to max of randomly generated values
|
||||
populations = (Integer[]) rand.ints(minPop, maxPop + 1)
|
||||
.limit(numSections)
|
||||
.boxed()
|
||||
.toArray();
|
||||
System.out.print("Populations: ");
|
||||
System.out.println(Arrays.toString(populations));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user