|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 {" C% L, V$ H6 |& I
0 R6 x+ ?: g3 I) K' I' G6 ?$ m我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& V0 W4 m5 @6 [
) O$ x5 `7 k2 @7 c8 c9 r7 dbegin P_read arriving0 l( e$ N) f3 E: Z$ T
while 1=1 do begin
l- X* F8 Z' w$ y# w5 H# o read A_tote from "data.txt" with delimiter "\n"
9 \, z1 R" ?; [ read A_time from "data.txt" with delimiter "\n"
5 C1 x, l# O! V- C+ L$ j5 k read A_leave from "data.txt" with delimiter "\n"5 V9 P; v3 p0 _$ w
read A_picks from "data.txt" with delimiter "\n" L n7 d2 a8 K$ l# K8 e+ E
set load type to A_tote
: \/ \6 E2 c, F9 {2 w if A_tote="tote 1" then set A_induct to 1
" D2 s$ B0 m2 f else if A_tote="tote 2" then set A_induct to 2% z# i: Q7 P% i4 Z( ^! i% z
else set A_induct to 3
& Q/ d) O# t; r" M% B set A_i to 0
, i* g6 I4 Z4 ?- c: b: A clone 1 load to P_induction+ m1 T- X1 d/ R; N" ]# o
wait for A_time sec
- Y+ x+ c9 [ _6 J" I end6 Y6 n( m! q% |4 @: ^
end' ~6 E, a! R; r5 S. ~3 x& D" v- z
% S5 Q) E/ h# \* t. G- ]begin P_induction arriving
" X' c5 {9 C$ @$ {9 f. K if A_induct=1 then clone 1 load to P_pick1/ m0 q2 A1 C% j0 H
else if A_induct=2 then clone 1 load to P_pick25 F1 }: O3 ]% r/ F! t
else clone 1 load to P_pick3
( L8 q1 u. U; t3 J2 @( Kend
$ {- l; m3 W8 I4 Q& l; N/ k' V* ?, v/ { ~' M. b! [. Y# [
begin P_pick1 arriving0 \- ~5 u" Y4 {! o
set A_i to 13 Q w! x+ A7 E: _7 O0 `% ~
move into Q_induct1
4 K7 M7 {, V- O8 G0 c2 T move into pickaisle.induct1$ @( E" X6 V# C& H+ T4 ]/ H) R
while A_i<=30 do begin$ V) U8 x X9 F0 a3 ~
travel to pickaisle.con(A_i)
4 U. F9 V8 I6 C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* \; o2 r7 U3 ~" H else wait for 10 sec( z4 V9 d6 j0 w# I2 V
if A_i=A_leave then send to die- y3 T8 c" M3 q; `: Y7 s: _
else inc A_i by 1
; |6 P* Q' X. x+ e end# T2 m5 c0 v' j
end
4 G- J) D- o- Y0 L$ a( b% p: a7 \, T- | S$ |0 U8 M
begin P_pick2 arriving
3 ?) b6 @% a/ l4 W* D8 } C set A_i to 11
8 Q8 y4 g) ~9 W# u% m8 r9 s move into Q_induct2
0 F9 ^3 I8 v. P3 y1 t5 s S move into pickaisle.induct23 Q3 b4 Y7 g; U6 y* @9 J
while A_i<=30 do begin0 K0 z! t& `3 T0 ]7 Z1 C$ b
travel to pickaisle.con(A_i)
2 s9 h, L: h$ N: j$ E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 c8 D# C/ a1 y# |2 f+ V& y$ c+ B
else wait for 10 sec2 }* M8 b. d# `7 E$ b V$ O
if A_i=A_leave then send to die3 b$ }( A6 I# z' e$ I9 Z& u
else inc A_i by 1
y* @6 E" q( x end
+ l1 _7 x0 U* {$ O/ B7 cend
& n6 F# B% r+ m5 Y, e$ M3 [4 V6 q8 h" p8 X( |4 p
begin P_pick3 arriving* K# e$ |2 a( Z: ^7 M
set A_i to 21# K. F5 I; z1 k4 t. W
move into Q_induct3
$ F/ l- }4 @, D% k& V, F4 @/ P8 } move into pickaisle.induct3
# R( [8 u* s% A6 x- L) T2 x while A_i<=30 do begin8 ~6 Z. F M5 ]% c ~5 V
travel to pickaisle.con(A_i)/ q% [. I4 v8 W: E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ _: K+ t* {4 V% l z else wait for 10 sec- a7 G% @1 Z. [
if A_i=A_leave then send to die2 \+ [+ s c, m, `8 F; O% W/ f
else inc A_i by 1
' N3 I. t$ D4 z$ R; J8 f end/ Z" L6 t3 B1 r( \7 r8 V/ M1 i
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,其它按你的 ...
|