### I can't calculate optimum number of Technicians?

I can't calculate optimum number of Technicians to hire, I tried many time,I changed formulas a lot but finally I have wrong answers...

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210`` ``````/ Project # 2 #include #include #include using namespace std; int main() { // Defin Variables float N,L,P[71],FastWorkers,SlowWorkers,; float HourlyFastRates,FailPoorRates,FailGoodRates,RepairSlowRates,sum5,sum6; float RepairFastRates,HourlySlowRates,sum[10],U[15]; float Traffic[4],Md[4],TotalCost[4],Rmin[4],min[4],ans[4]; int row,Rmax,R; row=0; //Data inputof case R=15; N=70; L=250; FailGoodRates=.033; FailPoorRates=.038; HourlyFastRates= 17.95; HourlySlowRates= 14.00; RepairFastRates=0.40; RepairSlowRates=0.34; // good & fast P[0]=1; min[0]=1000000000; Traffic[0]=FailGoodRates/RepairFastRates; for(row=0;row<=70;row=row+1) { if (row=R && row<=N) { P[row+1]=Traffic[0]*((N-row)/(R+1.0))*P[row]; } sum[0]=sum[0]+row*P[row]; sum[1]=sum[1]+P[row]; Md[0]=sum[0]/sum[1]; TotalCost[0]=((R*HourlyFastRates)+(Md[0]*L)); } ans[0]=TotalCost[0]; for(R=0;R<=14;R=R+1) >>>>>>> WHY THIS FORMULA DOESN'T WORK? { if(ans[0]>TotalCoct[0]) { ans[0]=TotalCost[0]; Rmin[0]=R+1; } } cout<<"\n\n"; //Poor & Fast P[0]=1; min[1]=1000000000; Traffic[1]=FailPoorRates/RepairFastRates; for(row=0;row<=70;row=row+1) { if (row=R && row<=N) { P[row+1]=Traffic[1]*((N-row)/R)*P[row]; } sum[2]=sum[2]+row*P[row]; sum[3]=sum[3]+P[row]; Md[1]=sum[2]/sum[3]; TotalCost[1]=(R*HourlyFastRates)+(Md[1]*L); } cout<<"\n\n"; // Good & Slow P[0]=1; min[2]=1000000000; Traffic[2]=FailGoodRates/RepairSlowRates; for(row=0;row<=70;row=row+1) { if (row=R && row<=N) { P[row+1]=Traffic[2]*((N-row)/R)*P[row]; } sum[4]=sum[4]+row*P[row]; sum[5]=sum[5]+P[row]; Md[2]=sum[4]/sum[5]; TotalCost[2]=(R*HourlyFastRates)+(Md[2]*L); } cout<<"\n\n"; //Poor & Slow P[0]=1; min[3]=1000000000; Traffic[3]=FailPoorRates/RepairSlowRates; for(row=0;row<=70;row=row+1) { if (row=R && row<=N) { P[row+1]=Traffic[3]*((N-row)/R)*P[row]; } sum[6]=sum[6]+row*P[row]; sum[7]=sum[7]+P[row]; Md[3]=sum[6]/sum[7]; TotalCost[3]=(R*HourlyFastRates)+(Md[3]*L); } cout<<"\n\n"; cout<<"Downtime loss per machine= \t\$"<

The formula is doesn't work and I don't understand why....

The first answer must be :
 ``` Fast good 0.0825 9 \$1521.61 ```

That what I have for answer :

 ``` Downtime loss per machine= \$250 Total number of machines= 70 Types of technicians: Fast Slow Corresponding wages: \$17.95/hr \$14 hr And repair rates: \$0.4/hr \$0.34/hr Types of machines: Good Poor Fail Rates 0.033/hr 0.038/hr Type of Type of Traffic Optimum Total Worker Machine intensity number Cost Fast good 0.0825 2 \$-2.13979e-029 Fast poor 0.095 \$1787.62 Slow good 0.0970588 \$1817.64 Slow poor 0.111765 \$2029.09 tThe Md1= 5.33489 The Md2 = 6.07348 The Md3= 6.19356 The Md4= 7.03935 Press any key to continue . . . ```

Last edited on
What is the program supposed to do?
What have you done up to now?
Where do you have problem?

Also use the first button to your button-right toolbar: it's for publishing your code!

You must help a little your helpers...

What is the program supposed to do?
What have you done up to now?
Where do you have problem?

1.

4. Here’s a high level algorithm for this project – you will need to break it down more:
a. Set up one of the cases – simplify by assuming you only have one case for now.
b. input data – simplify by hardcoding it in for now
c. calculate T
d. For first R: - simplify by assuming there is only one value of R for now
e. Calculate Md
1) find each p(n+1)
2) sum up all the p(n)’s
3) do each n*p(n)
4) sum up all n*p(n)’s
5) calculate Md
f. calculate cost
g. do the next R
h. once the cost for each R is calculated, find the minimum and output answer
i. do the next case

I am almost done but i can find part: h.
I can figure out how and what formula should i use to calculate minimum .

DESCRIPTION OF PROBLEM:
A large manufacturing plant has many identical machines, all of which are subject to failure at random times. Technicians are hired to patrol and service the machines. Determining the appropriate number of technicians to hire depends on the following considerations:
** Good technicians are expensive but can complete the service faster. We will consider two types of technicians; using fast, experienced, but expensive technicians and using slower, less qualified, but less expensive technicians.
** A technician can work on only one machine at a time, so if we have more machines down than we have technicians, then machines may have to wait for repair. This will result in productivity loss to the company (which translates to money lost – a cost).
** Too many technicians will ensure that when a machine goes down, it will be serviced immediately however, it may result in excessive idle time for the many technicians – then we’re paying people to do nothing!

So, in conclusion, we must decide how many technicians to hire and which type to hire (fast or slow).

@zed55

It looks to me that you are not incrementing the arrays.
 ``123456789101112131415`` `````` sum[0]=sum[0]+row*P[row]; // using only sum[zero] sum[1]=sum[1]+P[row];// using only sum[one] Md[0]=sum[0]/sum[1]; // Md[zero] TotalCost[0]=((R*HourlyFastRates)+(Md[0]*L));//TotalCost[zero] } ans[0]=TotalCost[0]; for(R=0;R<=14;R=R+1) // >>>>>>> WHY THIS FORMULA DOESN'T WORK? { if(ans[0]>TotalCoct[0]) { ans[0]=TotalCost[0];// Again, only the zero element is checked Rmin[0]=R+1; // Only Rmin[zero] is increased and only by R plus 1. Highest it can be is 15 } } ``````
Last edited on
Topic archived. No new replies allowed.