|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& T+ D5 f9 Q, y) t9 p5 T% N. H
# z! @3 j3 w2 a6 h5 {, v我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 v6 A, \$ K- u0 H
) R5 F7 @/ P# x9 E" D
begin P_read arriving
, V) a; \5 e5 V; f$ I% X while 1=1 do begin1 o5 H7 _. i. x2 s E
read A_tote from "data.txt" with delimiter "\n"
. d P$ `; u j6 X, e' J read A_time from "data.txt" with delimiter "\n"
Z" X7 T( V# R read A_leave from "data.txt" with delimiter "\n"" U# p; ^( @' C. O
read A_picks from "data.txt" with delimiter "\n"
0 }1 S- k! t$ w) Y; Z! ?. ` set load type to A_tote9 `0 F5 i/ J' ]1 f5 G2 u& a, ~
if A_tote="tote 1" then set A_induct to 18 r, o+ ?1 t" P
else if A_tote="tote 2" then set A_induct to 29 Z, ^: H5 g5 a+ J: Y# x- y" f+ ?
else set A_induct to 3 9 m5 L- Z7 X1 c2 e8 {( d
set A_i to 0
8 y9 c/ j/ B" {1 M$ ]* q4 c; }" _ clone 1 load to P_induction
3 q# L8 x; X0 Q* I: o2 h% } wait for A_time sec1 f! ]7 i' E/ T8 |/ S
end
4 v7 ]- t- |$ i) B* p& i8 L7 [end2 Y8 i2 y h- |+ J; i5 E
. L i! Z" Y! L% f% D8 q5 Jbegin P_induction arriving
& Y* T" e0 Z2 S0 k7 }' S" p% l( m if A_induct=1 then clone 1 load to P_pick1" F$ O1 I' l! o) J7 G
else if A_induct=2 then clone 1 load to P_pick2
( g) I2 H5 b" ~: | else clone 1 load to P_pick3: t8 b. ^# v; Y, K8 D
end& Y0 k: S8 z4 f% ~( U
l/ D3 V% V3 \3 Q- g3 f. Ebegin P_pick1 arriving" ]9 q) \8 d6 p; e$ U( w4 t
set A_i to 1
4 X( j5 X4 ]& Q, B$ A move into Q_induct1
& D# {- b0 c6 u" u move into pickaisle.induct1
' ~7 e( B/ z' |; ^ while A_i<=30 do begin
( Q( m4 c& `4 ~, V% s travel to pickaisle.con(A_i)* H' w0 d% k j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 r, W7 R* x' Y6 d) O2 ` else wait for 10 sec9 p7 z3 U) Z, z
if A_i=A_leave then send to die* |: \0 s* u) z6 l, ]: w5 o% B
else inc A_i by 1
/ ]: i$ |0 F4 f% ~& S6 c end6 C8 n. \# C: N' q7 w) L
end
* L$ M( n4 J& \+ n% ^
' ]3 b! A, v9 [/ |/ V' X' sbegin P_pick2 arriving
/ b+ v5 L6 S( Z! K3 P f set A_i to 11
: |. E% `* z" a, |% K# t. \ move into Q_induct2
: f( k2 i' U! a) I- a move into pickaisle.induct2
& n; u! G5 v5 E9 w& i; w while A_i<=30 do begin9 j. }/ _" T' }: T- |, V& r, h
travel to pickaisle.con(A_i)* R1 w( |3 o9 N7 {. L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( l9 p& U9 u' a, D% d [( U% c! Q
else wait for 10 sec. J3 J! m2 a) U* f9 k
if A_i=A_leave then send to die. ?* q9 I- {/ [- ?! [) u: Y
else inc A_i by 1
3 s- S$ N+ s) h/ ^ end
5 r3 h% d" l% g* j" I- G. R7 l+ Rend0 K- g- F4 m; O1 q& @9 \
* X3 [* ]& s T/ A/ ~3 J9 s+ ]begin P_pick3 arriving. e' O M/ O) i/ n1 p( n w
set A_i to 21
. A' \$ ~) I7 `8 L k move into Q_induct3
$ ~+ D9 O% o1 M1 {" s6 b move into pickaisle.induct3- o: u o* o) a
while A_i<=30 do begin& i% p, e7 [& Q
travel to pickaisle.con(A_i)8 `" I& J5 u9 H! A/ S9 [1 Y% X+ S! `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 i( W( N0 l% g$ |3 z) L! Q. o. X else wait for 10 sec! B9 V# F B- n* N8 i2 X9 l' F
if A_i=A_leave then send to die
% A0 s' y# Q: T: u4 P else inc A_i by 12 c; X6 m& ? |0 m8 i' b6 K
end
/ V- K) e% Q# ?: b% cend |
最佳答案
查看完整内容
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,其它按你的 ...
|