|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 p. T- V, y. _' x
4 P' i, L, c: P# w1 ]& P我的问题是,在每个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中的数值,不知道会不会有什么不妥。! D0 P+ T) }$ S$ j9 R$ c- @& ]! @
# l; t! U- H9 _, L9 e9 u- P1 w) Cbegin P_read arriving: y" b! w4 K- V+ n( b/ `0 y6 E m
while 1=1 do begin0 ?( w! ^ C) u9 B9 T
read A_tote from "data.txt" with delimiter "\n"! q$ l" q2 ]& l
read A_time from "data.txt" with delimiter "\n"/ P: W' [$ d6 g; A8 w0 ~9 U3 T
read A_leave from "data.txt" with delimiter "\n": g, Y: P( P/ R
read A_picks from "data.txt" with delimiter "\n"# m7 ?/ O6 ~& L* L& j! C
set load type to A_tote \* W- V* U$ t7 K% S* d
if A_tote="tote 1" then set A_induct to 1
8 Y; k4 A# {- i, ? else if A_tote="tote 2" then set A_induct to 2$ [; A5 u5 ~9 X/ L: M a0 u( K. L! h
else set A_induct to 3 8 h; V* l6 h: X9 `! R/ S
set A_i to 0' ]' D3 ? I) C( x' C
clone 1 load to P_induction6 w5 J9 D8 l; P8 L
wait for A_time sec9 c I# ^& T; f+ ?
end
8 _4 A) ~7 L$ c! `: S9 |end
: o# @& H7 \5 W7 k. X7 S; }4 N- I3 [
( Y9 G2 u [3 ^( b3 [1 i) @& l, Fbegin P_induction arriving
' V# T' n8 K" H4 m, F if A_induct=1 then clone 1 load to P_pick1
. W, L. b+ f0 s5 ] else if A_induct=2 then clone 1 load to P_pick2# t$ p2 I& |" z
else clone 1 load to P_pick3. X7 x2 [. c! v
end
8 F0 D* R' ^( X6 F
/ q' e) D" U* }# n$ R: S$ N/ Nbegin P_pick1 arriving) [; H+ w6 [5 L0 ~, B* B1 I- S8 \
set A_i to 1/ h: j8 ^2 Z% a5 [: ]4 {7 R$ Q' N
move into Q_induct17 _, h8 [. `! ?4 E
move into pickaisle.induct1% Q0 {8 G% `. h. o8 x1 V0 v
while A_i<=30 do begin
8 H1 y& N7 E9 s# L+ k travel to pickaisle.con(A_i)" E" K9 V7 t3 Q2 N9 z% a! X" J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 X/ b, o# ?4 ^8 |5 V/ l7 w- N
else wait for 10 sec, y8 C/ G9 _+ P. v
if A_i=A_leave then send to die* Y6 a* G, Z% l/ i
else inc A_i by 1
; s. l* N7 ?' h. Q. k end! {6 ^- F2 w: {% x8 i I. d2 M" D
end/ D1 a1 ?4 f. W' V3 b
6 g: |! |, V; lbegin P_pick2 arriving- K4 I( T% L& F) s+ Y* k
set A_i to 114 w- G) W% D ^9 O/ _7 ], r' B! g/ Z
move into Q_induct2
6 n6 g5 H* L' o7 \& h" a& T# Z' }2 W move into pickaisle.induct20 Z! R; d+ M7 E6 h0 q# u% x
while A_i<=30 do begin' X7 e. h9 T$ I0 Q7 l
travel to pickaisle.con(A_i)
; x2 O; X0 N/ \* v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ g: \, ^: c3 Z) @8 i$ L
else wait for 10 sec0 X: Z% A$ ]2 d) D# N+ ]7 }
if A_i=A_leave then send to die: b/ N% j) h3 m+ m
else inc A_i by 14 |* ~2 {! i( T
end
- I8 B6 x! G$ j, }/ g' ~end% W0 K" ]2 j2 |8 ^* O# B2 g \
/ ~% S6 [) {1 t7 V+ Q. d
begin P_pick3 arriving o+ g/ l- ?2 E% q
set A_i to 21! F5 _/ ?4 I! P: e0 A) d
move into Q_induct3' E h# K& q8 }1 m5 L7 b
move into pickaisle.induct3
+ I1 x& U- g1 w4 e" l while A_i<=30 do begin
/ ]2 } G; M" @( j9 t, J7 J travel to pickaisle.con(A_i)) S' U+ F: H; C- A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 Y! n$ c c3 ?* g
else wait for 10 sec
: ?4 `# |$ g+ W' o4 Y5 ~1 p( ] if A_i=A_leave then send to die* ` y4 \4 w9 p( b
else inc A_i by 1
% @9 y1 e: |1 h end
( }) o) w! Y$ X, Dend |
最佳答案
查看完整内容
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,其它按你的 ...
|