|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' w" ?% P# W! f' ~/ } ^' J1 }9 q6 M" N. f6 J v7 v/ J
我的问题是,在每个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 h4 L* ~4 I4 e) ^0 R# k/ N! [
begin P_read arriving8 A4 U# H0 T4 l1 o8 I
while 1=1 do begin
( _: @, M; f! |" N read A_tote from "data.txt" with delimiter "\n"7 t. }6 \6 P. i
read A_time from "data.txt" with delimiter "\n"
: Y/ r+ I) Z* b+ d+ v. W) u read A_leave from "data.txt" with delimiter "\n", S# {3 C% c. @ F+ m1 L( |
read A_picks from "data.txt" with delimiter "\n"( d$ _# d& D: ^! U
set load type to A_tote
6 T3 {, I& X+ D; C6 S if A_tote="tote 1" then set A_induct to 10 S6 p" A5 H9 w+ T! M
else if A_tote="tote 2" then set A_induct to 2
/ }- c( g0 J" _2 K else set A_induct to 3
0 O" b* i) [1 y+ i7 w set A_i to 0
$ ]( G3 C8 z- h2 n clone 1 load to P_induction8 P( U! K& [! P8 r% K
wait for A_time sec1 n8 z. S& \& @
end
% ]2 I, b! C% E" @end
. }1 O1 Y+ w. h: S) y) v7 _" H4 c
begin P_induction arriving. ?+ B& ?) v7 V f
if A_induct=1 then clone 1 load to P_pick1
4 c; ]. y- j: \' D else if A_induct=2 then clone 1 load to P_pick2
; P I3 S% s) ^) ] else clone 1 load to P_pick3
- a+ {; | t8 V* |end
5 o" f" [( D% G& N l% Y, v9 s- Y2 E
* x9 d$ K- i4 U# I0 b: Obegin P_pick1 arriving
0 V' I! L" e+ F: u) e: ?, x set A_i to 15 Z' C8 c: F5 [7 h, k* a
move into Q_induct1- S! `/ N6 d: S! P; [! T
move into pickaisle.induct1
* H! E! x1 y- Z. g- I0 w4 Y while A_i<=30 do begin% o0 o: }6 y2 b8 E7 ?
travel to pickaisle.con(A_i)
7 b O* p8 g9 |0 Y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 `) I, d u+ L$ l" S/ w$ L y X
else wait for 10 sec$ w8 g2 T7 Z7 C8 X/ x3 \
if A_i=A_leave then send to die
% r' t% I9 |% q else inc A_i by 1$ X; b- [# v. c
end, p! ?6 \; @ \! O3 t; L
end
9 g/ u7 z: L( u2 `) W! J$ b- R) [4 Q* [1 {! A% c7 R
begin P_pick2 arriving
3 v) M6 |$ s* u& O! u; p' f set A_i to 11
$ c+ c, g5 S! r: |: f2 U1 Z* f move into Q_induct2
8 p& @/ N" J$ \, ^ move into pickaisle.induct25 q: v2 r) W, t9 N: d$ _0 V9 F
while A_i<=30 do begin
1 n: L2 \; y. r; z0 v- U# k travel to pickaisle.con(A_i)1 J0 Z, T& s% N6 Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 p/ f$ U* Q& h; E& _; ~# G else wait for 10 sec( {4 m d( Y* i% s( ?
if A_i=A_leave then send to die
6 V' O& t( U5 o& F( J else inc A_i by 1& b7 J6 q: @2 j6 F' _
end- C+ r R0 S) i6 Y4 P) \
end x* b9 y' u; s& |! M5 M; ? x
5 y$ O1 L5 g9 r" A8 D9 Bbegin P_pick3 arriving
& g4 h! j; L7 r i& q set A_i to 21
" H- d8 x! `0 x/ W' h2 c7 g v move into Q_induct3- m& k! X% k! o* T
move into pickaisle.induct32 y: q& {- S! n$ J8 c. H
while A_i<=30 do begin' m) n2 {2 O9 J; R& ]$ }( \
travel to pickaisle.con(A_i)6 u6 B9 q# ^9 A @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 F& M6 y# m) A1 a7 { else wait for 10 sec
% ^6 h" o" r R. o if A_i=A_leave then send to die
( T \( `) d2 ^, u* B# z0 W: n* i7 Y( N else inc A_i by 19 J) n% C5 X9 R
end
9 M! g, Q4 U/ q2 Pend |
最佳答案
查看完整内容
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,其它按你的 ...
|