|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 y" H8 x, A& I3 Q: \% x. Q- o7 R) G% ^3 _2 r" 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中的数值,不知道会不会有什么不妥。. P: u* F5 J$ T
$ |! p+ L+ D( \9 j
begin P_read arriving r/ d4 ]$ }$ |( g5 K, r1 @
while 1=1 do begin" x( v; s% U2 h' K8 D
read A_tote from "data.txt" with delimiter "\n"
2 D Q) `$ ~: W/ `* o read A_time from "data.txt" with delimiter "\n"3 W/ S X4 @# R! ^3 }# v
read A_leave from "data.txt" with delimiter "\n"* t, B! A X9 X- r8 _; j$ `8 ~ r
read A_picks from "data.txt" with delimiter "\n"
8 g5 V. B$ D2 O' {! R+ n# | set load type to A_tote
. |: q: R0 z! }0 J if A_tote="tote 1" then set A_induct to 1
]/ ` h( n8 |( l( ]' O/ R else if A_tote="tote 2" then set A_induct to 2
) l5 x8 C5 A1 D+ R/ Q- A4 c else set A_induct to 3 3 ]5 h$ ~1 F! X7 ~' z
set A_i to 0. F' K. w5 i7 Y. r
clone 1 load to P_induction0 Y* y/ c+ h( X4 n4 y& \3 y, b
wait for A_time sec4 n# Z9 ]: V( ?- }& f& Z
end
N% o( b2 W0 q$ o' Zend9 t7 d: K" b- d3 _
" S, m' \( i% w* O! R7 Y# C
begin P_induction arriving. W! S2 v: Q4 y% k& [' I
if A_induct=1 then clone 1 load to P_pick1
8 p. a. i8 n' K! L1 u) O9 y2 o else if A_induct=2 then clone 1 load to P_pick2( w2 v1 b& o2 @& o, |2 }
else clone 1 load to P_pick3
! G+ H; O4 g6 c8 ^end
# P4 H7 B/ Y$ J. J7 b
0 N7 w6 t$ W+ I* Pbegin P_pick1 arriving a& N7 `; t8 W7 c& F# T: w
set A_i to 1
+ [# q4 w: ]! [ p move into Q_induct1/ p3 ~# d7 E K8 q" W
move into pickaisle.induct1+ U" m# w7 w. t \
while A_i<=30 do begin
k' l2 x6 u2 y: S4 ~7 D- v travel to pickaisle.con(A_i)
6 W6 W1 ]& v2 } m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* Q* k* K% _7 T) ?* X+ c else wait for 10 sec0 {6 u" F8 W/ k" l8 R
if A_i=A_leave then send to die& |& T+ }% k8 X: k2 i. }( |
else inc A_i by 1
8 o# G. V0 B. a/ b: W end
" r# {$ G3 V5 d& x- kend
r( G7 N0 E# X- L
" P' z4 D" k5 H" D3 c( ]begin P_pick2 arriving. s( A0 H) E% ?% c) l5 B
set A_i to 11
1 B( a6 L( q8 ?( ~" P4 F. ] move into Q_induct28 k6 {2 L, ~1 a6 J3 u" y
move into pickaisle.induct26 @0 D% W1 {# _ G7 M
while A_i<=30 do begin* n+ t( _6 l$ p! v0 K
travel to pickaisle.con(A_i)% j( u. n4 m( q- [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ L! ?: y, n7 W2 H* Q6 s else wait for 10 sec
Q, f: T+ O3 e7 e. f if A_i=A_leave then send to die
1 [" M; D B' W5 [; [! |; B else inc A_i by 1. G! g1 Y' n X l: u0 |' r
end
- ?2 ]2 M5 e3 W; qend
4 W- |. M, q7 |2 ^9 g* T0 P
3 {4 {7 k m2 W% q Bbegin P_pick3 arriving7 k9 o+ y' z$ {
set A_i to 21$ ?# w' Z$ @$ W2 M( `/ S, p
move into Q_induct3; e4 T; n, O, ?" A" n4 P; E
move into pickaisle.induct3) T4 f5 E( b! L p4 E& g
while A_i<=30 do begin( c9 b: ~; N; E- B" d8 q9 @; f5 A
travel to pickaisle.con(A_i)
3 W! N7 ?+ {& f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, _; L: A* k3 I; f8 s! N% ] else wait for 10 sec# y$ p* [$ o3 o- N
if A_i=A_leave then send to die2 K* Q! a" l/ ?- c
else inc A_i by 15 E- e1 d3 C8 p, T
end9 m+ v$ _ _4 K7 I! l( C
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,其它按你的 ...
|