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

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

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

View Full Document Right Arrow Icon
Sample Output for p = 0.3, and 50 Time Slots
Background image of page 1

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

View Full DocumentRight Arrow Icon
Sample Output for p = 0.6, and 50 Time Slots
Background image of page 2
Sample Output for p = 0.9, and 50 Time Slots
Background image of page 3

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

View Full DocumentRight Arrow Icon
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);
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/05/2009 for the course EE 555 taught by Professor Silvester during the Spring '08 term at USC.

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 Right Arrow Icon
Ask a homework question - tutors are online