|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 t' F6 P% c: k! ~! e
, N4 d: h- Y: _, 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中的数值,不知道会不会有什么不妥。
- U* ]4 t% h0 F% D- B4 I$ R
, m; a. B- P6 _. T, K4 P; O( dbegin P_read arriving* k$ A+ l0 ]! B0 C( N
while 1=1 do begin
3 g; z+ h2 E+ j- L4 l5 S read A_tote from "data.txt" with delimiter "\n": Z" L3 r' M+ Z9 n) E
read A_time from "data.txt" with delimiter "\n"" M8 t4 F g! \# }1 P
read A_leave from "data.txt" with delimiter "\n"
; a) g9 H5 R0 Q read A_picks from "data.txt" with delimiter "\n"
6 k1 f* W. U- X) P set load type to A_tote
' |9 ]* k" q' P% }9 n; G$ \ if A_tote="tote 1" then set A_induct to 1$ I X9 @: Q! o# z2 ~, q. C" b3 e# X# W
else if A_tote="tote 2" then set A_induct to 24 }4 C4 Z& m0 K& k
else set A_induct to 3
9 f# T' F0 q+ f- W( l# K. Q) Q( J set A_i to 0
2 j; a; O9 u2 D! S clone 1 load to P_induction; x h: J, Y d \! p# Q
wait for A_time sec
9 g% O5 X0 s; w' r, C% y F end
1 u f# I( ^. v! yend
: A. x u' U+ ]' N3 l5 a% b9 `0 B) K2 N* M, f+ F2 ], t
begin P_induction arriving
0 g+ h6 `* D# L; Y% k8 |* I if A_induct=1 then clone 1 load to P_pick1
1 T6 J. r$ o3 Y4 w$ P8 K4 V$ y else if A_induct=2 then clone 1 load to P_pick2
) Z* \; Z! k4 `7 U0 ?: v else clone 1 load to P_pick3- L1 F2 L1 y6 q. c3 p8 o# l, O
end
) J: c$ d' a3 h* `4 d; j$ d- f! D+ f# @; G; X6 h6 D
begin P_pick1 arriving
: i1 }5 j2 z. n. ? set A_i to 1
) N/ d/ U G+ p$ Z _ move into Q_induct11 Y7 \( h0 j3 V5 {9 v9 C
move into pickaisle.induct13 N" B1 G2 x' l& r
while A_i<=30 do begin
& @8 X8 x% e0 s0 P0 F: e travel to pickaisle.con(A_i)
" p& w, G5 e- q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 v" `+ e+ E$ j2 y
else wait for 10 sec: m' O+ o9 M3 v. n; V. j. [
if A_i=A_leave then send to die
- R8 v+ U' }/ Q" E o; m, r else inc A_i by 15 ?5 V# Y2 A9 Z( a1 X" R
end
8 q, T! u% A! W ^+ k* _end: E$ _+ E, Q0 Y" ^) n" Y' D
( j* h* ]2 q7 J @0 M/ E% k- [begin P_pick2 arriving0 q( N% n, ?5 Z' n# `) w! v
set A_i to 11
4 X" J; b& P6 Q3 r4 D/ k8 ?: S/ b move into Q_induct2: P. l4 H, G5 L7 d* k @& x1 d+ ^0 H
move into pickaisle.induct2
* B7 `: x) @4 Y ^6 d while A_i<=30 do begin% `. B8 K E5 z' E* s
travel to pickaisle.con(A_i)
$ b9 x$ g4 V- [. | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ |8 ~ {% U' Q( L- m7 p3 I else wait for 10 sec8 V* m) f3 D9 S0 C7 y. S3 O
if A_i=A_leave then send to die
2 x# ~7 O( H1 j) V. W( i+ H ] else inc A_i by 1
7 R9 _2 s' e7 q1 E# a end$ t* I, W( T! ]5 B5 e5 C
end
& [. `& c# G+ r& h2 @* H- v7 {0 B, l
/ ]% E4 v0 g- Rbegin P_pick3 arriving
5 P3 e& F& ^: Y6 o. U v set A_i to 21) Y7 H$ r& O! f5 w% P+ b9 I/ X
move into Q_induct3& @1 O2 o% `, G* Y; v" _; l
move into pickaisle.induct3
- P& d2 [, z; G# V" L2 U4 h while A_i<=30 do begin5 i& V, C% _* {3 x
travel to pickaisle.con(A_i)6 L5 O) |+ H' S! I+ x2 k& H: \: q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. _ G' f) p, A5 J. [ else wait for 10 sec8 c7 |6 P+ r9 S x9 f+ x' h
if A_i=A_leave then send to die
0 g' ~9 B' ]. f# P/ y( f/ a7 z! E; ^ else inc A_i by 1
) K8 V2 s4 d, T! Z- |4 l end$ T& v" s2 ]( X, f- f4 U& b2 g
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,其它按你的 ...
|