|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' v& b7 A/ m8 F. ^: b
9 p& Y+ t! L: q/ g/ {/ Z w$ ]我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 n2 \2 V) W1 Z- f! \5 n8 `0 B! f$ h" y3 E4 x* d
begin P_read arriving O3 H% h% x: W. h ]0 ~9 Q( T
while 1=1 do begin
8 c) D& W0 B0 V& w read A_tote from "data.txt" with delimiter "\n"
4 O4 d3 V6 x& H, F5 j+ G read A_time from "data.txt" with delimiter "\n"# `1 x v4 B6 h; q! Q' S
read A_leave from "data.txt" with delimiter "\n"
! ^$ v, a0 O% i4 K1 ] read A_picks from "data.txt" with delimiter "\n"
& K' T: F. s7 W& R8 y set load type to A_tote
1 s+ Z- V3 ?; P1 o+ ^ if A_tote="tote 1" then set A_induct to 1
1 \' `4 @7 w( u6 W5 H% } else if A_tote="tote 2" then set A_induct to 2
2 P A. L" P& j# C4 f" i4 x else set A_induct to 3 - K9 l& |1 b" i2 [. t6 w! b( Z; w* X
set A_i to 0
% F6 G! Z+ W( v% M clone 1 load to P_induction. I! |% \0 L: x5 R, X
wait for A_time sec! V' x# z3 [! L. j l9 R
end1 O3 j! |2 U; y! h8 o, d
end
$ V( P, g) V" P( L& V: I
! `8 f0 ^, F. l/ y8 L6 Mbegin P_induction arriving( Y, E. }2 U; q: m% x
if A_induct=1 then clone 1 load to P_pick1
" `5 h) L* K' ~4 X else if A_induct=2 then clone 1 load to P_pick28 c2 G' |3 ~! S5 q
else clone 1 load to P_pick3/ k. k) B& R* b' z& ?1 o$ R
end. t5 A: i: B. p4 u4 b
, t' O* j, D3 e5 O* y* G; j% \' Dbegin P_pick1 arriving
; H% j8 P- G L; h5 j: b& n set A_i to 1
0 h1 s, S. T# \6 O0 k7 k- |2 F move into Q_induct1
, x2 H1 [4 F* [" Z+ A+ { move into pickaisle.induct1$ B+ B, U* c$ W
while A_i<=30 do begin
; ^6 e3 T1 w. g1 a$ h travel to pickaisle.con(A_i)
' j1 S2 E7 Q: I8 W0 O3 K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 V2 ^: N" n. E& z# R
else wait for 10 sec
+ U6 J6 y7 P( a% s if A_i=A_leave then send to die1 G5 a) V% p0 n2 A
else inc A_i by 1
& C9 P' g- X# `2 o end% J, m; z" V2 R8 V. s' R
end$ C" d: U$ }6 d" J# {3 ~+ f
0 m! R+ W2 Z6 Z! v# w' {- K% c9 k
begin P_pick2 arriving
! }6 _4 E8 ]% G$ J# Y5 g set A_i to 11
8 x2 K8 W( d. M2 M# d: Q move into Q_induct2
1 J4 j( j5 ^, X move into pickaisle.induct2 E4 o7 y! ^* L. t7 z9 Q9 c! g
while A_i<=30 do begin# [" V' Z3 o% b6 }
travel to pickaisle.con(A_i)) a) h) j' R* D/ p& G# a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* G" k) u5 o- ?4 D) U( q else wait for 10 sec3 w6 L+ S1 L6 J& B$ B4 L$ h
if A_i=A_leave then send to die' O& G* h* p: g u: J* f6 Y' ]
else inc A_i by 19 b; f- c8 e) [+ H. `
end K' H& ~' A5 M: K9 B; h: x
end
: p8 ~8 l" E6 ?; R# A; ]+ J% y
8 B4 b4 ?. q. h1 w8 I- e; Hbegin P_pick3 arriving$ j, H8 [6 z3 Z' w
set A_i to 21+ f& h1 z: d7 x- U- L
move into Q_induct3% B( D+ }- k$ y& J' `9 G
move into pickaisle.induct3
, U9 n0 f3 d: X1 M' T9 J% a while A_i<=30 do begin
' D- F& Z4 X6 K2 L" q( I% Q" j travel to pickaisle.con(A_i)
# r0 N B5 j! u' R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; w& I7 u+ u0 p0 h5 B7 ]3 c1 w4 b else wait for 10 sec
% A2 k1 e8 g' a0 V" [' @ if A_i=A_leave then send to die0 {- v% b" o Q2 X; I
else inc A_i by 1
- Q% ]+ f5 \- `8 y p3 a end
+ U/ ]& R% |4 w( x* Uend |
最佳答案
查看完整内容
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,其它按你的 ...
|