|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% Q# @5 T8 ]+ q M
8 b# E% y' q' 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中的数值,不知道会不会有什么不妥。 A- B: x" F8 Z4 a+ [
$ `) R; x( I6 W1 q3 i, ^
begin P_read arriving
- J7 v4 \$ Y U' o" l, ~ while 1=1 do begin
* M- H2 W4 B2 H x. q# l! @7 Y7 ] read A_tote from "data.txt" with delimiter "\n"" o0 l7 ^6 i( [
read A_time from "data.txt" with delimiter "\n"% @* }# z2 w& b3 Z1 M
read A_leave from "data.txt" with delimiter "\n"8 _1 ~2 [# p& m5 \3 G
read A_picks from "data.txt" with delimiter "\n": {# z' y* X% z2 }9 a6 R
set load type to A_tote
N3 Q/ n: S1 x+ e. e if A_tote="tote 1" then set A_induct to 1- S4 O' ?! s# A$ V5 j- C% S
else if A_tote="tote 2" then set A_induct to 2) K2 Z4 g" i# t4 I! D/ }
else set A_induct to 3 : ?& g5 B' W* Z; h) E! K
set A_i to 0+ j: N' p' B& m. l% Y6 B1 E
clone 1 load to P_induction
( n3 E( Y Q. {' u wait for A_time sec
3 E9 `/ w$ |# h4 P end3 ?/ \" ]4 d/ @
end7 ?/ f( P4 a: S: ^/ t
, s# w' f" E8 F! P7 N1 F2 j) K6 e
begin P_induction arriving- y( d" O6 T" Y2 ^4 C+ }5 j
if A_induct=1 then clone 1 load to P_pick13 Q( w! x2 E% B+ V- O
else if A_induct=2 then clone 1 load to P_pick2 |" m$ s) D* s+ S5 y
else clone 1 load to P_pick3
. ]0 o9 ^3 `$ f7 g( }+ E9 Wend2 |' O3 L# y2 h( @9 ^$ x
$ u. y3 ^$ I0 F: f3 Y/ fbegin P_pick1 arriving
, ~0 O) P! ~( _: G& Y" a0 Q set A_i to 1
' b+ W, n( _6 D+ G8 G move into Q_induct14 K! A* Q u9 J: n, f- {
move into pickaisle.induct1/ B. A: G# F$ W& r
while A_i<=30 do begin
8 i& \. M v0 I& H travel to pickaisle.con(A_i)
/ z! }( A. B; m. |2 }5 q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" e( J$ i6 X. }. m7 q
else wait for 10 sec
+ @. t5 X) @, B0 b: @- m4 J# u if A_i=A_leave then send to die( F9 m* L$ H. X. @. ^1 h
else inc A_i by 1! G9 Y: B; K0 p
end
: t* m; b9 v! E' V+ A7 c* Wend) c1 x U: _0 n& U: y* @
2 n( k1 n7 [ ?5 |5 z# f5 B H8 ^
begin P_pick2 arriving
4 i; |: t/ t" H9 ^/ {' D set A_i to 119 k8 w0 S, v9 y1 i! a( ~
move into Q_induct2" H3 N# T+ e4 R) r0 l+ |
move into pickaisle.induct2% X6 P3 h* L E/ o% I2 W
while A_i<=30 do begin' c% x/ A& S) ?! `& h9 c
travel to pickaisle.con(A_i)) _' c! l- u, P) T+ ~2 f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 N K* _, E% P1 W, @2 l+ _$ @* p9 a else wait for 10 sec
; r$ W* B7 M/ D. {' A8 n if A_i=A_leave then send to die9 V9 T) ^: h6 ^/ l( D' E1 t
else inc A_i by 1
9 X7 c H: ]8 o1 Q; a# X. [ end
! c2 \8 x4 Y1 Lend' O6 e$ J5 v+ G5 U4 r
- P9 y" c$ S) B
begin P_pick3 arriving" l3 E0 k* W6 f7 _
set A_i to 214 N1 {: u2 c; k
move into Q_induct34 G8 `7 B( G- Y$ \$ h
move into pickaisle.induct3( U; ^8 r, |. V
while A_i<=30 do begin8 _# _4 R, R; f% [/ [6 Q% U
travel to pickaisle.con(A_i)
% Y* O5 X! R r: N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* k* P9 }0 \3 m
else wait for 10 sec
4 f+ q# b9 p; `: J) y if A_i=A_leave then send to die
" y7 C7 ~+ k' w# b else inc A_i by 1
8 ]9 T5 M5 }% _6 Q! W end6 G: e# l- Y! y% ~
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,其它按你的 ...
|