|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 R$ ?+ P* ~' a: f5 s! F% ?$ j& |9 X8 [; b2 B m
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ j1 Q( O# M7 A) f6 @
5 [* a9 C* O' z: M: H! Nbegin P_read arriving
; q) u* w6 Q9 k. v1 I o' B0 c while 1=1 do begin. f% Y5 _$ T, ?
read A_tote from "data.txt" with delimiter "\n"
4 t. Z/ |0 `2 F: z' Y2 r3 g; g read A_time from "data.txt" with delimiter "\n"
/ [, E! ~$ O5 \ ] read A_leave from "data.txt" with delimiter "\n"
2 t8 P$ ?, l% t V. ]5 E read A_picks from "data.txt" with delimiter "\n"
6 P- U2 C% h1 x4 \- a set load type to A_tote
( h- N' r z& K3 H5 t1 ?1 R if A_tote="tote 1" then set A_induct to 1
k; ^( c! l6 t5 N else if A_tote="tote 2" then set A_induct to 2
1 P, m/ S# d7 U$ c else set A_induct to 3
8 N- B2 F: W, _1 H8 G set A_i to 0( R5 R6 D; m, u9 t5 z
clone 1 load to P_induction) L7 I5 |( p4 h0 R
wait for A_time sec& w/ h7 S5 v" i1 q7 I
end
$ t, W+ b% F A4 T( ]! Q$ A% ~end+ h. J: l+ X2 \ R# O( V/ w
j7 K. ] ~- f2 a: l/ kbegin P_induction arriving
. [" l% w: f& C5 s+ o if A_induct=1 then clone 1 load to P_pick16 x/ v( c9 t0 _/ n6 Q# C. f
else if A_induct=2 then clone 1 load to P_pick2& D# h# a: n6 D
else clone 1 load to P_pick3
9 g, q5 Y. A" M2 O, pend
0 O \+ u5 @ f. J
3 w3 G# n4 [( {9 D8 W+ ?begin P_pick1 arriving
- L* j% o& a2 k4 C set A_i to 1" `, J& `' K: ?/ K6 c
move into Q_induct1
+ t4 U, b' W) V( M' ^ move into pickaisle.induct18 @/ Y9 {" u6 g; a1 ^* z. O
while A_i<=30 do begin
. r! v W9 T, I travel to pickaisle.con(A_i)
8 O( e! R! U9 G [8 y1 X5 k6 F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 _+ j6 {5 n/ O; ~* P2 n, u ^ else wait for 10 sec
: L, _. ?0 s* m g7 k if A_i=A_leave then send to die
0 n0 S* X, q" V" T* t0 D else inc A_i by 1
) t1 i9 R* B2 n5 H end
2 X% O- [. p; \: e' d+ Qend `1 i: o7 v0 Y# w7 ~7 j# J
, `/ d2 _0 O8 X7 N3 L, F9 tbegin P_pick2 arriving1 B1 I/ p* P( r7 ^ A5 Y
set A_i to 11
A+ P) x, o( y( J1 U. ^& C; U move into Q_induct2' h$ z3 y5 M8 o m3 T# k
move into pickaisle.induct2
8 m( {2 x8 \/ ~2 n* K9 I: ], C2 ] while A_i<=30 do begin$ C( r( K b% {6 }1 M& u
travel to pickaisle.con(A_i)
$ u. Y8 i/ o' y# T3 L% m1 g# ~8 r: {( Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ V% q6 I- [' b# [0 O; @. \) K
else wait for 10 sec
2 X% |' }! l- J. U" E& W if A_i=A_leave then send to die: r4 }7 t) T4 ]5 C" u6 J6 Z
else inc A_i by 1" p/ x2 n+ s' T$ O; X0 _ ~
end
; i: `8 X$ U- ~6 U* |" m. Send
3 c" f7 S' I ^: {, j* `1 X) l- T2 {. i7 k/ z3 U, x$ ]3 y
begin P_pick3 arriving
4 w4 \: T3 i. D7 v4 R* L6 y1 e set A_i to 21
t; x. w7 n1 u6 Q move into Q_induct3
# F0 l: Y: s% I move into pickaisle.induct3# W. Y! |: \; b, O
while A_i<=30 do begin
% q$ k: G: [) g4 o0 ^ travel to pickaisle.con(A_i)
$ e: ~+ x% H% g0 q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& x0 b7 e& b& p. ^5 ]+ G& n
else wait for 10 sec
5 _ e/ ~; ]7 \4 D if A_i=A_leave then send to die
6 I; x' |6 z \6 O. P/ _# B# O else inc A_i by 1
0 y' d! g# i) J0 ^8 C end
- _" O2 n; U. U6 r. n) r& \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,其它按你的 ...
|