* @param s - The System
* @param fileName - The input file
*/
-#define LINE_SIZE BUFSIZ
void System_Init(System * s, const char *fileName)
{
char line[LINE_SIZE];
printf("%u\t%f\t%u\t%f\n", universe.steps, runtime, (unsigned)(end - options.start_clock), clock_time);
}
+
+/**
+ * @function ExitCondition
+ * @purpose Helper to check whether the program is supposed to exit
+ * Does not check for user triggered quit
+ * Checks for either a timeout, or computation of the required number of steps
+ */
+bool ExitCondition(void)
+{
+ return ((options.timeout > 0.00 && ((unsigned)(time(NULL) - options.start_time.tv_sec) >= options.timeout))
+ || (options.num_steps > 0 && universe.steps > options.num_steps));
+}