{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

EE555-USC-Spring08-Silvester-HW1-Bonus Simulation Question Solution-Q7 Plots

# EE555-USC-Spring08-Silvester-HW1-Bonus Simulation Question Solution-Q7 Plots

This preview shows pages 1–5. Sign up to view the full content.

Sample Output for p = 0.3, and 50 Time Slots

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Sample Output for p = 0.6, and 50 Time Slots
Sample Output for p = 0.9, and 50 Time Slots

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Source Code for the Simulator #include <stdio.h> #include <stdlib.h> #include <math.h> #include <time.h> #define N 10 #define M 4 int main() {     int Idle_Nodes=N, Requesting_Nodes=0, Busy_Nodes=0, Free_Channels=M, Slots4BusyNode[N]={0}, slots=15, R2B;     int PIdle_Nodes=Idle_Nodes, PRequesting_Nodes=Requesting_Nodes, PBusy_Nodes=Busy_Nodes,  PFree_Channels=Free_Channels;     bool I2R[N]={false};     double p;          printf("\n\nPlease Enter the number of slots for which you wish to run this simulation: ");     scanf("%d",&slots);     printf("\n\nPlease Enter the values for p: ");     scanf("%lf",&p);     srand48((unsigned)(time(0)));          printf("Slot # 1::\tIdle Nodes: %d,\tRequesting Nodes: %d,\tBusy Nodes: %d,\tFree Data Channels=  %d\n\n",Idle_Nodes,Requesting_Nodes,Busy_Nodes, Free_Channels);
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

EE555-USC-Spring08-Silvester-HW1-Bonus Simulation Question Solution-Q7 Plots

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online