|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 j% Y/ ?, c/ V
, s: y" h- v: N% R4 n& q; S ^2 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中的数值,不知道会不会有什么不妥。, [* n& d( J% h* I( Y
7 \* n& h( \$ U: ?7 w; C/ Ibegin P_read arriving
" ~6 ]/ l; c1 ]7 V while 1=1 do begin5 E2 z( e$ L, v
read A_tote from "data.txt" with delimiter "\n"
8 |, E d5 @9 U# W$ e/ O3 Z9 d+ \ read A_time from "data.txt" with delimiter "\n"3 D( N! `) b4 h/ e' G: A. o
read A_leave from "data.txt" with delimiter "\n"1 N+ B3 [ Y3 d; v, i
read A_picks from "data.txt" with delimiter "\n"
1 ^; h& z+ G5 O" ?& u) m `6 E7 v set load type to A_tote' o' Q( x. \) l, G
if A_tote="tote 1" then set A_induct to 1" T2 J* K: s; Y w# N: N* L& B0 r
else if A_tote="tote 2" then set A_induct to 2
$ t6 ?6 q a: z$ \ else set A_induct to 3
/ _) t: [3 `7 a- ^, @' W7 P: B9 W set A_i to 0
% k6 d3 H) w4 [, t clone 1 load to P_induction* e! Z) o1 T5 M9 A
wait for A_time sec
: h6 a: ^) ?; P8 g end
8 |0 D: Y: H ^, L( Z$ I, [end* G0 ]: A3 A: `& G
- J. |2 e6 j. u6 N6 K" H& [begin P_induction arriving
- f" G9 I3 p) t, K( Q if A_induct=1 then clone 1 load to P_pick19 p2 V' K0 T- Q: u5 x' x# S9 F
else if A_induct=2 then clone 1 load to P_pick2 a3 O5 ^ E* {" l% H
else clone 1 load to P_pick3
' x9 e) P4 F3 D7 pend% T9 B k# _" P5 z' e+ e$ ?
4 @( L8 y! L+ _2 X5 i$ a! |/ G/ c- fbegin P_pick1 arriving
( p `" V+ r g' n2 P6 z; a# R ] set A_i to 1
9 a2 B1 T( d0 W0 {# {% t move into Q_induct1* K0 g/ M: C3 {
move into pickaisle.induct1
; F% F1 ?- K, ^ b; J6 c while A_i<=30 do begin- q2 Q) F9 @" G# s
travel to pickaisle.con(A_i)/ W: w) Y. e3 y+ [; T1 I2 n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 q0 U, e& T% Q1 s' J
else wait for 10 sec% ~1 N% ]! j ^. R
if A_i=A_leave then send to die
v( y# Z- p. \ else inc A_i by 1" O3 \) J) @2 `7 p7 i# l( ~
end+ u4 \$ Q4 g+ s
end
8 l# A, U9 h7 r' W& a: s5 w3 X3 c
+ J' K/ w- Q0 u5 E6 Z2 }begin P_pick2 arriving
' c. m: W) b3 o, p! L; x( m' } h set A_i to 115 L$ y% r5 i+ x3 `# G
move into Q_induct2& ~# a7 ~" P( A! C2 \
move into pickaisle.induct2
J+ z; K1 e1 @% h( x7 A while A_i<=30 do begin
% ~; _ A2 m# r5 X1 o travel to pickaisle.con(A_i)
9 f$ i# j) U* r1 Y0 F7 f! l) a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, `, k! h5 F; o6 I) s else wait for 10 sec
0 d5 V! a5 `5 f if A_i=A_leave then send to die5 O1 i9 e. r( W# U. d# L/ c
else inc A_i by 16 m. i5 T7 \1 G
end- s" M9 x7 W* D' |
end
2 }4 K) |0 G- f. e: S' [
; W* e" {4 @! u' j" ?, }begin P_pick3 arriving
[; i( \! V; C# a set A_i to 21
7 N$ u8 X( e& B3 d move into Q_induct3
, \) u& [0 ]& l! T3 M# M move into pickaisle.induct3
5 K0 ]7 s n8 m( l6 H8 x! H while A_i<=30 do begin
) I _/ T V: q, i) ^ travel to pickaisle.con(A_i)' c: g- Z( f, h; y- J1 g) \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 k# ^- N' M1 ]$ [; [ else wait for 10 sec. q1 q& l2 \0 o+ y' f
if A_i=A_leave then send to die
5 C$ A7 X5 L: k0 {" b' E9 h* L$ X else inc A_i by 1
* p1 M+ l- {( y; ` end* y$ B" [+ s7 R9 S9 K
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,其它按你的 ...
|