|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ X2 t& {* j g4 h- H3 g; t( a1 N+ }5 Q" c8 L
我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 a4 P9 t% k- @5 W( y
& \9 g- y. E0 A% [) B+ r
begin P_read arriving
1 W( B1 C, P$ W3 Z2 S" h% U# } while 1=1 do begin. @, L( Q0 T! O! R7 O9 `4 v
read A_tote from "data.txt" with delimiter "\n"
$ E, ]! b5 t7 M2 v2 v0 ^ read A_time from "data.txt" with delimiter "\n"8 m. O, D5 H! S- K( x2 M, T5 \1 a
read A_leave from "data.txt" with delimiter "\n"
# M D1 b* ]3 l& }- t$ W7 V% t/ _8 j read A_picks from "data.txt" with delimiter "\n"
5 \- @' @% R7 q# n set load type to A_tote
% C: n1 u' f5 w if A_tote="tote 1" then set A_induct to 1
6 i2 `- Z& K5 J/ b; c else if A_tote="tote 2" then set A_induct to 2
3 q. w5 N, {( o4 x& C else set A_induct to 3 # K& m O* N9 {+ ?/ z
set A_i to 0: e& [; @$ L, i. v
clone 1 load to P_induction7 u' C8 H( y0 c6 \5 v
wait for A_time sec" p# x9 H1 ^) ?6 m
end
# I0 {7 j3 N$ X" g/ Tend: Y2 C. n( J5 S1 X
! k! h" ~7 T/ ^7 F0 i* N' X
begin P_induction arriving
& Y6 j+ o1 ?$ U* m. l if A_induct=1 then clone 1 load to P_pick1- j" Q. l1 i) [( a! I8 V1 N* _' {- ~
else if A_induct=2 then clone 1 load to P_pick29 N- @* y- w- T- i7 H# k
else clone 1 load to P_pick3
2 J% r* c9 E6 ~, \end$ o! [+ n; x0 e v% r" `
- b, P: z$ J# e lbegin P_pick1 arriving/ L8 N$ h6 x& [$ r5 m! u6 w+ d; g
set A_i to 1
8 x$ m6 u( ^* [ move into Q_induct1
- u8 o% T" s2 S- }0 M move into pickaisle.induct1
/ y0 `- p' \! P R! h) V while A_i<=30 do begin# d J W& J1 d# `+ m! I/ x" u
travel to pickaisle.con(A_i)
, h' Z7 L( Y7 J+ F9 H0 |- v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( e' ~: i! j. y" M3 G# z6 g
else wait for 10 sec5 B, K/ z4 ?0 p
if A_i=A_leave then send to die5 w- I J: L4 B# {
else inc A_i by 1
# d1 w9 W( H% {. | end
# P1 F! o; j& ^+ ~7 K+ x) Iend" K8 U J h( ~' @* ?1 p1 [' t
) }' I$ {( N; l" `0 w8 ]
begin P_pick2 arriving7 g- m9 \! ^7 @$ k9 L5 c4 T
set A_i to 117 U0 y, H# s( Z1 D, r
move into Q_induct22 ~; {# S- v/ F$ \3 U
move into pickaisle.induct2
0 k8 l+ D( O: N! Q& K while A_i<=30 do begin
1 R8 U$ ?$ b4 N travel to pickaisle.con(A_i)7 {3 y `8 B z9 v: B9 ^9 U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' @! ]0 ^. S# C% n2 E else wait for 10 sec
& r% `4 x( f Q) ~ if A_i=A_leave then send to die0 A0 H1 [- \( W$ D
else inc A_i by 14 D* A* R% R5 A6 j# d `2 I
end
& I" Y- o& @$ A) Y6 u( ^end( ^5 ]$ p) ]9 G' R; N; x+ A
# b+ o/ B9 _* x8 J4 L& [begin P_pick3 arriving5 a, ^* a( Q, U+ ]6 V) L
set A_i to 21
$ w7 S: P: c9 z3 m8 J move into Q_induct3/ }6 m; H! H( l Z9 m& g; E
move into pickaisle.induct3& o( Y! t' b' ^" l, W# q
while A_i<=30 do begin4 @# @3 @5 K3 Y% T1 Y+ y, n$ B6 T+ Q
travel to pickaisle.con(A_i)
; G, T$ D% M7 l9 m# V. Y. ]. w0 ~* T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 q! X1 o) c: O% f/ d; `$ ], Y else wait for 10 sec
k* S. M! H* `+ a if A_i=A_leave then send to die
2 }; [& s* ^% v' P6 B% C5 x/ M else inc A_i by 1
0 l- b& Y8 T( F" z4 _( _ end# Q- R9 \0 d' B
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,其它按你的 ...
|