|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 I* V. d* j" r2 b" }
s5 R9 c& Y9 f" u9 x# ]. 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中的数值,不知道会不会有什么不妥。
& u8 y; }5 s4 i* c" N9 B* I
. Q! e7 V* ~7 z" ebegin P_read arriving+ q- T+ k$ ]0 W" r% f. g
while 1=1 do begin# p7 |' k" F, [# k0 _
read A_tote from "data.txt" with delimiter "\n". n! c! j# }+ {- ~5 K1 w5 Q
read A_time from "data.txt" with delimiter "\n"
2 K) H0 g1 g b% @, h read A_leave from "data.txt" with delimiter "\n". v* K8 o }9 V% t( ~8 V; y) l
read A_picks from "data.txt" with delimiter "\n". d2 A0 z( | T
set load type to A_tote+ K" K5 u l5 S+ c" j
if A_tote="tote 1" then set A_induct to 1- p) P* {- M4 }/ N% v2 V! R
else if A_tote="tote 2" then set A_induct to 29 j1 O- O* C6 f% P- h
else set A_induct to 3
$ n8 U1 z0 D5 p set A_i to 06 u% y: o5 b5 f' U5 ` R
clone 1 load to P_induction" Q, H+ m( s8 G$ p9 A# @7 }
wait for A_time sec4 a7 k d; `3 F
end
9 S6 y: J$ Q" M& Q' vend
& G+ t* l" E, g& |8 Z, R4 c1 ^7 N" F$ o a
begin P_induction arriving
|1 w. `1 F" B7 m if A_induct=1 then clone 1 load to P_pick1
& k3 N( o3 F! Z& F! r1 T! ^6 ? else if A_induct=2 then clone 1 load to P_pick2* A( s& F: ]/ {. O
else clone 1 load to P_pick3/ f* @. J& u8 N7 `, _- g7 M) [, z# g, k
end5 s; ]7 R8 m$ T5 ^) H8 l: \
6 \, F, V ] b5 c; o- e, f, ibegin P_pick1 arriving) q2 H8 k! \6 P" O* k9 b/ L6 N3 _
set A_i to 10 z, Z3 D" o1 \) u$ H
move into Q_induct13 \/ G6 t7 A0 D
move into pickaisle.induct13 S" D9 ]; P5 v" ~# {
while A_i<=30 do begin' o- m, G( X [8 |8 H* H( [+ U
travel to pickaisle.con(A_i)* a4 X" E7 |; g! u" j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ]2 `/ u: n- X. I' M& w" V
else wait for 10 sec" e, Z- q q+ O
if A_i=A_leave then send to die
6 g o- r! S$ V! D& H else inc A_i by 1
2 m, M( S- @+ Z end6 j! N4 y F/ }. d6 F
end% V% Z6 p! C' B' U: Q# l3 G- K
0 j3 ]# v5 B" j2 N5 Q; v4 l5 N
begin P_pick2 arriving
/ n; V! O$ V2 m set A_i to 11. \9 \0 L5 c4 |: I$ E
move into Q_induct2
1 u! R! q, L. z1 i0 B0 y' o8 r( Y move into pickaisle.induct2) G' q3 u4 L8 ?$ |: u# b
while A_i<=30 do begin$ |$ S1 Q$ a4 Q3 O
travel to pickaisle.con(A_i)3 H4 _9 i3 [) G3 `( L4 A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 R8 P( n9 ]4 N7 f# R: _
else wait for 10 sec
. Z1 Q- E$ w7 r; u& p if A_i=A_leave then send to die# p A+ F! Z2 \( S
else inc A_i by 10 y4 O! m: y. I4 N7 v+ J
end
/ ^, l6 ]: ?, V) l" ^; pend
[7 | y$ U, ~' F6 a9 w6 E' g) m5 F: o: |" O1 y
begin P_pick3 arriving6 p9 K \; M6 ^# L
set A_i to 21: a p1 ~1 {' k1 c
move into Q_induct35 _* j9 h8 H, n8 {
move into pickaisle.induct3
5 b7 M0 ?& w% E4 y' L( H& v while A_i<=30 do begin$ s' h/ \2 g8 k5 v% X# r# c
travel to pickaisle.con(A_i)
9 y- L7 p* S. R) u' H M! a& _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; B }# q0 p8 [3 j
else wait for 10 sec
4 X9 _- G/ c! u% K3 R$ e i if A_i=A_leave then send to die8 D: b. Q# O% u5 V! E
else inc A_i by 1
. n0 B6 ^5 L) r1 g7 s ` end6 v9 T& T; W# o% C/ |( T: 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,其它按你的 ...
|