|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* w" f N6 `0 [% a# @1 D( y+ b' X3 Q x
我的问题是,在每个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中的数值,不知道会不会有什么不妥。: K2 n( K: {) R# b
' y2 e- `( F9 f0 N* c5 Ibegin P_read arriving" g0 B; d9 z3 _( G8 H+ I$ W
while 1=1 do begin
3 ~1 m' L) E9 _0 F% d/ C read A_tote from "data.txt" with delimiter "\n"% F: S$ M! H* z0 N- W+ I6 G' ^
read A_time from "data.txt" with delimiter "\n"2 {1 d _# |$ Y2 G! f$ K
read A_leave from "data.txt" with delimiter "\n": P3 P: a6 P0 _, s' U
read A_picks from "data.txt" with delimiter "\n"
. z5 ^) w0 O& d. j set load type to A_tote3 A7 s! U! M9 G; V) ]& z
if A_tote="tote 1" then set A_induct to 1: [: ~0 M' q* {# r3 _* Q
else if A_tote="tote 2" then set A_induct to 2
; A6 w0 V9 }) U else set A_induct to 3
, L$ F4 K; w+ B) ^7 U9 {8 W set A_i to 0
5 @: ^$ s9 R1 C# _1 k5 R clone 1 load to P_induction) ]& w$ s- @' |* @' `& z
wait for A_time sec: ~5 d# l* m8 b$ B2 L' q4 I( [
end
( Z8 X) I. k$ | }4 Tend
! }2 k, q8 p1 m) l
7 S i( N' y8 c4 _6 ^$ Q6 A& j# Kbegin P_induction arriving/ V' u7 Y& |/ V( }4 D' I
if A_induct=1 then clone 1 load to P_pick1+ m- ]5 j2 }, G( W
else if A_induct=2 then clone 1 load to P_pick29 W! v! u; b/ b: _" M
else clone 1 load to P_pick3
- U- U3 Z. ~6 B) Bend( }6 F* A( d7 {: }
* j9 g/ ^: s) _9 Z8 n% k4 f( j
begin P_pick1 arriving
( H( G1 q' W# P# n) T3 `$ {1 s set A_i to 1
( [$ o+ [# D( [ _% ` move into Q_induct1
1 s* Z2 K- y5 p) d$ s% \6 Q move into pickaisle.induct19 I; B; h% W- ^2 a8 f, G8 v
while A_i<=30 do begin
# ]. M2 P' c$ K- a travel to pickaisle.con(A_i)
2 y9 U2 H, o( |, u. u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) ^9 _( {( u6 d" }
else wait for 10 sec4 \$ W$ ~$ p2 D8 K) n: u; D
if A_i=A_leave then send to die1 e& B: @9 A/ R8 p4 O8 Z: B3 g' o% b
else inc A_i by 1' l; h0 v* F, X: T4 Z/ ~
end! s) J% v; y* l2 m
end
$ V n+ u8 Q; d" h. l; f
6 H3 p5 y+ B* P7 r2 ibegin P_pick2 arriving
: |0 B7 T, B' R set A_i to 11
* d- |& N# x& R7 _* ~ move into Q_induct2# h' y( F2 A8 k' j6 w2 M' a
move into pickaisle.induct2
% g, v& C$ l# P L- `& D: F0 j while A_i<=30 do begin2 }5 v& B% @) ]7 u; a+ f- ]$ R
travel to pickaisle.con(A_i)/ p/ V5 T* G/ w2 L2 I# ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* N, ?$ K9 ~& U' ^# ]7 J else wait for 10 sec& T; g4 f0 q0 G6 j9 w
if A_i=A_leave then send to die
9 r: O2 X/ m) \* A else inc A_i by 1
$ k9 n( U. Z/ D$ \6 T( w2 I end
/ b6 {) b: Q! g |end! T7 g) h" V' [" M
9 R8 @6 @* s# i: f2 v- [
begin P_pick3 arriving
" i( N, E1 o7 U3 c5 E" W set A_i to 21
& E" g+ {4 i) b9 _2 m move into Q_induct3
% U. m8 \5 C, W: @! n! ^ move into pickaisle.induct3
# H% q8 S' o1 G( k6 f0 } while A_i<=30 do begin" m! n( k. R' T8 O% B& O
travel to pickaisle.con(A_i)
/ ]! Z, U. i2 z$ w, Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 w5 E2 h3 v6 {3 [% j u5 l( J else wait for 10 sec
' r8 w( s% U Z3 i if A_i=A_leave then send to die5 D/ D8 h- \2 D a3 q7 }
else inc A_i by 1
/ C( s0 r' o$ h3 y% V+ z end
& i a: @( r c7 e: ?' Vend |
最佳答案
查看完整内容
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,其它按你的 ...
|