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...


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
/ Project # 2
#include<iostream>
#include<iomanip>
#include<math.h>
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)
     {
          P[row+1]=Traffic[0]*((N-row)/(row+1))*P[row];
   
     }
     
else 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)
     {
          P[row+1]=Traffic[1]*((N-row)/(row+1))*P[row];
    
     }
     
else 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)
     {
          P[row+1]=Traffic[2]*((N-row)/(row+1))*P[row];
   
     }
     
else 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)
     {
          P[row+1]=Traffic[3]*((N-row)/(row+1))*P[row];
    
     }
     
else 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$"<<L;
 cout<<"\n\n\n";
 cout<<"Total number of machines=\t"<<N;
 cout<<"\n\n\n";
 cout<<"Types of technicians:      \tFast         \tSlow";
 cout<<"\n";
 cout<< "\n      Corresponding wages:    $"<< HourlyFastRates<<"/hr"; 
 cout<<"        $"<<HourlySlowRates<<"  hr";           
 cout<<"\n";
 cout<<"\n      And repair rates:       $"<< RepairFastRates<<"/hr";
 cout<<"          $"<<RepairSlowRates<<"/hr";
 cout<< "\n\n                               ";
 cout<<"\nTypes of machines:        \tGood         \tPoor";
 cout<<"\n\n      Fail Rates              "<<FailGoodRates<<"/hr";
 cout<<"       "<<FailPoorRates<<"/hr";
 cout<<"\n\n\n\n\n";
  cout<<"Type of    ";cout<<"Type of    ";cout<<"  Traffic";cout<<"       Optimum"; cout<<"    Total";
 cout<<"\nWorker    ";cout<<" Machine    ";cout<<"  intensity";cout<<"     number";cout<<"     Cost";
 cout<<"\n\n";
 cout<<"\nFast       "<<"good           "<<Traffic[0]<<"     "<<Rmin[0]<<"      $"<<ans[0];       
 cout<<"\n";   
 cout<<"\nFast       "<<"poor           "<<Traffic[1]<<"            "<<"       $"<<TotalCost[1];
 cout<<"\n";
 cout<<"\nSlow       "<<"good           "<<Traffic[2]<<"            "<<"   $"<<TotalCost[2];
 cout<<"\n";
 cout<<"\nSlow       "<<"poor           "<<Traffic[3]<<"            "<<"    $"<<TotalCost[3];
 cout<<"\n";
 
 cout<<"\n";

 
 
 cout<<"tThe Md1= "<<Md[0];
  cout<<"\n";
  cout<<"\nThe Md2 =  "<<Md[1];
  cout<<"\n";
  cout<<"\nThe Md3=   "<<Md[2];
  cout<<"\n";
  cout<< "\nThe Md4=   "<<Md[3];
  cout<<"\n\n";
system("pause");
}
 


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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  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.