Skip to main content

Posts

Showing posts from September 20, 2012

Grocery Shop by simulation

Name :-Khushboo Roll no:-MCA/4518/10 #include #include #include #define MAX 5 typedef struct arrival { float prob; float c_prob; int min; }; typedef struct service { float prob; float c_prob; int min; }; typedef struct simulation { int cust_no; float random; int inter_arr; int c_inter_arr; float rand_no; int service_tym; int s_start; int s_end; int w_tym; int t_s_tym; int idle_tym; }; typedef struct FEL { char ch; int min; int cust_no; }; FEL fel[(MAX*2)]; arrival arr[8]; service ser[6]; simul ation sim[MAX]; void arr_prob() { int i; for(i=0;i<8;i++) { arr[i].min=i+1; arr[i].prob=.125; if(i==0) arr[i].c_prob=0.0; else arr[i].c_prob=arr[i-1].c_prob+arr[i-1].prob; } } void ser_prob() { int i; ser[0].prob=0.1;ser[1].prob=0.2;ser[2].prob=0.3; ser[3].prob=0.25;ser[4].prob=0.1; ser[5].prob=0.05; for(i=0;i<6;i++) { ser[i].min=i+1; if(i==0) ser[i].c_prob=0.0; else ser[i].c_prob=ser[i-1

One ofd best FEL by Kalpana

#include #include #include int ia(int a) { if(a>=0 && a<=25) return 1; if(a>=26 && a<=50) return 2; if(a>=51 && a<=75) return 3; if(a>=76 && a<=99) return 4; return 0; } int sa(int a) { if(a>=0 && a<=25) return 1; if(a>=26 && a<=50) return 2; if(a>=51 && a<=75) return 3; if(a>=76 && a<=99) return 4; return 0; } void main() { int a[5],notice[2][2],b[5],e[5],d[5]={0,0,0,0,0},f[5],i,c[5],s1[5]; clrscr(); for(i=0;i<5;i++) { a[i]=rand()%100; s1[i]=rand()%100; } for(i=0;i<5;i++) { if(i==0) { b[i]=ia(a[i]); f[i]=b[i]; } else { b[i]=b[i-1]+ia(a[i]); if(d[i-1]>b[i]) f[i]=d[i-1]; else f[i]=b[i]; } c[i]=sa(s1[i]); e[i]=65+i; d[i]=f[i]+c[i]; notice[1][0]=b[i]; notice[1][1]=e[i]; if(i>0 && notice[1][0] 0 && notice[1][0]>notice[0][0]) printf( " (%d,%c)(%d,%c)\n",notice[0][0],notice[0][1],notice[1][0],notice[1][1]); if(i==0) printf("

Grocery Shop FEL example

Name: Mukesh H Mulani Roll No : MCA/4527/10 #include #include #include typedef struct { int cno,in_arr,arr,ser_time,tsb,tse,wait,tsis,idle; }customer; int lookup1(int c) { if(c>=0 && c<13 1="1" c="c" else="else" if="if" return="return">=13 && c<25 2="2" c="c" else="else" if="if" return="return">=25 && c<38 3="3" c="c" else="else" if="if" return="return">=38 && c<50 4="4" c="c" else="else" if="if" return="return">=50 && c<63 5="5" c="c" else="else" if="if" return="return">=63 && c<75 6="6" c="c" else="else" if="if" return="return">=75 && c<87 7="7" 8="8&qu

FEL example

Sumit Prasad (MCA/4521/10) #include #include #include int interarr(int rand) { if(rand>=0&&rand<=12) return 1; if(rand>=13&&rand<=25) return 2; if(rand>=26&&rand<=37) return 3; if(rand>=38&&rand<=50) return 4; if(rand>=51&&rand<=62) return 5; if(rand>=63&&rand<=75) return 6; if(rand>=76&&rand<=87) return 7; if(rand>=88&&rand<=99) return 8; return 0; } int main() { int arrival=0,s[10],ia,idle=0,st,servend,servbegin=0,r[10],i,wt=0,notice[2][2]; char ch='A'; clrscr(); for(i=0;i<10 i="i" p="p">  {   r[i]= rand()%100;   s[i]=rand()%100;   } printf("Sno.Interarr Arr Servtime Servbegin Servend WT Idle  Event     Fel\n"); for(i=0;i<5 i="i" p="p">{ ia=interarr(r[i]); st=interarr(s[i]); servend=servbegin+st; wt=servbegin-arrival; if(i>0) printf("(%d,%c),(%d,%c)\n\n&

FEL grocery

FEL by Saurabh Piyush MCA/4509/10 */ FEL GENERATED FOR 500 CUSTOMERS------TIME =1000 mins */ #include #include #include typedef struct { int cust_no,int_arrival,arrival,service,tsb,tse,wait,tsis,idle; }customer; int lookup2(int c) { if(c>=0 && c<11) { return 1; } else if(c>=11 && c<31) { return 2; } else if(c>=31 && c<61) { return 3; } else if(c>=61 && c<86) { return 4; } else if(c>=86 && c<96) { return 5; } return 6; } int lookup1(int c) { if(c>=0 && c<13) { return 1; } else if(c>=13 && c<25) { return 2; } else if(c>=25 && c<38) { return 3; } else if(c>=38 && c<50) { return 4; }