|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* c3 l1 e$ C) D4 P( F# `& T( G9 H u8 t A3 i5 z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。 i/ v) O' c1 R+ o
, H y7 R8 ^* f3 g. z& O8 ~
begin P_read arriving
& i9 n6 X( o, u1 Y5 G# C5 A while 1=1 do begin- ?- Z& K9 ~5 y' P# s
read A_tote from "data.txt" with delimiter "\n"
+ `& Y& z/ Q) [8 A2 v3 Q7 f' j read A_time from "data.txt" with delimiter "\n"
' I# p1 t! p% c$ c% N4 ^( G6 A4 D( z read A_leave from "data.txt" with delimiter "\n"
+ a8 w3 l& Q/ R4 z4 [3 T read A_picks from "data.txt" with delimiter "\n"
# J; E; L. x! g$ d$ U set load type to A_tote6 S/ T# n7 x* ?7 |' n& K
if A_tote="tote 1" then set A_induct to 1
4 N" u: J' x2 c( V1 y/ `+ K2 m else if A_tote="tote 2" then set A_induct to 21 K+ K5 F6 Q" h% D1 a V; }( Q
else set A_induct to 3 ( P! h- K h2 w" l
set A_i to 0, [$ f) \, L8 h- s3 B$ r
clone 1 load to P_induction
% V( d% Z. E* M! T7 p* t wait for A_time sec
2 u/ `: _# Y9 J1 o; U5 u; E3 | end; }8 h- ~; [. j# F
end* h S4 m- z. g9 V
$ y/ M$ d0 W9 Q) G# Hbegin P_induction arriving
F1 C4 K" F! ?$ }; g4 t! } if A_induct=1 then clone 1 load to P_pick1( i& S* N8 G( u2 A" E
else if A_induct=2 then clone 1 load to P_pick27 w K A& W5 c: a
else clone 1 load to P_pick3
3 P' `8 `6 {! N5 H; G) Rend3 ^0 R$ L3 i) D7 Y+ u3 Y _
% a( K( [" g# D* F5 P
begin P_pick1 arriving
. [* f: I* w$ a5 [ set A_i to 1( s& a" X8 h2 G# g3 K+ L- C
move into Q_induct1
( f" ^( C1 z% I. M5 @ move into pickaisle.induct1: O. n% K( W3 N5 N/ Y0 n- o) |
while A_i<=30 do begin
5 h1 P% I9 y! p! p travel to pickaisle.con(A_i)9 q' O, O6 h9 Q: E% i& D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( h$ H5 E5 ]5 }% f. _
else wait for 10 sec
# |' \9 w/ Q) t7 C* ` if A_i=A_leave then send to die1 p {. E$ E, I8 q7 t
else inc A_i by 1
- S1 R& O; D4 e7 x. M- C end8 |; F& u3 T% e* F
end( u5 J4 Z$ K1 j1 n
4 B R; c. C3 k9 j
begin P_pick2 arriving& F/ F: P; N$ N( v$ k
set A_i to 11
3 z; f+ n( u" }- y3 f& X/ L' Q7 Z move into Q_induct2
4 W; y6 i! l Z {, L" r2 { g move into pickaisle.induct2: Z" E, q$ T3 f* o0 O6 j7 x
while A_i<=30 do begin4 U& J3 s2 v" o5 A( c- k( @
travel to pickaisle.con(A_i)
4 v. L0 w- c6 m6 h) b% f* }1 l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ]6 b, D1 s% [9 f else wait for 10 sec f0 j9 L& N+ r4 S" Z& a c/ {
if A_i=A_leave then send to die9 R8 b, j0 s @% S9 f6 H$ e9 k
else inc A_i by 11 W# c& H# u0 E3 Z. y7 y
end: K: |, O" m- w& ]) `' i8 L
end
: B* \" z8 |/ S/ ~3 E
# Y6 C, o8 s) Kbegin P_pick3 arriving
. M' R' _. u" _ t set A_i to 21/ V1 l4 Q9 |6 T- ~$ s
move into Q_induct3
- T4 ^2 K) K! D move into pickaisle.induct3* G& j. ^ c) k& @: a! O1 p/ a* G
while A_i<=30 do begin
. |/ e" F+ P2 k2 U travel to pickaisle.con(A_i)0 g/ o2 V2 t( [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ ^1 F$ {; d. s, c5 K3 v5 }1 J else wait for 10 sec
& y- f& [! F! w+ a! ~ if A_i=A_leave then send to die7 h% I$ y" R! c" g1 A: e# X5 ?
else inc A_i by 1/ f4 @! }$ Y8 [3 S8 [
end1 j+ n) c( Q- A
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,其它按你的 ...
|