|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' ^ [' [4 D9 x) c3 n& e1 o$ h p) B2 l T: {: a: p
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& K5 {( j- Q/ Q
{3 e- V# U. Ubegin P_read arriving: I0 H) B4 S6 L! f. Y J9 C
while 1=1 do begin) j' ]3 j4 s7 W# s: e- r7 w
read A_tote from "data.txt" with delimiter "\n"/ b, u) U1 X( w9 t+ s9 o' _
read A_time from "data.txt" with delimiter "\n"
* m" ]% a+ A1 P4 C Z read A_leave from "data.txt" with delimiter "\n"
9 T& ?$ s; w# {" v! N6 _ read A_picks from "data.txt" with delimiter "\n"
/ j9 z; h) P* Q; K: ~! f set load type to A_tote6 b7 A' F# z5 l w, Q8 v
if A_tote="tote 1" then set A_induct to 1, ^5 u1 a4 Y" l
else if A_tote="tote 2" then set A_induct to 26 v4 F0 q: ?$ N3 i) ^& Z
else set A_induct to 3
; ] y! O' R, k6 l set A_i to 0
+ g( b6 d8 k! h# \ `% X clone 1 load to P_induction, m% C6 ]/ ?9 P- [2 N. O! `
wait for A_time sec0 o* ?7 k8 D6 d6 \+ t
end
9 o3 c7 d/ k8 n) ~7 Fend3 A& c G+ w" N, W% H: K
( }2 ?- E9 c7 pbegin P_induction arriving5 d6 U* f: [( W
if A_induct=1 then clone 1 load to P_pick13 J' a+ O" ]! t& j; F! B, u7 o
else if A_induct=2 then clone 1 load to P_pick2
5 S4 R @- x4 d% t. H else clone 1 load to P_pick3
+ k+ ~- N B/ l; p/ |5 m# Lend
- O- {. D1 p* h W6 d) B' e
9 F/ m- I; l3 Y8 |4 y tbegin P_pick1 arriving) I; O) l9 m) A0 l3 U
set A_i to 18 @9 N6 Q7 ?. o. ?) a& s
move into Q_induct1
/ l9 L4 \7 D5 {, _ move into pickaisle.induct1- ]7 H6 n7 Y4 O# ]% v
while A_i<=30 do begin
: N- f1 r- S2 C2 V' | travel to pickaisle.con(A_i)
; z' ^) { O6 |3 i1 Z: ~" b% E4 n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. g2 l8 t; [) B8 m/ R
else wait for 10 sec6 @9 j: x. b" P8 P1 M1 N0 v
if A_i=A_leave then send to die
; f5 ~# J4 l% R/ }2 X/ x3 [. q else inc A_i by 1, s4 k+ i, }( g) a
end7 j# I7 s7 h( n
end
: U( q$ O" J# a; F7 k" k$ |) {# r3 y! T/ E* t
begin P_pick2 arriving
" f' M/ l8 Z+ `3 Z4 Y: n" ]" E8 L# { set A_i to 11
* N5 f" b# O, Z! \) h Y9 A move into Q_induct2
. {& r0 \4 c6 C9 { move into pickaisle.induct2
0 B: {" M7 P4 | a% }0 \ while A_i<=30 do begin' ^' f+ K' [* ]' N, z
travel to pickaisle.con(A_i): }2 Z3 y( t# H# a! \& w3 V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ v5 t) p/ S' T! W% ~. g else wait for 10 sec0 D6 u- v% c: e, x
if A_i=A_leave then send to die
0 d/ T* E2 ^5 d5 e" v else inc A_i by 1
/ J4 o }: ^/ L ~ end
4 W5 y E4 i% P1 |7 Z( m0 R0 ]end
+ b8 v q) \7 B. `
% N4 r5 l4 Y/ _' @begin P_pick3 arriving
" p2 z: ^9 L( O4 @4 }$ R& B/ R6 z. ?" Q# s set A_i to 21$ j3 _+ U. s* g" H; c1 k( g
move into Q_induct34 _! V, h7 x8 A0 K
move into pickaisle.induct37 b2 L' t1 v2 {; f+ K
while A_i<=30 do begin5 M& Z' H% D# H4 a
travel to pickaisle.con(A_i)
" S) T, W$ l% y. Y' } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! ?+ q3 Y$ O1 l1 p. b# x else wait for 10 sec: l6 [0 T7 W* a. x
if A_i=A_leave then send to die4 l9 E7 U4 h7 ~/ ]9 T& u% T
else inc A_i by 1
, R; X9 F# Y/ o0 V E end
7 d3 U$ _. `& [2 `5 Kend |
最佳答案
查看完整内容
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,其它按你的 ...
|