|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ l7 F ]' \# r- ?. X. Z
* N1 ~5 m Y8 L+ b9 G1 u
我的问题是,在每个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 J+ [0 q; t4 ^+ F; v' ~4 o
+ c* e2 }2 D- ^" {( `3 G
begin P_read arriving {" S9 b8 e5 S+ W! N4 I
while 1=1 do begin8 ]& z' ]7 _" P% ? ]& x$ g: x
read A_tote from "data.txt" with delimiter "\n"; C, Y" l5 C0 y, z* l
read A_time from "data.txt" with delimiter "\n": h8 ^, G% X: f9 X9 B
read A_leave from "data.txt" with delimiter "\n"
k. d2 q$ e4 S, `) b7 | read A_picks from "data.txt" with delimiter "\n"1 c* [! W$ `6 N0 u
set load type to A_tote
+ q+ v2 V# Y0 ]* b y# t a7 w if A_tote="tote 1" then set A_induct to 13 n! ]3 Y' E3 t
else if A_tote="tote 2" then set A_induct to 20 o" s1 M9 m* ~0 v& Z2 J0 D7 F
else set A_induct to 3 , B2 D3 ^* T. C R4 T, _9 X
set A_i to 0
: h" |1 C$ Z, N clone 1 load to P_induction
^% U# p: |9 k% M wait for A_time sec/ a) J! A9 S7 n% Y6 {9 f7 W& v3 [4 m
end
6 r" n; f. K" I" j. {end) m8 b8 Y# C2 c! o
4 P5 y N8 p( C; v- y
begin P_induction arriving4 C( A" _, [7 l
if A_induct=1 then clone 1 load to P_pick15 `2 ~) [' i3 U% E8 d3 Q
else if A_induct=2 then clone 1 load to P_pick23 }) A. ~. c: Y( x# U; A
else clone 1 load to P_pick3
# ~3 r- a5 N X9 @& q( k& Yend7 g8 C3 R( w: o
; k% \/ x* n4 E" ~: s [, Obegin P_pick1 arriving; [' \ U7 {- ?" ]8 F( l, b
set A_i to 1
' e" T" A% \! T8 B! k$ g move into Q_induct1% X, t5 ?; B. ]- F4 z4 l
move into pickaisle.induct1 T( ?0 i0 ^3 a# \, { p4 X/ ]
while A_i<=30 do begin, p( W' _; J% |$ i+ @% I3 a
travel to pickaisle.con(A_i)% T% s Y$ U3 g! |7 o
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ h* d% `, m3 [" M6 T, y else wait for 10 sec `* |6 D" f- ?' w. _3 `
if A_i=A_leave then send to die u; T, H1 X: s$ A' A
else inc A_i by 1
' `! o' n- \6 `( K9 f3 z end
8 L' G" P0 a; z6 I- W1 c) zend9 E& n6 j# I! P: E+ F! S: Y
. {6 d8 w0 j$ i4 X xbegin P_pick2 arriving
, f0 F& T$ {) H" F. ?# H1 P set A_i to 110 w7 i! O) m# R" V6 W
move into Q_induct2, T! c: Z" I% n7 \( V% K
move into pickaisle.induct2% V; `& V/ ]0 A" P: H9 p* [* _% J6 Q
while A_i<=30 do begin
% h! [( t+ n8 D. o4 p) B1 C travel to pickaisle.con(A_i)
6 {0 n; i5 A8 O% i/ Y& [$ v: H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 g/ s0 U4 }. z. ]$ h% K7 c/ [- V
else wait for 10 sec3 {+ A/ C9 l( s- N
if A_i=A_leave then send to die9 {" q) `. ]+ z9 v$ P4 \
else inc A_i by 1
+ n" Z9 n, \. } end) ]+ s8 A' E. l3 E- ~3 h. F
end. _9 s/ z' d4 A
, K* c9 g. T3 q' h3 V5 q: ubegin P_pick3 arriving
( r" a4 O9 l L- S set A_i to 21. ?; E2 Z- x+ `4 ^1 _2 k: n! U
move into Q_induct31 H$ [) X) X3 t H$ o
move into pickaisle.induct3
) @+ X8 G: b. Y" l9 S while A_i<=30 do begin: f2 P5 D# Z$ D- Z1 b
travel to pickaisle.con(A_i)* X& ~9 e% M) C3 ^9 t. n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( C2 W* }8 @! G: a; D- }* K
else wait for 10 sec
8 G8 u* v7 A4 Y* Y if A_i=A_leave then send to die
* j4 s, ~5 r R' Q) v1 a else inc A_i by 1; u" Y( ] F0 v+ w
end# F. V1 e( w* L, u
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,其它按你的 ...
|