|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, ]9 I/ O" Y- J, P+ X$ z: t0 [- i2 t
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. ?' ]7 y4 L5 R3 I* P& X, L) i: P: w. b, y6 g
begin P_read arriving" }5 @* l# I: `
while 1=1 do begin* B7 A# s0 b8 z
read A_tote from "data.txt" with delimiter "\n"7 Q8 d I! |) }: Z6 x4 i
read A_time from "data.txt" with delimiter "\n"7 |9 d9 s$ j* b4 X* [, o( P2 L
read A_leave from "data.txt" with delimiter "\n"
5 D$ A% Q' Z2 ^0 ?8 b/ q- I read A_picks from "data.txt" with delimiter "\n"
6 F8 p- K: R7 p9 R set load type to A_tote2 L2 Z' F, `* W+ p1 g. R
if A_tote="tote 1" then set A_induct to 1/ o8 O |* @- g' m: [
else if A_tote="tote 2" then set A_induct to 2
& @. s' ~5 |- _0 ?, M2 D else set A_induct to 3
8 R& A% g1 F1 U) s; d set A_i to 0
+ B* y, o$ p! h: i4 b9 f6 K% h/ M0 n clone 1 load to P_induction
; \ |' |; ?" S/ B, O! e3 r/ [ wait for A_time sec
7 d. d) D2 h: M" K; S& U end
1 A) a' _6 @) }4 \8 D3 Q( ]9 Dend2 Z9 f5 U9 K/ c8 |# ?
, r- f) ?/ N: ?- J- O: F/ O! U: Xbegin P_induction arriving
1 \2 \% O6 d" O' L9 g9 E+ y if A_induct=1 then clone 1 load to P_pick1
' z& a3 @2 L- y p: Z5 B# r; w: }; W else if A_induct=2 then clone 1 load to P_pick2
' Z* D* A# w7 ]/ s else clone 1 load to P_pick3 C) b) {& P- E; ]6 M
end! B: [2 Q' \2 P' J. Z
7 |. u- n0 {7 X6 b" k, `! l
begin P_pick1 arriving T1 w& [0 T0 L R. U' }
set A_i to 14 w: ~4 `( e9 C( D8 m
move into Q_induct1' P) H0 \: M. t& o8 I# {
move into pickaisle.induct1
! f7 |. X4 l/ {, f6 ^, } while A_i<=30 do begin
+ y6 ]5 P+ k4 K; X" l$ Q7 A5 `% x travel to pickaisle.con(A_i)
$ L9 v0 r" x/ s/ b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% H7 k+ h! T- V! g/ o
else wait for 10 sec
, n0 b2 P# n9 F. h s- @- v. p. q0 ? if A_i=A_leave then send to die- q7 G: B5 s" X7 d2 c
else inc A_i by 10 s7 `9 }# [3 d }6 ?+ {9 e$ a* @
end. f5 [$ E0 p8 M/ ^: `) k. b7 W
end
4 F7 k5 X- f/ @4 V
, D" R y9 p Q4 k) ]begin P_pick2 arriving, U# u4 s r* B/ \% ?# {8 B5 M- z9 x
set A_i to 11" t6 r, H; Q `
move into Q_induct2
3 P) N0 k4 v! j6 s$ c move into pickaisle.induct2
- d5 V6 ~7 y0 N/ E: m; q: ~ while A_i<=30 do begin3 l/ Y( m6 `0 C' j0 z6 q% S$ I
travel to pickaisle.con(A_i)
& e0 J! W8 V- i3 D9 r: Y* D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; d# j# d+ Q8 u k. T7 y
else wait for 10 sec. }. A" L1 S' b: {/ a8 b
if A_i=A_leave then send to die* t& i; M% @" z& i8 x$ X% }5 i
else inc A_i by 1
. n I, N( k5 I+ B9 r end
6 S& H0 \; K6 E4 T& Hend1 u, x% ]+ h' x
! ?5 J& J' }, o8 C% A% q
begin P_pick3 arriving
! ?' ]7 C7 E5 Y& L& g0 c6 F set A_i to 21
6 [! ]7 T% \; E; _' T move into Q_induct3
/ x% n/ s5 j! t; x7 H, V1 c move into pickaisle.induct3
& ~% ?/ \6 T% F- d `! h5 J while A_i<=30 do begin
$ P) {" F5 p/ M+ U' h7 O, n& r travel to pickaisle.con(A_i)
1 t! L4 g4 l9 F+ H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, d3 H8 q/ F9 p. D l3 I
else wait for 10 sec) m- `1 o; }8 X
if A_i=A_leave then send to die
0 j$ a% m+ R1 a" u" H2 O5 B2 ~+ ^ ? else inc A_i by 1# w" k! w& s8 i6 e; b; T
end
4 y! y* W& c5 e! qend |
最佳答案
查看完整内容
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,其它按你的 ...
|