|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! l9 E3 a4 F: r
3 T9 z6 y% Z! D& n我的问题是,在每个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中的数值,不知道会不会有什么不妥。) t. d1 k. b, Z0 B7 b/ o$ Y
, I g* q; x- k( V- Z8 e# V
begin P_read arriving
, U! y- _4 d) e `0 `( G* ]5 j+ F while 1=1 do begin' p1 ~0 `9 x4 o; M k; V" G2 R
read A_tote from "data.txt" with delimiter "\n"
6 S" c9 v. P; n" w read A_time from "data.txt" with delimiter "\n"
: s& V h! r) \6 H1 z read A_leave from "data.txt" with delimiter "\n"# G s! V( B6 B& }2 l" d) ]
read A_picks from "data.txt" with delimiter "\n"( c5 @2 P2 h6 \
set load type to A_tote4 T! O' v6 K9 s/ F n$ z, N
if A_tote="tote 1" then set A_induct to 1' m$ S5 x' T4 R3 K' T5 K
else if A_tote="tote 2" then set A_induct to 29 D; w$ ]. j2 M$ J8 v8 |0 W
else set A_induct to 3
l |2 K5 [) g- s B7 g. N, \& R set A_i to 0
* k+ i% [& N9 b# n- X clone 1 load to P_induction. V8 a! v0 ~& g( i' T' P
wait for A_time sec9 Y& v1 d* A. W. S" J0 S% g& Q! w; a9 b! T
end
( f' i3 r7 Y- @& J: {end
% T* q: g* R& h
5 K: y5 n$ ~ E, Qbegin P_induction arriving
+ M8 |( }1 ]/ K, G if A_induct=1 then clone 1 load to P_pick1
9 r" B8 Z9 e6 }2 n else if A_induct=2 then clone 1 load to P_pick2
9 `0 y. d c0 I, ^0 w else clone 1 load to P_pick3
6 b- m5 S$ P5 L6 O( ^7 I9 `5 Kend5 J P% X3 D. U4 `+ p! Z
% t* @2 S" U4 abegin P_pick1 arriving2 F, T5 y9 r, j4 Z, Q1 b
set A_i to 1
! P& p' w8 {$ h ~" B move into Q_induct1
. z: i* t; H/ X; {& I+ J9 A/ u( s move into pickaisle.induct1( ~: q/ p8 M4 ?" T* R @" ?
while A_i<=30 do begin% j" ~$ p1 C/ j
travel to pickaisle.con(A_i)5 J# A+ n: d$ W5 b" G
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- g8 z7 y8 |: i5 `1 [
else wait for 10 sec8 j3 B' `2 f: b* g2 C" L5 a/ B
if A_i=A_leave then send to die a4 i% M q. O- }" `) E2 h
else inc A_i by 1
9 J8 d6 ~) s# b7 K( S end( C4 S1 b }/ h% D, ?7 ?
end1 r D. H! L: Q9 Z5 X' y$ N
3 P6 U, L# }, H; q& B0 h- k, K9 ^begin P_pick2 arriving
$ `: P. C* J# d; B+ g5 F/ ` set A_i to 110 m( o( x8 J7 ?4 E8 }
move into Q_induct2" h5 }- a) w) `( B- \, w0 J
move into pickaisle.induct2' X/ h6 A* B+ |0 u6 H( Y5 ^$ H C4 V' N
while A_i<=30 do begin6 ~. F& I; X+ O7 e" E
travel to pickaisle.con(A_i)7 N0 c" A: ~9 x5 b! V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ d! j% T, q' {6 U; |
else wait for 10 sec
- \: W3 d0 D/ I0 G; q y& q- s if A_i=A_leave then send to die+ _1 S% [6 A l5 }4 _4 M$ G
else inc A_i by 1
" n+ G" j/ ^' h$ U end
" n0 @5 T, \8 ]0 M: Y! @0 {/ jend
1 i5 q4 p6 B0 y( K# N$ R$ u X6 Z! X% N; E, Z
begin P_pick3 arriving! U. j% Y$ S7 P& }9 H5 b. z8 ^
set A_i to 210 w5 \4 T( u, i; t/ P, _, r3 R
move into Q_induct3. _3 W/ U) X0 Y: ]
move into pickaisle.induct3$ S- \- h. N# g* E8 K' n
while A_i<=30 do begin5 X) @; b& u, k$ h
travel to pickaisle.con(A_i)
. A) O, `4 q3 k% \% Z5 M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 d0 b) z. B1 ]" ]
else wait for 10 sec5 G- j; D5 N0 g. ?1 a2 S* v# F$ A
if A_i=A_leave then send to die
5 D) _6 s, k( S( s1 y1 P! A else inc A_i by 1
3 T- `4 |% f- J; M4 P% @ end) U, I) ]) o# R5 H
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,其它按你的 ...
|