|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% j& [: B$ e+ F* z1 Q2 I) R# j, l$ i* y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. F$ D; N- P4 \9 z$ ^8 ~1 A& P* m3 {, e9 C: |
begin P_read arriving+ w4 c" s' W5 y% Z- K% U- X
while 1=1 do begin
9 M0 G0 w0 W; d$ B! R6 M F7 ] read A_tote from "data.txt" with delimiter "\n"7 P/ W, L- X, o
read A_time from "data.txt" with delimiter "\n"
( F) q# i* W/ T3 W read A_leave from "data.txt" with delimiter "\n"$ w, D4 g A0 f) j* R
read A_picks from "data.txt" with delimiter "\n"
+ ~1 n" i* ^% C3 ~, _ set load type to A_tote* {1 d/ J8 M; e4 }7 m2 d L
if A_tote="tote 1" then set A_induct to 13 o' E7 m' ]; o* m n: _
else if A_tote="tote 2" then set A_induct to 25 |2 J7 w) e) N
else set A_induct to 3 % n2 y$ B- u8 Q/ q
set A_i to 01 p }* P; t8 m+ C
clone 1 load to P_induction# H; V z; O2 @& R2 x. M% d
wait for A_time sec
& F- n$ {. c9 t1 d end
' W# E" p% u. x1 V& H) g- \1 Rend
+ [5 b2 ?0 R% V) |$ s$ s. e* a. }7 _1 n6 Z1 ~
begin P_induction arriving
$ v! o+ H# |: u9 O7 ~7 d1 K if A_induct=1 then clone 1 load to P_pick1
" {9 ], [) |4 I& ] else if A_induct=2 then clone 1 load to P_pick2
% q% Y% k7 b3 ]) a: A* }& g else clone 1 load to P_pick3/ P% |* ]4 a: O' W1 C1 X+ `. [! w
end/ F& V3 B L8 J4 |! X1 V. {
4 K3 D3 x: t0 p* q6 A1 O) K; n
begin P_pick1 arriving6 G' S" j! U& z+ z9 H" P7 T
set A_i to 1
3 P/ @+ ] O ~$ Q move into Q_induct1% _- V" J; M, w% F& T& G
move into pickaisle.induct1
1 [% l5 Q! l2 I9 T0 w' p while A_i<=30 do begin+ y6 Q( Z W, {' @9 x) [
travel to pickaisle.con(A_i)
. |: v5 L b& m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" H' x% k& T1 ]/ f9 k- H* K: N
else wait for 10 sec/ W: ^; Z* v, R$ O; [7 ?
if A_i=A_leave then send to die* b: D2 o" v. `, O1 v: E6 |
else inc A_i by 1% G$ I" [5 r& m' [. s; t
end
* q# S3 f: _6 A- R! Pend
9 X( _( P! Y5 s8 }0 d# y- d2 l- S% \9 t# `' G4 d) G' z& U; ]
begin P_pick2 arriving4 b9 l* g8 ?, C" W) C! j9 x
set A_i to 112 g% K8 |/ H3 T. Y# |: O
move into Q_induct2' \7 Y) O3 K& H0 Q. d
move into pickaisle.induct2) U6 A: o' U* N
while A_i<=30 do begin6 X& D" j: @/ N3 v) C' n4 K' x
travel to pickaisle.con(A_i)
. F u, H: d" B, }3 t4 o1 A+ k0 B if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) o" U; v! H, s( g else wait for 10 sec# N3 Q* V) t8 c* j* \. i1 E: u- C
if A_i=A_leave then send to die
- t; S. C+ {& q3 G* ?1 Y else inc A_i by 1
9 l5 x. g- f/ @ L5 t end1 T- ]4 E/ l1 S
end A2 C* Q6 {3 |) ?3 J1 l9 x5 X
9 [5 [$ O2 O; Z, ~8 d. f/ \
begin P_pick3 arriving
% k, K3 R- q5 W+ {0 F, o set A_i to 211 L% }$ d* H' ^
move into Q_induct3
0 |5 o+ W0 p4 s move into pickaisle.induct3! Q. ]3 H% Y( d( J8 L- W/ v3 E3 m
while A_i<=30 do begin
) {+ I& M. K8 l8 E3 G0 n$ U travel to pickaisle.con(A_i)6 q5 c1 q* ^2 @3 u2 h' D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec c, c! h4 l+ b4 g5 k5 _/ E$ {6 T+ u% E
else wait for 10 sec
% Y" D# {9 G( N* B8 C; K if A_i=A_leave then send to die: U, Y- ~% a# A% F e
else inc A_i by 1
. G2 g p: P9 x$ h- I7 P end# E$ u Z1 C9 ~5 H; q$ M
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,其它按你的 ...
|