|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% Z+ C/ m" [2 n6 c) L$ W
* Y- P! ?0 X9 \- i" M我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。/ A$ @+ |7 |0 }. Z* M9 A* q
6 f" Q$ W( q- X3 o) z; _
begin P_read arriving' V6 p' O ~: ~0 i8 T1 f" I
while 1=1 do begin; \$ f0 t; J( o0 D/ r
read A_tote from "data.txt" with delimiter "\n"
; u7 L, c& A6 i4 g, ?: ? ] read A_time from "data.txt" with delimiter "\n"
0 c4 q* E: e5 x read A_leave from "data.txt" with delimiter "\n"
8 d' o2 ?. G" A+ o" V! B& B read A_picks from "data.txt" with delimiter "\n"2 i- O6 K* m- E( z, ?! c
set load type to A_tote* G- a5 }3 V% y* p, b2 U: v7 }- I/ D
if A_tote="tote 1" then set A_induct to 1
% D. x, D# W4 q' U$ G else if A_tote="tote 2" then set A_induct to 2
9 v- z! I# o2 F# A, Z else set A_induct to 3
7 y- q5 @, K+ Y' U5 ? set A_i to 09 L+ p. q- D% N0 {2 ~4 F+ B1 t
clone 1 load to P_induction
8 h8 A9 A! X8 V' O: r9 v wait for A_time sec7 N: X4 d! y. N
end
D- `. s9 z$ Q% O4 i* ?2 {" @2 vend
) Z' s% A4 z* b( P5 c; }5 E7 j. |
begin P_induction arriving
4 ^+ B( r# x3 }4 y' w$ [ if A_induct=1 then clone 1 load to P_pick1; X$ F4 Z% _6 K% S( n- i- E5 V
else if A_induct=2 then clone 1 load to P_pick2
# c6 }) m, \8 l% Y else clone 1 load to P_pick3
4 x1 S' F; W% b" R }$ ^3 H- [end
' i l* l3 B) l- T |" T7 C
, b- h M7 R% i8 x0 ?% w4 nbegin P_pick1 arriving
0 i5 c; ^# G$ Q+ n$ V set A_i to 1
9 D$ }3 V1 M! e" `' f, f/ I move into Q_induct1
0 N, J5 ], q8 {# [, P e4 s3 a5 e% B8 p move into pickaisle.induct11 W, \. Q% R+ E* c5 R
while A_i<=30 do begin! w7 V h. i* ~& G
travel to pickaisle.con(A_i)
/ \$ M3 y4 n# e8 [5 ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# L: r' k# T2 ?. {) J8 X
else wait for 10 sec
' R2 l1 d! b- u0 a if A_i=A_leave then send to die4 b, t: F: k, O; W0 O
else inc A_i by 1
1 U6 Q j7 F) g' p- O- n end; s9 m0 G4 g8 j; k& M" R
end3 H7 m+ ^' ?* x" z
+ g$ R# V7 n* b+ f) o; \- bbegin P_pick2 arriving
8 ^5 o) b% ^' z8 _ set A_i to 11
0 P: F$ \: p' j4 l, w move into Q_induct2
* j$ J0 ]) m& c; m! h' p move into pickaisle.induct2; l2 c; t4 D" o: t9 a" M
while A_i<=30 do begin
' x7 ]* a) d2 g8 M travel to pickaisle.con(A_i): }" Y5 C7 P7 X) I& m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ d) w/ z+ B! c) J7 a& D
else wait for 10 sec0 `7 ]0 a* c) T2 m
if A_i=A_leave then send to die
: l- n. [# a. d0 z3 K else inc A_i by 1- N0 I7 ?$ t. Y: Z1 v
end, R! g6 N q' ]6 |5 Y6 `, f' `
end
! y# f5 D1 J- f( B8 b2 H; u6 [/ {$ @$ d7 c" \, S. E# G$ A( j
begin P_pick3 arriving8 T1 s4 h, s" e# [ F8 d
set A_i to 21
/ c8 w z: k$ k/ K3 M8 F5 E( J move into Q_induct3
; G* q+ z, u8 f) V! _+ j6 m. p move into pickaisle.induct30 W+ W2 O! x+ ]8 R# T
while A_i<=30 do begin
# Z- W c }. o" e- i7 `* Y7 { travel to pickaisle.con(A_i). D" o. d) R6 d$ {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. \! B+ | l8 ?$ S [) G# z- I
else wait for 10 sec }; z$ E( J7 k% B9 X+ v
if A_i=A_leave then send to die
: n: r6 S/ s( `" m- f else inc A_i by 1
/ I: J) ]* {4 d9 K' F end2 C4 R7 |- w6 o1 |2 |* E, W
end |
最佳答案
查看完整内容
pickaisle.induct1/2/3是个什么东东?
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
|