/* File: main.cp Author: R. P. Futrelle Date: 7/31/98 Notice: Copyright 1998 by R. P. Futrelle and the College of Computer Science, Northeastern University Class: COM1204, Object-Oriented Design, Summer 1998. Proj: PS2.µ Metrowerks Code Warrior Mac. Done in IDE version 2.0.1. Purpose: Creates and inits the phone system and runs it with logging. This is for the phone system, 2nd design. Modification history: 7/31/98: RPF. Started. 8/1/98: RPF. Taking on final structure. First compilation with all files and includes, 1200h (noon) */ #include "includes.h" // A few globals System *sys; void main(void) { sys = new System(3); // 3 phones -- try it! sys->run(100, &string(""), false, 77); // run it this many steps with random seed // That's it! } /* Output of tests for version frozen on 8/8/98, 1:25pm is: picked up phone: 1 at 6 picked up phone: 2 at 7 picked up phone: 0 at 9 hung up phone: 1 at 12 hung up phone: 0 at 14 hung up phone: 2 at 14 picked up phone: 0 at 22 picked up phone: 1 at 23 picked up phone: 2 at 23 hung up phone: 0 at 26 hung up phone: 1 at 27 hung up phone: 2 at 28 picked up phone: 0 at 34 picked up phone: 1 at 36 hung up phone: 0 at 40 picked up phone: 2 at 41 hung up phone: 1 at 42 hung up phone: 2 at 47 In switch run test at time == 50 Control string in switch out line for phone: 0 is: ring Switch phone state ringing slot for phone: 0 is: 1 Control string in switch out line for phone: 1 is: ring Switch phone state ringing slot for phone: 1 is: 1 Control string in switch out line for phone: 2 is: ring Switch phone state ringing slot for phone: 2 is: 1 picked up phone: 0 at 51 picked up phone: 1 at 53 hung up phone: 0 at 55 hung up phone: 1 at 59 picked up phone: 2 at 59 picked up phone: 0 at 63 hung up phone: 2 at 66 picked up phone: 1 at 67 hung up phone: 0 at 69 hung up phone: 1 at 73 picked up phone: 2 at 75 picked up phone: 0 at 80 hung up phone: 2 at 82 picked up phone: 1 at 86 hung up phone: 0 at 87 hung up phone: 1 at 92 picked up phone: 2 at 93 picked up phone: 0 at 97 hung up phone: 2 at 98 */