Example #1
0
void init() {
	initGlobalData();
	initPassengers();
	initLiaisons();
	initManager();
	initCargoHandlers();
	initScreeningOfficers();
	initSecurityInspectors();
	initAirlines();

}
Example #2
0
int mainLoop(int passengerThreshold, int maxLevels, int maxWaiters, int maxPassengers, int elevatorSteps,int sleepMS, int doorTime){

	int newPassenger = 1;
	initElevator(maxLevels, maxPassengers, elevatorSteps, doorTime);
	initPassengers(maxWaiters, maxPassengers, maxLevels);

	while(running){
		simulateStep();
		newPassenger += (autoNew) ? 1 : 0;
		if(newPassenger > passengerThreshold){
			createRandom(1);
			newPassenger = 1;
		}
		usleep(sleepMS * microToMilli);
	}
	return running; //should be "0"
}