Generate populations correctly

This commit is contained in:
2022-02-23 10:37:40 -06:00
parent decdb147a9
commit 17ae763c6c

View File

@@ -175,10 +175,10 @@ public class InteractiveInterface {
throw new InputMismatchException("Max well population must be greater than min well population"); throw new InputMismatchException("Max well population must be greater than min well population");
} }
//maximum should be inclusive, so need to add one to max of randomly generated values //maximum should be inclusive, so need to add one to max of randomly generated values
populations = (Integer[]) rand.ints(minPop, maxPop + 1) populations = rand.ints(minPop, maxPop + 1)
.limit(numSections) .limit(numSections)
.boxed() .boxed()
.toArray(); .toArray(Integer[]::new);
System.out.print("Populations: "); System.out.print("Populations: ");
System.out.println(Arrays.toString(populations)); System.out.println(Arrays.toString(populations));
} }