|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ B& ~! r a5 G. B1 W" B! p' U! X. d" D, @
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 K1 Z. X& S4 u- H! p
$ @6 s: I+ E* t" s8 y) y; @begin P_read arriving
. g# F! g: ]' H* T while 1=1 do begin
7 H- B2 w# _- g read A_tote from "data.txt" with delimiter "\n"
~; V$ z7 \) `5 ^+ U( z7 e read A_time from "data.txt" with delimiter "\n"
m1 n& K# N$ h8 Q% W read A_leave from "data.txt" with delimiter "\n"; b+ I) V/ P6 t3 y' T
read A_picks from "data.txt" with delimiter "\n"
9 ^+ C; Z9 r# H0 c% S+ O8 j set load type to A_tote8 J4 @) P+ `1 R0 J/ v. T2 o
if A_tote="tote 1" then set A_induct to 1
& T. P6 M5 A f6 }6 @( U- y: m else if A_tote="tote 2" then set A_induct to 2 g, G i: V' Y: H, T- i
else set A_induct to 3 % h& F0 n. r7 B3 y
set A_i to 04 W6 M }: Q+ z$ b* D1 a+ d
clone 1 load to P_induction
+ w8 m$ Z% w) t% e) d wait for A_time sec5 Y; p& S3 _: u. j. R
end8 r/ c$ V2 p/ e8 [) t, e. B4 w) O
end
4 s- N5 x. G; F8 c" ]9 r0 ~- y3 ?5 f
begin P_induction arriving5 C4 W% R* ^7 q
if A_induct=1 then clone 1 load to P_pick1
* q$ Z6 v7 f* \; [' ~9 N else if A_induct=2 then clone 1 load to P_pick2) b- D% o; r5 |8 W) D! @
else clone 1 load to P_pick3* {3 I6 S3 y) C& o4 f
end
+ ?' g; Z( q9 A- ]& s
8 Y3 W1 l; X9 w! V2 e' Z' Ibegin P_pick1 arriving: j2 Y7 a3 A6 l w; x( j1 G
set A_i to 1. h2 `& e" O8 n
move into Q_induct1
! X: X8 D, Z+ G2 k& _! R move into pickaisle.induct15 h8 R* {4 ^3 G9 `
while A_i<=30 do begin
7 o# S3 a5 t, q9 J% W9 u travel to pickaisle.con(A_i)) s9 W: }+ }! Q) y. r. {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" H. |, V, t- Z. q; \( h else wait for 10 sec: L4 a- _- P% }
if A_i=A_leave then send to die
, C" e" |# c/ S else inc A_i by 1+ W$ D4 n0 T8 R* }: O, |
end
# u2 E! K. I" C: ]% F+ g" T8 ]end. o2 E2 O% A2 i8 I) {
) o$ @( Z! s+ i1 I* vbegin P_pick2 arriving3 j! b: y) B" A8 Z* ?2 s, N
set A_i to 11$ ?" I) m0 p0 J5 H" E! w
move into Q_induct22 b) x* K# F* P
move into pickaisle.induct2
5 g3 g# P! V6 {5 E while A_i<=30 do begin
5 X% Q1 U$ j$ _$ g travel to pickaisle.con(A_i)1 j9 f! o! [ h8 r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec k | t7 @: X, f! P0 @, X' }
else wait for 10 sec; C2 _, E7 l2 V- v* A
if A_i=A_leave then send to die- T1 E( G4 D5 k2 Q* ]
else inc A_i by 1
, j$ b2 m6 ^; i+ x% k end
; v' c( _% f, Z: P6 kend
9 X1 l/ s0 u* r4 g4 t
* }! a" V# t- y8 v0 _" Ybegin P_pick3 arriving
* I/ L `8 m& q$ p+ J0 h set A_i to 21
9 s4 d0 C' T1 p1 ]& g move into Q_induct3% h4 ^. p+ u# V/ z* ~" y2 }3 z: ?5 h
move into pickaisle.induct3
4 o# P9 C8 t: M W while A_i<=30 do begin& r8 Z7 Q( M; g+ v! H* V" p
travel to pickaisle.con(A_i), ?6 [2 `3 b4 K# P$ k$ t
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) t' p4 b* c1 c7 C1 U
else wait for 10 sec$ g/ L6 r, z2 \) E
if A_i=A_leave then send to die* K( g1 \: W3 `" K3 F; W
else inc A_i by 1
% s& n3 ]1 f' H end
# y6 I1 U: ^+ X- _3 q8 M$ gend |
最佳答案
查看完整内容
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,其它按你的 ...
|