//single-server queuing sysytem #include <stdio.h> #include <stdlib.h> #include <math.h> #define BUSY 1 /* when the server is busy */ #define IDLE 0 /*states when the system is idle*/ int next_event_type, num_custs_delayed, num_delays_required, num_events, num_in_q, server_status; float area_num_in_q, area_server_status, mean_interarrival, mean_service, time, time_arrival[1], time_end, time_last_event, time_next_event[4], total_of_delays; //FILE *infile, *outfile; void initialize(void); void timing(void); void arrive(void); void depart(void); void report(void); void update_time_avg_stats(void); float expon(float mean); int main() { //number of events for the function num_events = 3; mean_interarrival = 1; mean_service = 0.5; time_end = 100; //runtime initialize(); /* Run the simulation until while more delays are still needed event (type 3) occurs. */ do { /*
Posts
Showing posts from 2018