/* * * * * * * * * * * * * * * * * * * * * * * * * *\ * CS2310 Term Project * * Heuristic Time Scheduling Algorithm * * Yue Zhang * * zysxqn@cs.pitt.edu * \* * * * * * * * * * * * * * * * * * * * * * * * * */ /*Header file:HTSA.H*/ /*define the main data structure*/ /*include*/ #include #include ofstream out; /*define*/ #define BUSY 0 #define FREE 1 #define WORK 2 #define TRAVEL 3 #define SERVE 4 #define REST 5 /*location*/ struct LOCATION{ int x; int y; }; /*time slot*/ class SLOT{ //artributes public: int name; //nurse: work, serve, travel, rest; patient: free, busy int start_time; int end_time; LOCATION start_location; LOCATION end_location; //operations public: void FillSlot(int n, int s_t, int e_t, LOCATION s_l, LOCATION e_l) { name=n; start_time=s_t; end_time=e_t; start_location.x=s_l.x; start_location.y=s_l.y; end_location.x=e_l.x; end_location.y=e_l.y; } void print(void) { out<<"|slot"<<'\t';if(name==REST)out<<"rest";else if(name==TRAVEL)out<<"travel";else if(name==SERVE)out<<"serve";out<<'\t'<<'|'<<'\n'; out<<" ---------------\n"; out<<"|start"<<'\t'<