////////////////////////////////////////////////////// // // // Incremental Clock Syncronization. // // 236503(20) Summer 2001 // // Advanced Programming Project. // // Technion. Computer Science Department. // // // // Written by: Reitman Anna // // Fidelman Greg // // Supervisor: Hagit Attya // // Saar Pilosof // // // ////////////////////////////////////////////////////// // IncClockSynch.h #ifndef _INCCLOCKSYNCH_H #define _INCCLOCKSYNCH_H #pragma warning(disable:4786) //#define DBG if( 1 ) std::cout enum Scenario { UNDEF, GAP_TIME, TIME_PROC, NEW_PROC }; // The way of sending of the messages (random, sequential...) enum SendMsgRule { RANDOM, SEQUENTIAL }; typedef struct { long ProcNum; //total number of processes long MinClock; //min initial clock value long MaxClock; //max initial clock value long PercentCorrectProc; //percent of correct processes (with average clock value) long StopTime; //time to stop the testing (in ticks) } GapTimeInput; typedef struct { long MaxProcNum; //max number of processes long MinClock; //min initial clock value long MaxClock; //max initial clock value long PercentCorrectProc; //percent of correct processes (with average clock value) long StopGap; //gap to stop the testing long StopTime; //time to stop the testing (in ticks) } TimeProcInput; typedef struct { long MaxProcNum; //max number of processes long ClocksValue; //clock value of old processes long NewClockValue; //clock value of the incoming process long StopGap; //gap to stop the testing long StopTime; //time to stop the testing (in ticks) } NewProcInput; extern int NumMsg; extern SendMsgRule rule; extern CFile outputFile; int mainPr(long,long,long,long,long); int mainPr(long,long,long,long,long,long); int mainPt(long,long,long,long,long); #endif //_INCCLOCKSYNCH_H