|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 ]& h1 Q) w6 p3 U" Y4 X7 ^
) m2 n6 ]& i4 s/ I0 [& T我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 t8 a4 ]& G5 d; V: {( o N( b3 Y* c) O6 A# L
begin P_read arriving) E0 O Y5 l1 k) O
while 1=1 do begin2 k+ A: S- z* i3 T0 M1 l3 F4 L
read A_tote from "data.txt" with delimiter "\n"
7 Y* }, v) A& L8 A' g# w read A_time from "data.txt" with delimiter "\n"
) m5 U3 l' ^: i) r& K& \6 E2 r$ K read A_leave from "data.txt" with delimiter "\n"
- ]5 E: a2 u" V. ^* Z' D read A_picks from "data.txt" with delimiter "\n"
6 N9 s; _) G+ m( @" S7 | set load type to A_tote: |" Z% B) ^ C! ?1 K8 q" Q6 t
if A_tote="tote 1" then set A_induct to 1) A& D- l( W* ~* h6 w* X
else if A_tote="tote 2" then set A_induct to 2
C/ d" {$ g# m l% f else set A_induct to 3
9 t2 n$ I0 n& s set A_i to 0" v5 G* {, I" ]# k% c Z" K
clone 1 load to P_induction
6 e' V' M+ ?( {4 L- s2 X) U6 {3 } wait for A_time sec4 d& z; W% N! n; w8 e) D; {
end
; b/ O8 L& [+ d$ p8 G' v# V1 S2 Fend3 G( q, G+ S. s8 f
* X! x. n+ X" u$ |0 rbegin P_induction arriving
" X3 u: \ J" p( m if A_induct=1 then clone 1 load to P_pick1
) @0 E, n3 F' d. H; j2 s else if A_induct=2 then clone 1 load to P_pick28 r6 B( O/ s- p0 h
else clone 1 load to P_pick3
g" W" L) }9 wend2 y+ G K. q m! e0 U; e
( {6 ~3 T3 \, L' z2 y
begin P_pick1 arriving
/ R/ \/ K3 @( v7 P* n7 f set A_i to 1
" u2 F$ `. d: K move into Q_induct1
5 w8 S0 H6 h$ q, q move into pickaisle.induct1
7 [1 I" `& k7 j2 i" }7 M while A_i<=30 do begin
! g& L8 D. Y( I) s travel to pickaisle.con(A_i) V. K8 x0 G! H0 M' c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. e% h- T; g$ y3 x5 ?/ a! W0 n% L
else wait for 10 sec" s- R' y* S; w% i& P
if A_i=A_leave then send to die2 o* I- X! c0 Z p, t# a9 v# @% t
else inc A_i by 1 y ^) N& g( q) w5 X3 ~. Y
end8 N5 \2 `5 Q. H5 ?% P
end
9 r6 K2 m6 ]( y1 W4 V {) k2 u% |" {0 _7 e o$ A g
begin P_pick2 arriving3 n, V+ X) Q+ p) @0 r1 A
set A_i to 11
5 i# O3 v# {6 e move into Q_induct2+ y9 H4 m2 [7 @
move into pickaisle.induct2/ g1 A: \9 M& F8 ~" ~% I/ X) M
while A_i<=30 do begin
. j& L. E% y; r travel to pickaisle.con(A_i)% }' N! Z8 h. R$ I/ X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 k2 f4 [1 h3 @5 M, V7 B0 [/ `# ` else wait for 10 sec
4 Q. d9 S9 s, ]3 ]$ \6 [ if A_i=A_leave then send to die( I% a- y l+ D: x
else inc A_i by 1
7 \1 t! m0 D1 D; u/ p end
, ?! n" W4 N C# F- Zend6 v f$ u6 Y6 n1 y& Y/ ?
1 S# o6 u) z& O) s" R# Nbegin P_pick3 arriving9 t& s" ^5 L! s
set A_i to 21
# s8 y) C$ g, y5 { move into Q_induct3: ?) n- y3 [1 }- c
move into pickaisle.induct3
6 t7 T6 @* w7 u! Z" e while A_i<=30 do begin% T& m. k+ p/ w! a) `0 ?2 a
travel to pickaisle.con(A_i)* f; K0 j; c* l, K3 ?6 v' S1 k4 E+ K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# i$ |* G3 k1 T& y
else wait for 10 sec9 Y6 T- l& c" M( M f( U+ B) Z& k( K
if A_i=A_leave then send to die
$ Z1 V: |6 V% Y2 O3 n0 P else inc A_i by 1# _8 r) A$ [0 ~$ h& P6 v/ ?" V# j
end, ^, p5 Y0 Q5 y# o
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,其它按你的 ...
|