001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079 080 081 082 083 084 085 086 087 088 089 090 091 092 093 094 095 096 097 098 099 100 101 102 103 104 105 111 112 113 114 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
|
#rcpsp_u.res.txt
#=======================================================================
#リソースの定義(作業員)
#=======================================================================
#職種、員数(時数)、倍率 [job,persons,eps]
H={
1:["H[1]", 28*10, 1], #取付
2:["H[2]", 43*10, 1], #溶接
3:["H[3]", 12*10, 1], #塗装
4:["H[4]", 5*10, 2], #鉄艤
5:["H[5]", 7*10, 2], #甲配
6:["H[6]", 5*10, 2], #機配
}
def res1(prob,H):
res1H={}
for i in [1,2,3,4,5,6]:
r=math.floor(H[i][1]*H[i][2]);
res1H[i]=prob.addResource(H[i][0], capacity={(0,"inf"):r})
return res1H
res1W=res1(prob,H)
#=======================================================================
#リソースの定義(場所)
#=======================================================================
#場所の名前、矩形サイズLxB [name,L=L2-L1+1,B=B2-B1+1]
R={
1:["R[P01]", 58, 13], # 1:["R[1K]", 58, 13],\
2:["R[P02]", 58, 13], # 2:["R[2K]", 58, 13],\
3:["R[P03]", 42, 16], # 3:["R[3K]", 42, 16],\
4:["R[P04]", 26, 43], # 4:["R[4K]", 26, 43],\
5:["R[P05]", 52, 12], # 5:["R[5KU]", 52, 12],\
6:["R[P06]", 52, 11+2], # 6:["R[5KR]", 52, 11+2],\
7:["R[P07]", 61, 26+3], # 7:["R[6K]", 61, 26+3],\
8:["R[B01]", 16, 19], # 8:["R[AB]", 16, 19],\
9:["R[B02]", 16, 19], # 9:["R[BB]", 16, 19],\
10:["R[B03]", 16, 19], #10:["R[CB]", 16, 19],\
11:["R[Q01]", 40, 18], #11:["R[D40]", 40, 18],\
12:["R[Q02]", 50, 18], #12:["R[D50]", 50, 18],\
13:["R[Q03]", 70, 22], #13:["R[D70]", 70, 22],\
14:["R[Q04]", 40, 14], #14:["R[RD1]", 40, 14],\
15:["R[Q05]", 35, 17], #15:["R[RD3]", 35, 17],\
16:["R[Q06]", 40, 15], #16:["R[RD4]", 40, 15],\
17:["R[Q07]", 30, 12], #17:["R[RD5]", 30, 12],\
18:["R[Q08]", 32, 12], #18:["R[RD6]", 32, 12],\
19:["R[Q09]", 35, 15], #19:["R[RD7]", 35, 15],\
20:["R[Q10]", 30, 12], #20:["R[RD30]",30, 12],\
21:["R[Q11]", 30, 12], #21:["R[RD8]",30, 12],\
22:["R[DOC]",136, 24], #22:["R[DOC]",136, 24],\
23:["R[R06]", 4, 14], #23:["R[1Kb]", 4, 14],\
24:["R[R01]",9+2, 13+1], #24:["R[1Ka]",9+2, 13+1],\
25:["R[R07]", 4, 14], #25:["R[2Kb]", 4, 14],\
26:["R[R02]", 51-25*0, 13], #26:["R[2Ka]", 51-25*0, 13],\
27:["R[R03]", 26, 18], #27:["R[3Ka]", 26, 18],\
28:["R[R04]", 5, 10], #28:["R[7K]", 5, 10],\
29:["R[R05]", 6, 29], #29:["R[6Ka]", 6, 29],\
}
#-----各場所の長さ方向線分[L1,L2]・幅方向線分[B1,B2]
P01= [ 1,0, R[1][1],0, R[1][2]] #K1
P02= [ 2,0, R[2][1],0, R[2][2]] #K2
P03= [ 3,0, R[3][1],0, R[3][2]] #K3
P04= [ 4,0, R[4][1],0, R[4][2]] #K4
P05= [ 5,0, R[5][1],0, R[5][2]] #K5U
P06= [ 6,0, R[6][1],0, R[6][2]] #K5R
P07= [ 7,0, R[7][1],0, R[7][2]] #K6
B01 =[ 8,0, R[8][1],0, R[8][2]] #AB
B02 =[ 9,0, R[9][1],0, R[9][2]] #BB
B03 =[10,0,R[10][1],0,R[10][2]] #CB
Q01= [11,0,R[11][1],0,R[11][2]] #D40
Q02= [12,0,R[12][1],0,R[12][2]] #D50
Q03= [13,0,R[13][1],0,R[13][2]] #D70
Q04= [14,0,R[14][1],0,R[14][2]] #RD1
Q05= [15,0,R[15][1],0,R[15][2]] #RD3
Q06= [16,0,R[16][1],0,R[16][2]] #RD4
Q07= [17,0,R[17][1],0,R[17][2]] #RD5
Q08= [18,0,R[18][1],0,R[18][2]] #RD6
Q09= [19,0,R[19][1],0,R[19][2]] #RD7
Q10= [20,0,R[20][1],0,R[20][2]] #RD3
Q11= [21,0,R[21][1],0,R[21][2]] #RD8
R06= [23,0,R[23][1],0,R[23][2]] #K1b
R01= [24,0,R[24][1],0,R[24][2]] #K1a
R07= [25,0,R[25][1],0,R[25][2]] #K2b
R02= [26,0,R[26][1],0,R[26][2]] #K2a
R03= [27,0,R[27][1],0,R[27][2]] #K3a
R04= [28,0,R[28][1],0,R[28][2]] #K7
R05= [29,0,R[29][1],0,R[29][2]] #K6a
#
P00=[P01,P02,P03,P04,P05,P06,P07]
B00=[B01,B02,B03]
Q001=[Q01,Q02,Q03,Q11]
Q002=[Q04,Q05,Q06,Q07,Q08,Q09,Q10]
Q00=Q001+Q002
R00=[R01,R02,R03]
#-----メッシュの使用可否
def res3(prob,R):
res3PL={}
S={}
for id in R:
res3PL[id]=0
S[id]=0
#if not id in [2,3,4,5,6,11,13,14,15,16,17,18,19,20]:
if not id in [2,3,4,5,6,7,13]:
for i in range(0,R[id][1]):
for j in range(0,R[id][2]):
res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):1})
S[id]+=1
if id==2:
for i in range(0,R[id][1]):
for j in range(0,R[id][2]):
if i in range(0,15) and j in range(0,13):
res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):0})
else:
res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):1})
S[id]+=1
if id==3:
for i in range(0,R[id][1]):
for j in range(0,R[id][2]):
if i in range(0,28) and j in range(0,2):
res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):0})
# elif i in range(0,4) and j in range(2,15):
# res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):1})
# elif i in range(0,46) and j in range(15,16):
# res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):1})
else:
res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):1})
S[id]+=1
if id==4:
for i in range(0,R[id][1]):
for j in range(0,R[id][2]):
if i in range(1,13) and j in range(13,14):
res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):0})
else:
res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):1})
S[id]+=1
if id==5:
for i in range(0,R[id][1]):
for j in range(0,R[id][2]):
if i in range(0,13) and j in range(0,12):
res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):0})
else:
res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):1})
S[id]+=1
if id==6:
for i in range(0,R[id][1]):
for j in range(0,R[id][2]):
if i in range(0,3) and j in range(0,13):
res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):0})
else:
res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):1})
S[id]+=1
if id==7:
for i in range(0,R[id][1]):
for j in range(0,R[id][2]):
#if i in [0,22,23,24,25,26,27,28,29,30,31,32,33,34,35] and j in range(0,13):
if i in range(22,36) and j in range(0,13):
res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):0})
#elif i in range(1,22) and j in range(0,1):
elif i in range(0,22) and j in range(0,1):
res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):0})
else:
res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):1})
S[id]+=1
if id==13:
for i in range(0,R[id][1]):
for j in range(0,R[id][2]):
#if i in [31,32,33,34,35,36,37,64,65,66,67,68,69] and j in range(1,21):
if i in [31,32,33,34,35,36,37,65,66,67,68,69] and j in range(0,22):
res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):0})
# elif i in range(0,70) and j in [0,21]:
# res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):1})
else:
res3PL[id,i,j] =prob.addResource(R[id][0]+"[{0:02d}_{1:02d}]".format(i,j), capacity={(0,"inf"):1})
S[id]+=1
return res3PL,S
res3PL,S=res3(prob,R)
#-----
def res2(prob,R,S):
res2S={}
for id in R:
res2S[id]=prob.addResource("A[{0:02d}]".format(id), capacity={(0,"inf"):S[id]})
return res2S
res2S=res2(prob,R,S)
#sys.exit()
|