|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) Q u- A( E, b8 ~# T# F6 y
% z7 g8 F, D( Q2 p8 K1 [我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 b7 l* K" l2 s, f5 f# f
5 Q+ R2 q' j5 e2 ^
begin P_read arriving
( B' O. |1 ?/ s' m0 M7 B2 G6 ? while 1=1 do begin
& B$ i- k4 H- U4 Z H read A_tote from "data.txt" with delimiter "\n"' m2 r# X% k" p, ^8 Z
read A_time from "data.txt" with delimiter "\n"
3 k1 b% E8 Q/ o; o8 j read A_leave from "data.txt" with delimiter "\n"
: T& z `. k# H$ N& j) @ read A_picks from "data.txt" with delimiter "\n"
+ T3 z( |% S1 M6 H: } set load type to A_tote0 E+ R4 I: u$ ^: ? |
if A_tote="tote 1" then set A_induct to 1# ?5 T7 I9 h6 T9 [
else if A_tote="tote 2" then set A_induct to 2
0 Q+ A# Q$ g. m; O. l D$ C2 D else set A_induct to 3
, @/ k0 K, f8 u t& o set A_i to 0' R* C; d8 }1 s4 S1 {
clone 1 load to P_induction
9 |7 i6 `) e" \! U wait for A_time sec1 C. G6 ^" j; }
end0 y4 Y; O5 R# D' J; |! S
end: a8 V1 e' x9 v- z* Q2 c
$ Y7 A, |( _! d( {* j
begin P_induction arriving
, h, f/ k: u* V% C: q$ X8 S if A_induct=1 then clone 1 load to P_pick1! P9 [+ s+ O P" i+ E# _
else if A_induct=2 then clone 1 load to P_pick2: k1 t/ K( {. h# u
else clone 1 load to P_pick3
1 Z6 K: f3 M4 c; eend
* A4 O8 s6 e9 q( @# b$ x# E
; O8 x( }5 q4 C) ~5 Mbegin P_pick1 arriving
; n* ^) o0 g7 [6 d# a4 V3 r8 E$ E ] set A_i to 1
% `8 X" W/ T; K' T- k move into Q_induct1# Q+ z9 K; b' D# h3 [5 G6 m
move into pickaisle.induct1! w5 R! Q3 W7 {+ [' U) D- o
while A_i<=30 do begin
; X W. k# w, ?5 u; e travel to pickaisle.con(A_i)3 V* Q9 A0 P8 z! N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. P+ E2 u: p; y* j5 X9 k5 ]% Z! u @
else wait for 10 sec' q) H- O2 H6 x! B3 X
if A_i=A_leave then send to die
1 v- x* v# K) b0 X3 C, h: W else inc A_i by 1, P T: }9 A6 U7 w; O
end
, t- e1 H" D; Z. }* Nend' J% a0 c! ]5 g- a! e. Z
+ u' {/ w% s* L# X
begin P_pick2 arriving
8 G1 c3 a+ t/ h$ F& k set A_i to 11; v# p/ N8 b* [# G5 P- E( `1 w
move into Q_induct29 w5 \& y8 K8 o9 x4 s9 }9 p% B
move into pickaisle.induct2
7 g8 E; c" K& |9 f6 H while A_i<=30 do begin# L" b( E" l/ W3 h
travel to pickaisle.con(A_i)) E7 Q4 P0 s1 m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, v* u0 G3 K7 g6 E t* @0 b else wait for 10 sec" W, w6 p; x* z& n# I* L
if A_i=A_leave then send to die' c4 h) L. @ s( U1 D% m
else inc A_i by 1* B! d4 M$ {( g8 X. t+ H0 D
end
' x1 h+ o" z- v) B. V( x1 f, L+ n: Mend
3 K- w1 t, y$ T+ N2 @* f0 ~4 H }& @/ e0 Q# Z3 }: t! A0 J4 E
begin P_pick3 arriving, W x" Y0 a* M/ q
set A_i to 21 r* y7 C2 O, B& Z4 I1 e
move into Q_induct38 _4 ?& P! @- x$ t4 N L `
move into pickaisle.induct3. J* U( s6 |, }
while A_i<=30 do begin
8 R7 K" S& |5 T" E p4 S+ V travel to pickaisle.con(A_i)
5 O0 S: s: `& K4 a9 c5 U- a L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 Y' Q" ]" {9 O
else wait for 10 sec
5 z- ~4 T1 a4 E if A_i=A_leave then send to die' t8 F1 O- A; }3 H
else inc A_i by 1
' u3 b. E! p6 Q' f( X end z) `" L- r% D
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,其它按你的 ...
|