/** * NOTICE: This program was developed as part of a graduate-level project for my M.S. in Computer Science at the University of West Florida * * Main Driver class for Collatz Sequence Project: * This program utilizes Threads to generate a Collatz sequence for numbers 2 to N and calculates the frequency of Collatz Stopping Times * * @author Lorenzo Waguespack * @date 7/5/2020 * @info Course COP5518 - University of West Florida * */ package driver; import java.time.Duration; import java.time.Instant; import java.util.ArrayList; import threads.CThread; import threads.ThreadData; public class CollatzSeq { public static void main(String[] args) { CThread ct = new CThread(); Instant start = Instant.now(); Instant end; Duration diff; int usrRange = Integer.parseInt(args[0]); int usrThreads = Integer.parseInt(args[1]); ThreadData shared = new ThreadData(usrRange,usrThreads); ArrayList threadList = new ArrayList(); for (int i=0; i,<" + freq + ">"); } end = Instant.now(); //Get the stopping time of the program to calculate total duration diff = Duration.between(start, end); System.out.println("\n"); System.err.println(usrRange + "," + usrThreads + "," + diff.toSecondsPart() + "." + diff.toNanosPart()); } }