|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: H3 n& k% d+ f- H
* q7 g7 D7 ?6 K0 z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# \6 S8 f& E' U( t' O, v1 I: `2 m: Q" f9 J9 e. F0 g R- I
begin P_read arriving
4 k: U2 |% y h while 1=1 do begin4 A/ k8 ~# p Z1 O" x' t
read A_tote from "data.txt" with delimiter "\n"
5 T, S, [$ E9 K# @ read A_time from "data.txt" with delimiter "\n"
8 |: w U/ z: H; f read A_leave from "data.txt" with delimiter "\n"
7 s: C* r# [* l6 J4 e; _# @ read A_picks from "data.txt" with delimiter "\n"1 S7 J% t3 i: o( z( K& A8 a
set load type to A_tote( |8 D3 Z; ^+ c- U- u W( V
if A_tote="tote 1" then set A_induct to 14 G; o1 I& e% L& `, D4 [
else if A_tote="tote 2" then set A_induct to 2- Q5 G+ G F7 A- B' p
else set A_induct to 3 / t% i% t+ i& X* L6 Q# K6 m
set A_i to 0
& L: X" Y0 E/ c. g( R2 | clone 1 load to P_induction t* `; ] c3 K! O0 F
wait for A_time sec
4 |% |/ I/ f6 d5 A' _4 Z# j end4 W$ t, \: @0 j. p8 }
end* f2 o: O! r2 g& |
3 e9 a T& b& w1 u8 H3 @9 l# Hbegin P_induction arriving
. H& s3 l* _( k! Z8 G$ @ if A_induct=1 then clone 1 load to P_pick1
) w2 L# o; l& Z5 E else if A_induct=2 then clone 1 load to P_pick2
$ K1 { Y/ Y. y. A& Y else clone 1 load to P_pick3
' O( Y8 _2 [" G4 n) }3 ~end7 f$ S% z! c B* T( P0 O4 Z$ T6 e# {$ b
- V9 |8 y- ^$ Bbegin P_pick1 arriving$ m7 U, n, V5 ~' u6 ~+ Y
set A_i to 17 R% H4 y! w% e! |, [: x, n/ w
move into Q_induct1 V; @/ ~7 K6 n6 Z- H, d. Z) W
move into pickaisle.induct1
+ v# z4 h: n9 F# i' ~- Z while A_i<=30 do begin
/ D: D2 h% G% C: ^ travel to pickaisle.con(A_i)
. g" e a# Y$ p% ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. J7 v% f8 w. v3 \: [: i else wait for 10 sec/ ^# W. s/ s1 b) u9 V$ A9 V
if A_i=A_leave then send to die
" V7 x! r9 e# B$ N else inc A_i by 15 _- y2 d" c+ j0 w1 i8 S. w# i
end( S; ]3 j4 ]8 Q( z! g- Q9 f; N
end
8 m% q( A4 ^! \- {1 i6 q
) O$ v8 L8 k) M' V4 |/ Vbegin P_pick2 arriving
g1 j' {/ V) P3 @; K, l set A_i to 11
7 _4 ?' j3 W; [8 w move into Q_induct2
! d" ~) C6 B+ E/ Y/ E' s8 } move into pickaisle.induct28 }+ N8 }3 g4 ]
while A_i<=30 do begin" }1 p7 |2 Y; h& @0 F6 y9 w+ F/ W
travel to pickaisle.con(A_i)
7 v6 B9 Y0 b5 W4 m' S/ `* N t# y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 x$ s# y1 l2 T# H5 i/ K: `
else wait for 10 sec5 z& R+ b( }+ Y0 h9 @% a5 O
if A_i=A_leave then send to die
. @/ {9 b! v; H else inc A_i by 1
9 j3 P. i. l/ f3 F& q% P ]; ]2 \ end. {3 G+ q& v& ?- ~ [) Z1 [3 E
end
3 G% W2 e9 a$ M2 ?" i. W/ @
8 b A1 J1 J, L! J- c) ^9 Hbegin P_pick3 arriving7 F2 a E2 a4 G8 \
set A_i to 213 p- M# b; {0 @9 y6 f. N
move into Q_induct3' { H0 q) h/ b( v
move into pickaisle.induct3
, J' K% h/ o5 @+ U while A_i<=30 do begin
/ L( Y4 r* ?$ x0 _) J9 v) U: Y travel to pickaisle.con(A_i)
v0 A* d6 J! p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 u% d7 t6 V1 U* F: S4 y else wait for 10 sec
4 Q. Z j) N8 X7 C% y if A_i=A_leave then send to die
$ s2 g' Z: c3 h! F, b; P else inc A_i by 1
$ X& W2 B9 I: ?3 I! a end U3 j L1 B! G) l
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,其它按你的 ...
|