|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& U# F L' u6 ~3 X( l; z+ G
! Q+ d- r+ W/ E我的问题是,在每个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中的数值,不知道会不会有什么不妥。% D; A: n+ [" Z; A- y0 N1 T
; ]4 B+ d% e U/ C, `# C
begin P_read arriving( \- c) f3 R7 B" v% h. D
while 1=1 do begin
# V+ r& U; Y0 J( }3 ~: J; R" s read A_tote from "data.txt" with delimiter "\n"$ X$ C0 w* N/ ~0 K3 J, y @
read A_time from "data.txt" with delimiter "\n"
p3 @ C8 }9 C Q P read A_leave from "data.txt" with delimiter "\n"
2 H3 M' z$ _& W; t, b3 k read A_picks from "data.txt" with delimiter "\n"
7 I, _/ a( E7 L+ K set load type to A_tote
9 o n( ?; X! O9 E if A_tote="tote 1" then set A_induct to 1% _& y* ]5 |0 K& d
else if A_tote="tote 2" then set A_induct to 2
! E& ^2 C- X# L: _9 e: E! r else set A_induct to 3 % y4 U: U R R) s
set A_i to 0
& K/ X/ x: `: @5 W D clone 1 load to P_induction; g k, H" U, ]8 C/ C% a; a
wait for A_time sec6 I, q) `* i4 E; ?' }1 E' W
end
& v2 G9 E! Y* G. j/ Bend: [1 F2 ^9 t1 {' P& r4 F1 [
+ n o" y( O# P, H. \! G7 O
begin P_induction arriving
: ^: x9 K9 @2 X& H if A_induct=1 then clone 1 load to P_pick1
/ } j8 j- w: x6 ^8 t! z else if A_induct=2 then clone 1 load to P_pick2
- U6 T3 \6 `3 n+ K8 {/ C4 m else clone 1 load to P_pick3
. L7 |. }! ]6 d1 p4 Cend
8 E1 I; |( M& z$ Q- W7 Q) s" ^, p: ]2 V$ U3 S
begin P_pick1 arriving
9 I e0 g, V+ U set A_i to 1
: b( X( S$ L3 C2 E$ G& s5 L+ k move into Q_induct1
# U& j/ } p9 f }* K9 q move into pickaisle.induct1
I' J* |; U5 V while A_i<=30 do begin
! n- \' f/ ^) u. J- k" u travel to pickaisle.con(A_i)/ [* F, g6 E- E( C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" ?$ X6 s/ z! ?( A8 z
else wait for 10 sec5 `9 o- V3 t6 f5 @4 Y
if A_i=A_leave then send to die
n, u3 q x* b' z/ l8 J else inc A_i by 1
0 t# M9 q2 |0 Z0 a end5 ^) Z- M( f% x0 `# Z
end5 d' L3 U4 n8 W3 R& ]
k" [2 b$ `; ~begin P_pick2 arriving
2 x5 R. F3 |- b/ p set A_i to 11
1 ]8 _3 U3 Y! |8 X& Y" c8 ]& A move into Q_induct2/ w% n/ m4 }( A& D2 E6 t# c2 j0 Z |
move into pickaisle.induct2
3 f% L# \" @ G9 u8 l/ u- u7 } while A_i<=30 do begin( j i5 W8 ^( e8 S
travel to pickaisle.con(A_i)
6 o. Z4 |$ x' j# Z9 ^6 Y4 K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ c; v( S5 B4 d; V) U else wait for 10 sec
: O' L- E l$ s% E8 Y if A_i=A_leave then send to die! |# \- D# y* ~" I5 I" @
else inc A_i by 1
2 d2 L* N ~1 \8 [ end
, C- L. [5 b4 gend0 K/ `+ C: }5 X2 x3 Y: B& D6 m
9 n) {4 Q% {0 Y" `9 i) [4 B+ Sbegin P_pick3 arriving2 p7 L& h! V7 \( F" d
set A_i to 210 t( T1 |! H8 |0 @
move into Q_induct3: K8 S( }& h: N( z
move into pickaisle.induct3
5 A$ A! p9 j0 w! q: i2 T* @" S2 c while A_i<=30 do begin% D, W. F H- z
travel to pickaisle.con(A_i)& B' J6 F& ^5 y1 u. Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 l' t: d. ?6 s" o6 l! C! z else wait for 10 sec/ e: p7 r. e8 a" `" ]
if A_i=A_leave then send to die
4 g, ?- w- }/ i$ Q, B% k! [ else inc A_i by 1# G- Q7 u( w, U
end
( g! `9 i+ Q. \) M0 Q$ A' Kend |
最佳答案
查看完整内容
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,其它按你的 ...
|