|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# X$ ?5 K0 H3 ^4 H0 b4 j
- E+ ^. H" _; X. v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。- Q. E1 X4 |+ }6 h2 }# L3 O
/ P# ~. G$ U' obegin P_read arriving9 q; k4 F, T& f6 H! |
while 1=1 do begin4 d" o7 v+ _5 ~1 }! x7 Z
read A_tote from "data.txt" with delimiter "\n"
% d" I) n6 }9 s/ b- v; i& S read A_time from "data.txt" with delimiter "\n", I0 D; c8 Y. |' E, a( W
read A_leave from "data.txt" with delimiter "\n"
! |) z$ K% [' N6 o- @4 ~. Q7 A) _" w read A_picks from "data.txt" with delimiter "\n"- m/ d* V. v# R0 U1 N( W
set load type to A_tote
* V% n; U" S1 w if A_tote="tote 1" then set A_induct to 1
* h! a! j9 ?, T/ C. e$ X8 f5 E else if A_tote="tote 2" then set A_induct to 2! ` T; e a N4 f( p
else set A_induct to 3 2 \& a0 `$ y& \- T9 L) i9 C3 O" D6 [
set A_i to 0% d: u- Z) ]+ g
clone 1 load to P_induction
: D4 Z% L% f4 W! o$ ~# ?9 g# A, b wait for A_time sec
. m1 ~0 Q' B2 P4 v( \3 z, j end
% i& ]- E; A$ o, E% C4 }, |end: t5 P, ^: Q9 _6 x6 B# V, b( E
7 S1 v" Y. A/ w
begin P_induction arriving6 h1 o* {8 C, @( @ b7 q' n
if A_induct=1 then clone 1 load to P_pick1
! _( E3 S9 O1 _+ x$ O else if A_induct=2 then clone 1 load to P_pick27 O9 s' T* F9 l4 T9 I* b8 M1 \
else clone 1 load to P_pick3
% _4 S4 q% X! G8 Z9 i, w" Y: cend+ a# @9 Y2 `# V* y" u
( ~6 {; ]. Z9 R7 [begin P_pick1 arriving
* x( T/ X9 G( ` set A_i to 1* s2 j5 C& r% l3 q( S+ u
move into Q_induct1( b" `' @4 d- j# x
move into pickaisle.induct1" s! e, C) P) c( H7 w) h' y
while A_i<=30 do begin
. h; J7 [! u& r3 y {; ^ travel to pickaisle.con(A_i)- v" {- p2 m5 S% B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 F9 e0 ?1 Z/ m$ I8 I: N else wait for 10 sec
3 o8 Q0 |9 a% B. X if A_i=A_leave then send to die/ G' f3 @( ^; {! b! v3 t D* C
else inc A_i by 1
' B- W8 i$ `9 @; i1 @: e end
4 u: r* N" M/ Eend9 W* X/ P' r, W1 { `
" }" V# t9 |; s# E0 U* e) P
begin P_pick2 arriving$ }) e3 Z3 L" p, x
set A_i to 11/ R( a8 U0 b7 L8 x
move into Q_induct2; q$ n+ {' D( ]: q: j0 T% F, N- Y
move into pickaisle.induct2& G ]2 Y' Q+ v: I6 p& ~ [7 {/ k
while A_i<=30 do begin
) f; L4 |( e( S* l+ r; ] n travel to pickaisle.con(A_i)
' v2 T/ O0 S: y% ~1 X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' v7 ^# c: ?7 w! Z' _ else wait for 10 sec
( T: }' d4 y9 ~# J/ u' R' X if A_i=A_leave then send to die
4 s. x& i8 p6 E8 g- a else inc A_i by 1
' f; i: i. E" P end3 o; r+ d. ]6 ]/ d, m
end4 F# l6 R1 J; W& w G
- F$ K" u7 ^$ r8 H; L
begin P_pick3 arriving
, A* P8 g' n- x9 c1 o% ~ set A_i to 21
; D/ y. x/ b0 S3 ?4 z' t move into Q_induct3
. V. \1 L/ q3 `8 s$ j! Q move into pickaisle.induct37 G( j' G3 s2 I6 `- \8 \! |/ v
while A_i<=30 do begin
4 J7 U) @4 ^" |" y2 m' B$ [$ |) o travel to pickaisle.con(A_i)
7 G* Z# N7 P9 y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ ]4 t2 c9 x6 _! ^4 u7 |: R" `* @6 y else wait for 10 sec
+ v5 V- `# Q) N8 Y if A_i=A_leave then send to die
/ y7 P5 u6 o0 i" O else inc A_i by 1
& y3 t& G$ ~8 r% f end
" N# H/ X- T* w, G. s2 W+ Wend |
最佳答案
查看完整内容
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,其它按你的 ...
|