|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ j% ^; W* k8 g$ L) b$ X
+ u: t" `' ^9 U; g我的问题是,在每个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中的数值,不知道会不会有什么不妥。, q0 [7 C6 p. T, G, B1 c, `
# X) r" z, v; n2 f* Hbegin P_read arriving
- F8 M% t) _9 S' C$ C) P1 g while 1=1 do begin
; G3 y* |3 ~8 m0 m+ v _% B read A_tote from "data.txt" with delimiter "\n"! ~. n' x% I9 v7 E- u+ r
read A_time from "data.txt" with delimiter "\n"
* e9 s4 w' n+ E8 l) y read A_leave from "data.txt" with delimiter "\n"
: u/ m: a" M( p% N# b read A_picks from "data.txt" with delimiter "\n"- I* f3 l5 }& S4 ]; p
set load type to A_tote" o6 \& Y. |4 e( F3 [
if A_tote="tote 1" then set A_induct to 1
0 ]2 V6 ~6 n o else if A_tote="tote 2" then set A_induct to 24 n" V8 T. i; ?5 A. R
else set A_induct to 3 ! ?$ a9 z ~* H) s
set A_i to 09 j' [) ]$ g4 D. p ~) A
clone 1 load to P_induction
' U' \; l3 g: o6 m/ w" Y wait for A_time sec
: \' @3 G3 @7 K6 J s end8 {/ |1 V$ C s, s: a9 G2 M5 T
end
* k! z7 ^$ e5 ]! P' r
- s; _0 U9 p6 L3 qbegin P_induction arriving
2 r7 Y" H& K8 y5 \; R if A_induct=1 then clone 1 load to P_pick1
' K m$ I7 ]0 }' L# L0 t& n else if A_induct=2 then clone 1 load to P_pick2$ U: O; P7 Z+ ~/ E5 y* Z3 e
else clone 1 load to P_pick3
# [; r: s' p9 P" j0 i" a7 M* Wend
( N( J" S, ^0 t9 M/ }& t6 s8 P @* A( K; ~8 P6 t
begin P_pick1 arriving$ n- h: \" F3 G: |) k: B; U
set A_i to 1
# w+ w9 f, D( Q6 ^ move into Q_induct1
6 J+ L4 D* D6 j" y. ~4 U move into pickaisle.induct1: Y z ^3 H! T: Y$ C t1 Z6 k
while A_i<=30 do begin& j1 z3 R5 Q- c$ u" b. G, U
travel to pickaisle.con(A_i)
7 T' v4 h! n5 a" ~7 i: G/ U' k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 P1 M3 @; }. ~+ w else wait for 10 sec; P$ m' l1 K# i3 r( h$ U
if A_i=A_leave then send to die% X2 K9 {5 T1 V; Y% s2 ?, O
else inc A_i by 1
/ {- q4 t) j3 y; _9 X; d! H8 A end! r5 Y1 M: T$ i7 U$ o, P4 I! T
end
. ~1 i+ B2 O- o) r* R
# \" _* n3 a& d. Y- v/ d( [9 wbegin P_pick2 arriving
4 o! f# W \! X3 D8 N, X set A_i to 11
& v3 H' @7 T! E$ g! q6 @# Z move into Q_induct2, c4 g( n- v1 V# q
move into pickaisle.induct2
9 H. s$ p' `* I, H M while A_i<=30 do begin
) d0 W3 R: m% ` travel to pickaisle.con(A_i)
& X, n- ~6 L2 a) b/ I7 S) X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 M# _7 {4 l: f- t else wait for 10 sec1 Q3 t7 B7 p; o. h5 \
if A_i=A_leave then send to die
- ]' G& z+ u; O3 o/ M! o else inc A_i by 1# i! ?" F& u1 C8 @6 ?9 E3 x9 T
end% J* T3 ^6 V+ ?5 H, C$ b
end
( i# m' z( C% E! [( M0 Y! n% G Y0 n
j4 q1 X( ?, F; J3 abegin P_pick3 arriving# C+ p4 x* H6 M8 p' \
set A_i to 21
$ o3 g' G! L$ a move into Q_induct3# A+ q5 I7 s `5 o
move into pickaisle.induct3# M0 o/ ?1 W; L0 m: N6 Z, s9 S
while A_i<=30 do begin! c# H2 K# g/ S9 u# l7 J
travel to pickaisle.con(A_i)
- ]% d+ \$ O1 I0 ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ V& V9 z& U) D8 T
else wait for 10 sec- j* @: h+ G% y2 S. I/ J4 A
if A_i=A_leave then send to die7 d: U% Z" m, D. `, P
else inc A_i by 1; u7 b, p# z b# z& v
end4 b$ a2 y; v0 f6 T
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,其它按你的 ...
|