|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' q( i* q5 \ p- W! J8 S! r9 s
1 n6 W; y+ \6 J* }1 A2 G我的问题是,在每个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中的数值,不知道会不会有什么不妥。
0 b( H8 j" H7 z/ [1 L- M* S+ t3 ?' K/ a* e/ M
begin P_read arriving
7 Q! o& ~% H: y- y5 ~( L while 1=1 do begin
6 Z" S( b& A* t; u- l$ @, Y5 I read A_tote from "data.txt" with delimiter "\n"
: K6 r7 H+ J' w, ~& S2 ?& F read A_time from "data.txt" with delimiter "\n" o" p" ~3 N' W! U G
read A_leave from "data.txt" with delimiter "\n"
7 w& p7 W) x$ o& _* U+ b read A_picks from "data.txt" with delimiter "\n"
, @- V; E) x5 ~" t' R( ? set load type to A_tote7 w g* y# q3 |
if A_tote="tote 1" then set A_induct to 1
# b6 s- ^! ]+ e else if A_tote="tote 2" then set A_induct to 2
$ g1 E+ w+ y/ e) Y$ v4 z3 J& h else set A_induct to 3 % y, [4 b) o) r
set A_i to 04 [- _$ K4 C; ]. j! K1 x s& u
clone 1 load to P_induction" C q9 o; `0 } x
wait for A_time sec
4 d, o/ ^- |! `1 v/ j$ O end
3 t" g4 W5 q `* k! B. h$ Gend
5 u3 R% N w+ b) p9 y9 |9 r2 f7 [4 U8 q I/ ~0 c( P* b& U1 }" @
begin P_induction arriving% v4 I) c" B/ `, x+ p
if A_induct=1 then clone 1 load to P_pick1
3 z' @4 k) A* |- C' X( B9 b0 y else if A_induct=2 then clone 1 load to P_pick2
" X' S. W+ ?0 o6 | else clone 1 load to P_pick3
5 `5 Q; `' D; v3 c* g; hend5 F% {9 v2 B# E; Y/ o3 j/ G
0 S5 c+ o6 v( ~& C( C% L- ]
begin P_pick1 arriving
* {, H2 d% g+ b- d+ W set A_i to 1, F) F. A5 w4 c* w! U
move into Q_induct1; r X. D; q5 f/ o4 K% L/ {
move into pickaisle.induct1
2 p7 q5 G' e/ b z; i, F, N$ O9 R while A_i<=30 do begin
* m/ o, e9 w5 W travel to pickaisle.con(A_i)
& u8 D! t6 ]3 l+ ?+ R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( W. H& w2 `8 f2 ~1 h else wait for 10 sec: f( f+ ~- L; c3 F2 T
if A_i=A_leave then send to die( C- }, ~$ e& Q
else inc A_i by 1
( C9 e. h- t. {7 b6 n4 A end2 X1 S$ A- v% l- K/ S
end# i E9 M, a+ @; k% ]$ ~' ^
$ U2 ~6 c. a8 q+ [2 h. z
begin P_pick2 arriving5 C& \; m6 ]* V# o, s
set A_i to 113 w4 M. c$ Q% F* v2 h( ?7 N6 N
move into Q_induct2# T1 y+ Q0 A2 ]( S4 y; x$ b' x0 W. J
move into pickaisle.induct2
2 v* w% K, o7 {1 d3 y9 r while A_i<=30 do begin l* m- \+ c! j ~/ a
travel to pickaisle.con(A_i)* F! P+ g$ a. ^* Y+ \# j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- Z4 u" b% ^. T& c7 A else wait for 10 sec) M3 `1 l. c F! [; P& X1 a
if A_i=A_leave then send to die7 ~1 n( Z, P! f, R- G, A% b( \! V7 c
else inc A_i by 1
0 j# K3 o, L: H end
( _- T, R6 {' kend5 r- f! u% {6 F& P
3 G* K) Y. K; ~8 H& ebegin P_pick3 arriving
$ k: ]: L. J3 W set A_i to 21' @2 B* _2 E6 V8 k& |! Z
move into Q_induct3
: a$ }& x7 F( m f8 I8 f, | move into pickaisle.induct3. G- d w- ]: j- P
while A_i<=30 do begin
- P: p2 A/ Z9 e8 P travel to pickaisle.con(A_i)0 A+ n; C2 D' `: O$ ] T7 o+ ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 ~) r! T2 A5 z/ j" O ^! B else wait for 10 sec m& y& L0 ? V5 b# v% S8 } p
if A_i=A_leave then send to die
" v" H4 S, {: y2 q# H else inc A_i by 1, a4 U5 C) W3 G& v
end8 s) A( c- E& ?* T# ]- H8 u0 b
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,其它按你的 ...
|