/* * main.cpp * * Created on: 31.10.2010 * Author: sven */ #ifndef GLOBAL_H_ #include "Global.h" #endif #ifndef TASK_H_ #include "Task.h" #endif #ifndef RMSSCHEDULER_H_ #include "RMSScheduler.h" #endif #ifndef DMSSCHEDULER_H_ #include "DMSScheduler.h" #endif #ifndef EDFSCHEDULER_H_ #include "EDFScheduler.h" #endif #ifndef RESPONSETIMEANALYSIS_H_ #include "ResponseTimeAnalysis.h" #endif #include #include #include #include const char* TASKS_FILE_NAME = "tasks.txt"; int lcm(int,int); int gcd(int,int); int load_tasks(const char*,task_set&); int main(int argc,char* argv[]) { int ci = 1; task_set tasks; load_tasks(TASKS_FILE_NAME,tasks); for(uint i=0;i> name >> c >> p >> d; if(name[0] != 0) { Task t(&name[0],c,p,d); tasks.push_back(t); } } task_file.close(); return EXIT_SUCCESS; } // Least Common Multiple int lcm(int a, int b) { return (a*b)/gcd(a, b); } // Greatest Common Divisor int gcd(int a, int b) { if(b == 0) { return a; } if(a == 0) { return b; } return gcd(b, a%b); }