|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& n9 w' z. c) H: P2 T
1 I4 {2 a( U$ j! n" L我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 K1 z7 a8 S, x7 K% H2 h
3 q* r; e/ k1 }, t: b
begin P_read arriving
3 l v2 r7 s; ~" N8 n9 A while 1=1 do begin! k5 u0 m5 y: `& `1 J) s4 ^* P
read A_tote from "data.txt" with delimiter "\n"
, p4 Z7 N$ i( y1 o9 e read A_time from "data.txt" with delimiter "\n"- a1 |5 ?" f+ H% S
read A_leave from "data.txt" with delimiter "\n"' n7 l) W. |% d' t' s G9 r
read A_picks from "data.txt" with delimiter "\n"9 z/ P6 V, {! ]8 c3 `) n5 J4 K" ]
set load type to A_tote
0 R' a' m, s3 I. N0 ~1 h( A& q if A_tote="tote 1" then set A_induct to 1
7 N: a4 Q+ H9 V2 I( R0 n else if A_tote="tote 2" then set A_induct to 2
+ @+ e5 s x3 T! Q else set A_induct to 3
0 C/ ?6 Z% h7 N7 R3 e; |* \2 Z set A_i to 0
4 Q; F* j# X' V3 J0 {% M6 E$ J- o& M% g clone 1 load to P_induction2 y4 ?5 k# o' x; n7 C
wait for A_time sec
5 e( d8 f7 z, ?8 x end1 z) l" k: r+ o
end
% r* y4 v L# z& x6 P( |* E/ p# W1 f- b: n0 Y3 u" }
begin P_induction arriving: l( w4 j. Z) E0 A3 J1 b
if A_induct=1 then clone 1 load to P_pick11 T1 z" S; d5 m) P4 i
else if A_induct=2 then clone 1 load to P_pick2( z8 z1 r, B, g
else clone 1 load to P_pick3, s1 V- {* }( c2 o. }# s6 M
end
9 C( Y4 _: `( h& `
4 s0 F% X2 q. j0 O. |begin P_pick1 arriving* ?5 O8 o% L) }. @5 I z0 n
set A_i to 1
7 k4 \1 A( @1 }3 Y) P4 N$ z move into Q_induct1+ e2 z, K4 q5 j, @0 H, f% g
move into pickaisle.induct1! T& w+ V/ Q% m3 n2 l
while A_i<=30 do begin; C1 X0 J8 U& z4 B7 I g0 _( N
travel to pickaisle.con(A_i)
Z, O( i7 C# I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 F' F# ~' [7 I1 ~" t& N: c
else wait for 10 sec
' a. m- }0 d) u. p: n1 h* L if A_i=A_leave then send to die/ c- b. k) t+ q. U; X2 Y! ^
else inc A_i by 1
8 [0 }+ l3 ]+ @2 t( Z end
; \5 a, h+ T8 P1 P6 x# p' send4 k; F9 E, o8 {. s5 M9 Z5 h
+ g( z2 Z9 x9 e. w, T& ^begin P_pick2 arriving
8 H. o9 j1 a5 ^0 ~ set A_i to 11% l9 P& @1 m z; _& d
move into Q_induct23 h/ @ M8 G# b) @6 P1 f3 @ p4 {
move into pickaisle.induct2
) Z8 n B9 |8 R. |: }5 x while A_i<=30 do begin
% |! }, [! e: B1 R4 j: r+ k travel to pickaisle.con(A_i)
/ Y" S3 \' D* ~" o# @ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( k3 |/ Q+ |! [# f" ]2 q else wait for 10 sec2 o0 C4 B u6 ~9 X, @
if A_i=A_leave then send to die, b2 O6 o4 w2 k/ J8 a
else inc A_i by 1: k' S- ?1 x+ z- R- [9 ]6 L
end
' \+ Q) p0 _& ]" U% gend
. |8 Y* ?% B& C) |. I2 c
& S- K: ?% b' q' o& jbegin P_pick3 arriving
g/ c2 l% k, A set A_i to 212 `8 o4 e1 C L3 z ^% M: c8 i$ _
move into Q_induct3
4 |( O* }+ L+ U7 j$ D. Y3 a* e move into pickaisle.induct3
: Y% T6 e0 h1 a+ i. | while A_i<=30 do begin
- i. ^- t# S4 ~1 M travel to pickaisle.con(A_i)
E6 n8 e8 @( v; [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 I# b$ T( Q: d( O2 B* X
else wait for 10 sec, k4 b; n& Z( N# o% M! L0 Z' @
if A_i=A_leave then send to die+ a* @! e6 K5 D7 z0 h8 [+ u; V/ n8 l
else inc A_i by 1$ H* K/ E* |5 |
end
! n. b" ^3 B6 f5 x5 \0 _2 l4 Eend |
最佳答案
查看完整内容
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,其它按你的 ...
|