|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* d" l7 J7 _. P4 b/ O/ Y$ U. @
) d) I" j, ]- h7 H7 g% r @+ _$ 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中的数值,不知道会不会有什么不妥。
* z2 K1 v2 U0 l( U" c2 P$ n0 f; d7 b4 g
begin P_read arriving9 M0 S, n6 d0 N
while 1=1 do begin
* _, G5 \3 |5 K, b2 w2 A# x6 e read A_tote from "data.txt" with delimiter "\n"
1 q% ^4 W4 I% ] read A_time from "data.txt" with delimiter "\n"( b4 S$ R. a6 [( o, G, A
read A_leave from "data.txt" with delimiter "\n"1 F, [. P7 l5 J5 W R- \5 m
read A_picks from "data.txt" with delimiter "\n"3 a ?& q' Z5 W) V* J) }
set load type to A_tote
- [) D- q# {; T/ I7 H# y' W if A_tote="tote 1" then set A_induct to 11 s1 I6 H4 O% n) k; x& l/ }
else if A_tote="tote 2" then set A_induct to 2
* Q% a. D" L# Z8 B else set A_induct to 3
+ Y" v2 M/ ^: W5 S set A_i to 0! J x5 m& j6 N$ ]
clone 1 load to P_induction) a1 E% G: S' f5 Y+ L; {) ~
wait for A_time sec
* t+ V: u( ~. A, s end
8 l% E- H& a4 U' R) ^6 Hend7 g# o' r# E, ~& p% d* y! ^
% R0 d1 H/ L1 F; }; S4 U9 G wbegin P_induction arriving. \. B3 E8 z5 z# @! @( K
if A_induct=1 then clone 1 load to P_pick1
: Z$ S; c- b9 r! A3 o7 x+ | else if A_induct=2 then clone 1 load to P_pick2" B& F E" [* I: b' j
else clone 1 load to P_pick3
! Z! G2 q2 z; E" Y3 J3 Iend
' Y# y' G7 d1 z$ i1 R3 {
8 m9 G U: ~$ R- T" g6 F7 y& qbegin P_pick1 arriving& }9 @ v% b) X8 e
set A_i to 1; B6 z& n/ l5 j( _
move into Q_induct1" i- y) S: c$ x2 X
move into pickaisle.induct1
" N( c2 T0 F9 ]. h; ^ while A_i<=30 do begin; _+ l3 ]' X$ h) Y" E' p* B a
travel to pickaisle.con(A_i)
! u- T' s5 t) b( r; f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& i7 e2 T L2 ~) r7 J: i$ k else wait for 10 sec
8 m9 r9 S X! A: f0 z# Z- V if A_i=A_leave then send to die1 O& N. ~' k( r, ]; A4 j% h) ~& Y9 ~; X
else inc A_i by 1; i, O# w# S0 i8 {3 q9 F
end
0 t" G6 S. D) H- \# c( Mend1 e, L3 c+ m @+ {/ U6 I( o
" T8 T! b, ]4 S7 D
begin P_pick2 arriving
0 D7 {4 v5 R7 ^) @ set A_i to 11
- J2 _2 U/ P' |4 A; i move into Q_induct2
4 X e5 f; Y- }! A r$ i move into pickaisle.induct2
. l1 u# _7 x) L! g4 J: |( @, r while A_i<=30 do begin6 m8 ^0 J$ T; s8 ~* A& l2 I% a
travel to pickaisle.con(A_i)2 l4 w' ^* z' Y$ e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' M+ ~/ C% m! ~ v else wait for 10 sec
9 |' z, ]$ X- F( e. W9 t. v if A_i=A_leave then send to die
0 I8 K! i) G Q* H/ T+ e+ G8 ]' Q else inc A_i by 1
- `9 B' z) P3 H) E, ` end5 U3 e. |2 p- R$ c7 a+ ?
end8 l ], S7 ^4 m V
& ?/ O( A" z! A4 z) R" l* T
begin P_pick3 arriving5 s5 E% x- G$ I; R9 ?
set A_i to 21
/ e5 m* X1 u5 V% Z' ~0 W/ B move into Q_induct3: _5 b% l s7 [0 r ~: S* o3 K6 k
move into pickaisle.induct3
( F; G" ?. V! K, {* F while A_i<=30 do begin, m' U5 n. c, i/ ~2 Y) N6 s
travel to pickaisle.con(A_i)& C+ L* }: Q x* r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 N4 E4 ?1 K. ^
else wait for 10 sec! _' |: Q d# ^. P- j6 ~
if A_i=A_leave then send to die0 g$ l# y( l! M
else inc A_i by 1
; d! |0 g1 t" B Z; `& d5 G end
9 x8 ?6 f+ ]/ F7 t1 Jend |
最佳答案
查看完整内容
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,其它按你的 ...
|