|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- W) T% p3 v+ f1 C3 @* G5 Y
9 D( N' D4 ~+ ?6 f y2 a& k/ C我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ w# T8 {' U8 \3 v7 Q4 G; v+ j4 U& R9 w# z
begin P_read arriving
9 c+ Z7 w: A7 B( A while 1=1 do begin, d3 J8 C% i" c. F9 W H& n
read A_tote from "data.txt" with delimiter "\n"
% c2 Q% j B( t5 |: p4 ^9 ^& U read A_time from "data.txt" with delimiter "\n"3 H) ?0 r W. B" e3 j
read A_leave from "data.txt" with delimiter "\n"! p0 N7 o" U) Q0 g3 _* {
read A_picks from "data.txt" with delimiter "\n"( P, A' m, a- q* I! c
set load type to A_tote1 M$ y/ b1 E- S4 A, z
if A_tote="tote 1" then set A_induct to 1
7 h1 ~! x$ i+ U! ^+ |4 D- b else if A_tote="tote 2" then set A_induct to 2& T; a' T/ W; y
else set A_induct to 3 - A* u' _; X4 e7 u( U, s" v% T. W
set A_i to 0* d0 t6 @) a" E9 y2 l2 q% }0 d
clone 1 load to P_induction: v" X; I2 `- J# S7 u4 p/ P! P
wait for A_time sec1 ]: P7 a( R$ U7 r8 d0 u! m: G
end# D" v# C6 |2 q6 D
end
1 v/ w$ i- t/ d
% s* e! D* B# `! F5 ^& [begin P_induction arriving
+ ^ W3 o( |5 |, r* x if A_induct=1 then clone 1 load to P_pick14 F* Y9 A- C9 f: p/ |
else if A_induct=2 then clone 1 load to P_pick2, [) J" B- G0 H3 }6 `- H
else clone 1 load to P_pick3& O6 e1 a# F1 Y
end
0 I( n, u, \2 M$ Z- Q. R6 A
/ n0 g+ l2 d- n3 v; `) T, d' ]8 gbegin P_pick1 arriving! k3 M3 j) I7 n' ^% R9 K
set A_i to 1
3 g. U* N3 s5 Q9 L0 b/ ? move into Q_induct1
' G, H) R' ~* V7 C* |" A move into pickaisle.induct1
4 d8 F* f' y" [1 P3 C. l+ Z+ E while A_i<=30 do begin+ W1 O4 ]$ {* l" W* |0 c$ u" z1 V
travel to pickaisle.con(A_i). E2 \* W! n/ @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 _" }9 X% E/ p, Q$ J0 ~, i) z else wait for 10 sec
/ [- x5 s1 V u/ V$ T$ i; @ V; S if A_i=A_leave then send to die/ |7 O2 Z5 V$ V! y4 s
else inc A_i by 1
. c" G& L9 I& x2 F$ A end
/ y+ X. p: R2 w, Lend( t! w6 x5 G" d
; ]& d* G2 L2 F: Q1 }; g
begin P_pick2 arriving4 K+ K% C4 u# n# T7 W! G& {6 s
set A_i to 11( ? u }; e$ V6 A/ a
move into Q_induct2* ]) S E0 Y0 a& S7 v S* M
move into pickaisle.induct2
1 P% U2 ~4 p# _& \7 ^ while A_i<=30 do begin, k. u" T0 H- T, L$ {+ w: M. L
travel to pickaisle.con(A_i)5 I& F n' w* r7 b% k6 ^4 J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: h( `' s1 E9 Y# T4 D' m- \! @) f) \) ]
else wait for 10 sec+ C3 Q' b4 j' G
if A_i=A_leave then send to die" i2 L! U/ ?* H5 E* Y; \* Z, O
else inc A_i by 1% f! ]5 ?; c& U5 W( f; }
end) O, y5 ]- C( t6 R4 y' {
end4 V( c9 ]: I8 P! m6 n1 q
+ W8 Z. v6 X/ F Ibegin P_pick3 arriving
: @1 y9 e% i; |, \ [6 h& Z/ n$ Z set A_i to 21
( R7 |% T* Y$ O6 P8 I7 s5 N( h3 W move into Q_induct3" r- l- d$ ?0 _& L9 ?
move into pickaisle.induct3# s9 d/ }7 W4 M1 I" q
while A_i<=30 do begin; Q2 r) N9 t% v! K
travel to pickaisle.con(A_i)
* s; I. u3 V; O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 S" x. A- ^' \' O" A% {, U- M else wait for 10 sec
4 S1 V2 v$ \ h. @1 @ if A_i=A_leave then send to die
9 s h/ K# e8 R& L3 u2 K else inc A_i by 1
& y4 L5 Q4 t; L7 z+ ?8 S) N, r+ ? end: M1 W4 P4 Q6 w9 d
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,其它按你的 ...
|