|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 [2 Y! Y* y* `. t; w! q4 t& ]5 x
2 y. Z1 x J! c, 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中的数值,不知道会不会有什么不妥。
+ U' H8 H) }8 {% B0 y& X' z6 t2 J3 }2 i6 K* h E3 Y
begin P_read arriving7 t0 u1 T" Y+ u0 ~* ^6 y- P% G
while 1=1 do begin
8 C/ R& G! }8 s5 I6 g read A_tote from "data.txt" with delimiter "\n"
7 }% b/ N" @, W; k read A_time from "data.txt" with delimiter "\n"
2 U0 z& _9 ]8 v2 F+ N' I read A_leave from "data.txt" with delimiter "\n"6 d& \* e$ @- @* V
read A_picks from "data.txt" with delimiter "\n"
3 D4 u! I2 O# t9 q/ D3 f3 i+ Q- s set load type to A_tote
, s5 z" u9 E. Y P% f if A_tote="tote 1" then set A_induct to 1
" L' d# |- c% `4 Q else if A_tote="tote 2" then set A_induct to 2
4 b6 o! Q2 V" A4 d6 `) [ else set A_induct to 3 ( V2 s" ~* F0 y p e h
set A_i to 0& |- s0 C+ f7 `' d- [: n9 z- {
clone 1 load to P_induction
) w# d! {# L" I2 T. F; u/ M0 w1 |2 W+ K wait for A_time sec- a2 v, R' J( ]$ q
end
& c( b h ]$ c, k) R* _end8 ~, A4 s9 m; J) K/ ^6 t
2 h/ M- h+ }. b/ j8 Lbegin P_induction arriving! @# J6 _0 v" U% y. Y% \" _
if A_induct=1 then clone 1 load to P_pick1
4 `) N7 `7 X A1 [& D! | else if A_induct=2 then clone 1 load to P_pick2
. }: y7 A) p/ W& T else clone 1 load to P_pick3
! Q- x" Z7 b' V" L; M2 m# Send
& k+ v5 @' u: O1 L! h* {( G- p
( o( Q$ k4 f* Cbegin P_pick1 arriving
$ @8 j4 o* \" I8 X. {% i set A_i to 1
: X8 w s$ y, V1 I' Y; Y9 f move into Q_induct1 @2 U$ t# L. h# ]
move into pickaisle.induct1
0 k- V* ]" m1 d, r) N# B$ z8 b! e# \ while A_i<=30 do begin; G; B8 l* }2 |2 K4 b9 ?
travel to pickaisle.con(A_i)
& h" L s# P0 } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 s- B) f5 e% x- n1 Z/ X4 F
else wait for 10 sec; t, L4 I2 Z5 a6 q% a
if A_i=A_leave then send to die
$ O* _) V- G! y- W' t else inc A_i by 1- ?# [9 {5 C5 k! U
end, T a5 k9 i# @, M+ |; v7 `! _& O# b
end4 H9 \8 e7 f" L1 X
; u ] S! a! w/ Gbegin P_pick2 arriving
! s0 w! O$ m4 W) e& d+ K9 F% O set A_i to 11
1 [% o7 V( L; i# f N move into Q_induct2
% R0 V7 x1 E) v- U [3 v move into pickaisle.induct2
7 H$ u, @+ M+ K while A_i<=30 do begin
! D( i) N \, G4 k travel to pickaisle.con(A_i)
% E; d* c/ ~2 ^/ y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. j0 X: X6 Q$ C# _6 ~0 B else wait for 10 sec5 P- t" V+ C1 d3 Z1 \) w9 L1 V
if A_i=A_leave then send to die; o1 U: r b! p8 v
else inc A_i by 1
' H) g j, k- l: E8 V. Q5 `4 P end- d% H: L- ]4 J/ u9 `
end4 p9 W# M- E2 o1 n/ r
8 \- }4 R3 L, p. p% G1 `begin P_pick3 arriving/ b; A& G# V% A0 E9 R. l, G
set A_i to 21
9 r& b6 n1 S. W5 }/ Z* n4 ` move into Q_induct3
- u$ P% i; o b; P8 O move into pickaisle.induct3 w8 h+ v/ O0 K3 a) M; p5 ^
while A_i<=30 do begin3 n6 c% [. b" b3 ?0 A F8 h
travel to pickaisle.con(A_i)
& m- }5 S3 j# @$ ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec ~. D" x* p+ a2 _9 c! Y* y
else wait for 10 sec
/ j! a! o) G! r' L! v3 w, E w if A_i=A_leave then send to die1 D6 g8 w0 y: Z- x u# e
else inc A_i by 16 c% X3 R: [" D3 Z
end0 |4 I6 p7 R& ?0 q% }4 U
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,其它按你的 ...
|