|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 [; R, W& v2 G! |5 n' [; r9 S) a. p- ]8 |( B/ b G, H
我的问题是,在每个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 m+ k( ~& h& j4 e
9 ?- V# V2 v' o. \3 V; mbegin P_read arriving
) W: q& \' v8 |$ i7 @ while 1=1 do begin9 g! U* I# \$ V1 H4 ?2 t
read A_tote from "data.txt" with delimiter "\n"
, x8 V8 o/ `9 f: p0 n$ } read A_time from "data.txt" with delimiter "\n"
4 d! H/ {3 z, G% H read A_leave from "data.txt" with delimiter "\n"
; h8 s9 _% ^! i3 u read A_picks from "data.txt" with delimiter "\n"( ~- \, Y" [& n: m0 h3 V
set load type to A_tote2 p! d# D2 f# T8 C$ c2 _
if A_tote="tote 1" then set A_induct to 1: `% m2 R' k2 V. c7 d1 x/ a
else if A_tote="tote 2" then set A_induct to 27 x3 y1 s( Y% x6 e8 B: ^+ J
else set A_induct to 3
# o: c% b+ ~- b set A_i to 0
/ a6 j% U1 ~! Y8 H% D1 \+ @. {5 @ clone 1 load to P_induction
5 \3 Z% t3 v4 x wait for A_time sec* H7 r6 ]1 r* t3 N D$ j4 c9 N
end6 @+ y" k+ {% i6 x7 F8 [
end8 T- t; ?. n1 e% s. s, {% m9 H
! e* D3 u# t2 L$ [% r. }. [2 i
begin P_induction arriving
/ v( c, N0 P0 f if A_induct=1 then clone 1 load to P_pick1
. X! b& G c3 u6 N* r# A else if A_induct=2 then clone 1 load to P_pick2# I* W% b2 ^' |. M# }
else clone 1 load to P_pick37 W* |8 U& \6 |7 r
end
& R9 K6 H0 a! r! R
# J' ?2 [5 }9 T; x t2 v: s3 ?begin P_pick1 arriving
9 f+ v1 \& n5 m5 N set A_i to 1
* D& S" x b t3 r move into Q_induct1$ w+ g" h1 e+ Y3 o
move into pickaisle.induct1
/ ?, G* @/ Q* X# y while A_i<=30 do begin
: N/ ` {7 ?; H, Y2 K$ q# L travel to pickaisle.con(A_i)
8 E% {6 S }, s% d5 ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 h. N& `7 @' r8 g3 |
else wait for 10 sec
2 E; Q& _& @: J/ \ if A_i=A_leave then send to die' a0 J1 `. t7 G- e' D
else inc A_i by 12 F7 C; T1 x/ v. p
end
4 S! @7 u# _$ M$ m/ k$ J9 nend; e1 w! V, x9 L+ O& K# f# z* K
7 q+ N. t6 l/ \1 m( k! Y/ P6 ]9 O
begin P_pick2 arriving4 {+ F+ }+ ^; c. ~; G
set A_i to 11
% w3 C1 H" x6 o# h5 r5 G7 h& J- h move into Q_induct2
9 R; |; X! H% A8 W& ~$ E. Y7 h move into pickaisle.induct23 g8 j3 e& Z$ o z. T z" z, y# f5 T' u
while A_i<=30 do begin: V! @$ s8 D5 m. }' e4 r
travel to pickaisle.con(A_i). o; b8 M! d$ Y3 |1 Q* l# G, C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: d" D7 J5 r3 F+ {; \1 W0 }0 ~
else wait for 10 sec
6 D; h: _# V: o; u if A_i=A_leave then send to die' s$ E8 W+ e9 V5 y/ d, a4 b
else inc A_i by 17 h) U: `0 Z9 `8 Q4 L: N- b
end
- l# v+ g0 z4 X0 a) B: X* P8 R0 z' send
& T2 \9 ~ [1 S- d8 x- q5 u& L H- Q4 ]7 T# Y
begin P_pick3 arriving
) Y$ W( h; l- J6 B set A_i to 214 u3 R, W! Z. B4 i& u2 V/ E$ ^
move into Q_induct3
, P" v( r q, z3 c! [/ Y move into pickaisle.induct3" N3 b6 a1 E9 w6 `
while A_i<=30 do begin
( U( l% F7 @9 M travel to pickaisle.con(A_i)
5 X. }+ p) u; B! ~$ v: c& N1 C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 G/ x) h) b! s, U! u else wait for 10 sec& ?0 _; u7 V. D/ Y. d" R8 N
if A_i=A_leave then send to die5 E/ q7 y2 G( e& m& D/ d
else inc A_i by 1
4 ?5 k* c- H" {& e end
" ]# N5 Z0 t' L$ d; ?+ o, ?) Dend |
最佳答案
查看完整内容
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,其它按你的 ...
|