1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
int main(){
vector<int> haha;
int inti,clock;
info in;
clock =0;
vector<sys_info> running;
vector<sys_info> arrival;
vector<sys_info> ready;
vector<sys_info> waiting;
ifstream ifs("file.txt");
if(!ifs) {cout << "could not open the file"; exit(1);
}else{
while(ifs>>inti){
//cout << inti <<" ";
sys_info temp;
cout << inti <<endl;
temp.id = inti;
ifs>>inti;
cout << inti <<endl;
temp.arrival_time = inti;
ifs>>inti;
cout << inti <<endl;
temp.total_cpu = inti;
ifs>>inti;
cout << inti <<endl;
temp.arrival_time = inti;
arrival.push_back(temp);
}
}
for(int i=0 ; i < arrival.size() ; i++){
print_cpu_info(arrival[i]);
}
cout << "==============" << endl;
cout << " FCFS " << endl;
cout << "==============" << endl;
//void print(int time, string running,string arrival,int rp ,string ready,string waiting,int t1,int remain)
//print(in.time,in.running,in.arrival,in.rp,in.ready,in.waiting,in.t1,in.remain);
//print(clock,running,arrival,ready,waiting);
//runningFunc(running,arrival,ready,waiting,in,clock);
}
|