/* Program to simulate a scheduler for an operating system.  
 * Framework created by Henry M. Walker on 27 September 2004
 * Revised by
 *   Janet Davis, 24 September 2006
 *   Jerod Weinman, 27 May 2008
 */

#ifndef __SCHEDULER_SIMULATION_H__
#define __SCHEDULER_SIMULATION_H__

#include "scheduler.h"  /* for the scheduler data structures */

/* specify file listing the jobs to simulate */
#define JOB_FILE_NAME "/home/weinman/public_html/courses/CSC213/2008F/examples/scheduler/scheduler_job_data.txt"
/* A single struct for all of the data we're interested in studying */
struct performanceData {
  int jobsStarted;
  int jobsCompleted;
  int contextSwitches;
  double totalProcTime;
  double totalWaitTime;
};

/* Functions to handle the various events generated by the simulation */

void initializeEventList(void);
void executeNextEvent(void);
void enqueueEvent (EventHandlerFunc * eventHandler, struct Event * job, 
                   double arrivalTime);
void registerJob (struct Event* job);
void processJob (struct Event* job);
void scheduler (struct Event* job);
void printEventList(void);
void printStatistics(void);
void nonPreEmptiveUpdate (struct Event* job);
void preEmptiveUpdate (struct Event* job, double quantum);
void preEmptiveFinish (struct Event* job);

#endif
