// CPU.cpp     Dave Reed      1/20/05
//
// Simple CPU simulator.  A collection of jobs/processes are read in from a file,
// and then executed using timesharing (time slice and load delay are specified
// by the user).  Note: no interrupts other than timeouts are modeled.
/////////////////////////////////////////////////////////////////////////////////

#include <iostream>
#include <string>
#include "Job.h"
#include "CPUScheduler.h"
using namespace std;

int main()
{
    string filename;
    cout << "Enter the job file name: ";
    cin >> filename;

    int timeSlice, loadDelay;
    cout << "Enter the load delay and time slice length: ";
    cin >> loadDelay >> timeSlice;
    cout << endl;

    CPUScheduler timeshare(filename, loadDelay, timeSlice);

    while (timeshare.jobsRemaining()) {
        timeshare.execute();
    }

    return 0;
}

