//===========================================---========= file = n_mm1.c ===== //= A CSIM18 simulation of a N parallel M/M/1 queueing systems = //============================================================================ //= Notes: Program written to evaluate scaling of CSIM process model = //=--------------------------------------------------------------------------= //= History: KJC (06/30/02) - Genesis = //============================================================================ #pragma warn -pro // Disable function prototype warn (bcc) #pragma warn -stu // Disable undefined structure warn (bcc) //----- Includes -------------------------------------------------------------- #include // Needed for printf() #include "csim.h" // Needed for CSIM18 stuff //----- Constants ------------------------------------------------------------- #define N 1000 // Number of M/M/1 systems to simulate //----- Globals --------------------------------------------------------------- FACILITY Server[N]; // Pointer for N Server facilities double Sim_time; // Total simulation time in seconds double Lambda; // Mean arrival rate (cust/sec) double Mu; // Mean service rate (cust/sec) int Arrival_count; // Count of all arrivals //----- Prototypes ------------------------------------------------------------ void generate(int sta_id); // Generators void (* gen[(N)])(int sta_id); void queue_node(int sta_id, double service_time); // Nodes (queues) void (* node[N])(int sta_id, double service_time); //============================================================================= //== Main program == //============================================================================= void sim(void) { int i; // Loop counter double qmean; // Mean queue length // Create the simulation create("sim"); // Output begin-of-simulation banner printf("*** BEGIN SIMULATION *** \n"); // Increase maximums max_processes(1000000); max_events(1000000); max_servers(100000); max_facilities(1000000); // Paramter initializations Sim_time = 1.0e5; Lambda = 0.90; Mu = 1.00; // CSIM, variable, and pointer inializations Arrival_count = 0; for (i=0; i>> Simulation results - \n"); printf("=------------------------------------------------------------ \n"); for (i=0; i