|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* s M) H& W0 u" i
' p1 |9 T1 @ }( z% R8 e' C( I我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 Q9 z4 Z& G& _# k
* U6 c4 Z' x( [ D8 e
begin P_read arriving
7 r8 Y$ F& {) @- W while 1=1 do begin
* ~( k4 L! k" C- h: q; Q( v read A_tote from "data.txt" with delimiter "\n"7 o1 W4 f, c# k% u/ j& V+ a/ h% j
read A_time from "data.txt" with delimiter "\n"
# J2 W8 X' o% K V1 n read A_leave from "data.txt" with delimiter "\n"
2 o& I* ^( x6 B: g. g$ U read A_picks from "data.txt" with delimiter "\n"
8 y- Y1 u- ~# `5 n3 x; e& T set load type to A_tote
+ I8 \8 a C5 p% ~ if A_tote="tote 1" then set A_induct to 1
: ]% X" @% C$ Z2 }+ R else if A_tote="tote 2" then set A_induct to 2
7 Z5 k. H5 R- ` else set A_induct to 3 * ?7 l, H/ k2 [6 N( a, t/ n' T
set A_i to 0
4 C/ [1 L" b. Y$ i% Z c clone 1 load to P_induction! b7 s3 o& }+ u; ?: R% g
wait for A_time sec# m! o7 H* H- s0 H- ~# R# Z! C
end U5 z |) s+ O- y. h6 V
end4 U3 I; J' O( c/ M
: s0 w' F0 A3 {! E9 pbegin P_induction arriving+ U0 Z% [6 X/ K
if A_induct=1 then clone 1 load to P_pick1
' F, l) l# L! z& Y n/ O* G+ Y K( q else if A_induct=2 then clone 1 load to P_pick2: n3 r( g. Q3 y. P( g, {
else clone 1 load to P_pick33 s9 P; \2 U% t# H7 \1 B6 c0 Y
end
" u+ b' G2 k: B1 q. _/ Z0 D* t0 f6 o/ k8 U4 ?4 K+ G
begin P_pick1 arriving
$ V. E8 s$ d0 s2 v. a4 z9 A( A; |, e set A_i to 1
9 q% p4 I# @# c9 d$ d move into Q_induct1
* f, s; Q. o% } move into pickaisle.induct1, v; V) P7 }9 [- Y4 g
while A_i<=30 do begin( Y& @3 O& `* z# p, ?2 O
travel to pickaisle.con(A_i)8 q' ]. F- g" n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 d/ m; \; X# f
else wait for 10 sec7 E4 ?# \4 g; s W- H6 u
if A_i=A_leave then send to die
6 y/ {* c4 [* Y7 N* L- ?) w else inc A_i by 1# n8 |6 `0 a$ l0 ]5 a, x
end
* U" y% Y: ~! ^ l* Z# `end
: m8 Z. s! @) D I7 \! ~7 S/ g1 \
5 ~$ A# V2 A: w! K& {begin P_pick2 arriving! v) h+ V. t8 r- s! ~
set A_i to 11
5 {1 a4 B1 }/ G+ M G move into Q_induct2 g. i) d4 K1 L4 c/ w) H8 Y: ~7 s
move into pickaisle.induct2
4 z- N! i }+ _3 l+ Z: Z" Y- e while A_i<=30 do begin
/ C4 m @# O, F& o4 ` travel to pickaisle.con(A_i)
/ O; }+ I3 k# K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% V `9 B. `% {6 {2 h: d
else wait for 10 sec6 a w9 Y8 \- z5 R& s$ M5 L, r
if A_i=A_leave then send to die! |, h& E2 s( K- ]9 F. ^, G" p1 X
else inc A_i by 18 f1 ]' v5 _: ]1 n
end" l( R2 b* }/ ]
end% g3 _8 Q! }; _7 }& a0 A
& }! e( S. b0 E# W2 ?1 L
begin P_pick3 arriving
% z8 f4 P6 I. A9 c0 n/ @9 S% w; x set A_i to 21. m! r7 u0 {4 \8 m$ J" C! _- z
move into Q_induct3
& ?! w; F0 ?, y/ i* R$ x7 ]; a move into pickaisle.induct3
# Q, F+ S! z; s# | while A_i<=30 do begin& V, I {) ~6 H% ?* C
travel to pickaisle.con(A_i)
/ ?3 k, T- U8 M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 E" G) {- F7 {" f' l8 J else wait for 10 sec
( h y: J0 U3 J- D4 R$ J2 S5 B if A_i=A_leave then send to die
' b8 @2 C! {7 s0 F1 e# d( \ else inc A_i by 1: _7 [* j% W& j# M4 U, X
end
) h: j$ m3 J, f0 j+ F. _# t* rend |
最佳答案
查看完整内容
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,其它按你的 ...
|