|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. m) X C, ~7 Q) `0 v1 ]+ e7 V+ j
2 @& e& ? l" q7 O- I" Z2 X) \我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ q6 s" B, Y5 E, S0 ]. L# k) P6 R9 E' \4 G+ l
begin P_read arriving" V) J8 R! t6 b4 w; W; J
while 1=1 do begin# s5 ]1 C0 Q# S- s& R# R H
read A_tote from "data.txt" with delimiter "\n"
, S2 Q6 b u1 y4 h read A_time from "data.txt" with delimiter "\n"
! m* o3 V) Q' t0 _. }; ?9 g4 @ read A_leave from "data.txt" with delimiter "\n"
, A( c0 H: P& e$ e read A_picks from "data.txt" with delimiter "\n"/ v3 x( x) E- h
set load type to A_tote4 o5 l! X) I8 Y" O
if A_tote="tote 1" then set A_induct to 1
; W/ B; j& o5 D# @6 u1 T5 u2 ] else if A_tote="tote 2" then set A_induct to 24 \0 ?9 Z! ~1 I' ^
else set A_induct to 3 + E3 R6 i. p9 M( @8 I& |
set A_i to 0
# p k) f3 a4 ^4 D$ D clone 1 load to P_induction
1 _1 N9 r6 Q: F. I9 _ wait for A_time sec
! R9 U( f/ o. u8 y* Y end
9 y, D" b& A5 y$ c1 |: n- Kend6 G. g z2 [0 _" n+ w; }+ C
; b1 ~' e' Z4 @0 l, r6 ybegin P_induction arriving
) z' s* H o! W6 b3 Q4 q5 z if A_induct=1 then clone 1 load to P_pick1+ F. g5 Y" }% |! G6 t2 s& m& I# C0 N0 N
else if A_induct=2 then clone 1 load to P_pick2
0 q. o8 q; j1 }4 g* r7 t else clone 1 load to P_pick3 o0 S# K/ _# {) l6 l
end8 Z) Z D1 D- l0 A
3 x( U: @6 L* w" a4 Q& W1 }begin P_pick1 arriving
* x( t+ }" z- P4 { set A_i to 1. u2 o" J! Z: j0 @0 O/ K3 {
move into Q_induct1
3 y- R0 l. |' \$ G3 E% c move into pickaisle.induct16 l8 Z. |( m1 X$ h! X, ^
while A_i<=30 do begin
. P9 v3 ^4 b+ Y7 J, K travel to pickaisle.con(A_i)
9 S: s+ a& s9 s7 }; O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( m5 N6 V& M6 \% l/ _ else wait for 10 sec+ q# M5 M$ T9 }0 R7 H- t
if A_i=A_leave then send to die6 {: h5 b1 m; T! P- y
else inc A_i by 1
2 V$ n2 [3 p8 ~: F8 } end
7 K4 ~+ ?; @' }$ Mend! V% V: P3 N3 {1 @! {3 V% F
; A; O) |$ y+ Wbegin P_pick2 arriving) x; l! `' H/ ?
set A_i to 11' ^; ~* }# @8 x# X& U1 a1 n
move into Q_induct24 N5 Z+ P7 b" u/ I, ^8 g$ s
move into pickaisle.induct2. q+ \4 ~% `$ W$ o3 ]( D
while A_i<=30 do begin
4 t8 o/ R! B3 b/ i! r2 u$ \0 X travel to pickaisle.con(A_i)5 c$ M. S$ h5 S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 _; i7 M: |- q/ t, @$ u4 X' a
else wait for 10 sec
' u3 B& r: |' P if A_i=A_leave then send to die0 V0 v* ]9 Z4 V" w# Q) g4 [7 t
else inc A_i by 1" ~9 i) }: U" V
end
j/ _2 d# R3 Z6 G- Gend
t6 |* E9 r) C( }! O( O' \2 g7 z) h6 J' X$ A+ h# F' s3 e
begin P_pick3 arriving9 Q+ o# z( U; n- [3 g0 g& C
set A_i to 21+ W6 F* ?6 A8 Z4 F; F8 T
move into Q_induct35 X$ p& L& j, b! `9 u
move into pickaisle.induct3
4 z* C. r$ ]! b' [1 J8 w' o' r: [, ? while A_i<=30 do begin
+ c6 ]% V: e; a! q. ~ travel to pickaisle.con(A_i)/ {. o% {% l" t: j: \7 d% l0 v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; H; }+ H7 _* o
else wait for 10 sec2 a! z. @+ ?8 F' ?; C& s
if A_i=A_leave then send to die
( @8 A5 |, u/ q0 L4 B& l# C% O' r else inc A_i by 1: R- w+ P3 z8 w2 J# M2 c
end. }( l' @( a, v. q( z
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,其它按你的 ...
|