|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' W/ k/ @ f9 S/ b2 O
Q X5 A# v L& u" f我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! Y T. |; d- |% N" i7 `
* I. n* l( d) Hbegin P_read arriving
1 k1 @" J* |$ j) d! y$ V while 1=1 do begin6 P3 d: U/ k5 O- ^
read A_tote from "data.txt" with delimiter "\n"7 w! o( O" L$ t
read A_time from "data.txt" with delimiter "\n"
* U S* f) X _ read A_leave from "data.txt" with delimiter "\n"
- O( u( F, W, ~5 z read A_picks from "data.txt" with delimiter "\n"* R5 i* g- H. l4 A$ o' b' {
set load type to A_tote$ W! E* ?& ?3 B$ z0 b
if A_tote="tote 1" then set A_induct to 1
! n+ T: @$ a9 A* i m else if A_tote="tote 2" then set A_induct to 2. a0 i( s+ z8 y' U3 n9 A
else set A_induct to 3
% n j4 y( p( l4 y- D8 |: s4 U$ j( _ set A_i to 05 w, \6 Z" m; m: _1 b$ e6 M
clone 1 load to P_induction
6 i0 z: ^/ c( ] wait for A_time sec& R! e3 E8 }8 h* P; ?% f5 Z3 T
end! y- e0 E7 Z1 P6 \+ o
end0 Y3 t9 @- |9 _) w/ G, J2 R
9 i l( h# [" L H/ pbegin P_induction arriving
( v1 B# f: ^! Z2 I5 J1 k if A_induct=1 then clone 1 load to P_pick1
5 }- z) r* a' t! b0 M' Q else if A_induct=2 then clone 1 load to P_pick2
# K. s: n" |* f! @9 L- z# { else clone 1 load to P_pick3
8 }$ E# B* H& [4 lend
/ b5 r0 w$ H) I1 @/ W: @# b% l& | Q8 W& G# ^1 X& i$ v
begin P_pick1 arriving
8 {. V, Z0 E$ f3 X* P5 r" i set A_i to 19 c8 p7 e! R( `
move into Q_induct1
7 ]7 x: T8 E" J9 ~+ o move into pickaisle.induct1
6 t% `' L! X; q- j) T+ O- m- [) d8 ~6 Z while A_i<=30 do begin) p. v0 [, O5 o7 L
travel to pickaisle.con(A_i)7 v1 {8 d9 R' H Z4 _ O1 Q7 Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 _! x: [1 f+ L# g5 f6 N% v! X
else wait for 10 sec. m- A5 X0 o- a
if A_i=A_leave then send to die% c5 F% U U# P6 I
else inc A_i by 1: Y& j0 [0 u9 u8 \) G8 H4 L
end
Y; u" D5 ^' K) U( Y( \# Iend0 N9 b0 c+ A6 U0 ^
& d9 Q) f+ {) Z# h! I' m% Obegin P_pick2 arriving* N7 A# `3 k4 o" Q: B7 v
set A_i to 11- d U. A. j0 j6 ?) L& K: U# t
move into Q_induct2& l4 \% i- O( O
move into pickaisle.induct2
9 O; y5 Z7 m7 I8 ]) x" T while A_i<=30 do begin9 p9 R+ |$ }6 \9 I1 Q S
travel to pickaisle.con(A_i)
# Z9 [- ~: t/ d( n6 w if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 U3 H0 s0 D6 Q7 b0 b: U. l
else wait for 10 sec
+ _9 v/ B+ v6 _2 ? if A_i=A_leave then send to die
& G) f5 C+ q5 A/ r! Z B5 a else inc A_i by 1
* I* G1 r; H. p+ }2 z S end0 Z' U( t1 p: X. n1 v
end1 J# t) b* r+ f' L7 U# z& W
" `/ \% V! Q! y3 C; J: V3 [: tbegin P_pick3 arriving/ O& g+ S$ [% q% D8 v L7 A, m: Z! t
set A_i to 21
) o$ I* l* E' D3 f" | move into Q_induct31 L7 j9 [# S9 u) X3 z5 T
move into pickaisle.induct3$ K" s* B5 z+ n! j
while A_i<=30 do begin
2 @6 `" l# t$ R1 F n/ e travel to pickaisle.con(A_i)
! \ R) Z( j3 b% s if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. B9 Q# b U3 V6 V/ R3 ^ else wait for 10 sec
& h* y1 P# [ D" ^& f& U8 ~9 I4 M if A_i=A_leave then send to die
$ w( D( l) R W8 h3 V$ [ else inc A_i by 1
; |" W" v i% j) Z p end
0 D3 C! `8 M4 P4 Nend |
最佳答案
查看完整内容
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,其它按你的 ...
|