|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* x9 E+ M p' C8 R* B, o+ [
- S- i( U% A- Q; v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. R4 u4 @5 b- F: K+ g3 h) W; S4 u
) @8 K0 E. P, L) [9 f, Ybegin P_read arriving# s) a% u& z1 h
while 1=1 do begin/ E8 _3 s/ [9 p+ o* P
read A_tote from "data.txt" with delimiter "\n"
( l/ J: |$ u/ v# l; [ read A_time from "data.txt" with delimiter "\n". x" T5 g2 Y4 ]3 |% T) G7 G8 P
read A_leave from "data.txt" with delimiter "\n"
; ^' k0 e1 U1 e) z* p3 W# I4 d e read A_picks from "data.txt" with delimiter "\n"
6 E; J& j, {7 h# B' Q k set load type to A_tote
' p" S& t9 s4 E if A_tote="tote 1" then set A_induct to 11 r7 Q2 G" ~& E
else if A_tote="tote 2" then set A_induct to 28 T% b5 p" [- a
else set A_induct to 3
. _: D& u& A1 ^1 i# L/ B! V9 W( j/ w set A_i to 0. |& A9 A( v9 X+ O0 o
clone 1 load to P_induction& x+ c- G0 F- _# V7 o" [: X) y
wait for A_time sec
. z/ d7 k# C' f5 X' W% P/ O end( F6 Z o k" D" s
end
* C8 b6 Q7 c( ^
0 t' k' {# T( |9 V5 X7 gbegin P_induction arriving5 e Z- |5 S1 l2 l0 u7 x
if A_induct=1 then clone 1 load to P_pick1
0 Z8 K! A# K" x else if A_induct=2 then clone 1 load to P_pick2
: L. [' t/ y! _4 g3 @& P else clone 1 load to P_pick3
, F. D( z6 U% [3 Z* xend/ a" P& A, E; V: z9 `% Q( Q% l
r; m5 |% C4 [4 L% Y
begin P_pick1 arriving# L! N& O) Y" {: h+ G) H
set A_i to 15 n1 {$ G, D$ G: Y# h9 U1 A$ I
move into Q_induct1
$ l$ i0 J( L9 g' r0 G2 J4 b move into pickaisle.induct11 Z! K6 Q/ M' a6 y3 u: U; m# b/ `
while A_i<=30 do begin$ d& I0 J7 i7 a. V5 L, p2 o
travel to pickaisle.con(A_i)
$ Z# g0 F5 T9 y& h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( X- ?) X+ C! P/ u: V4 |
else wait for 10 sec
, B+ v8 K) L1 P; o% G if A_i=A_leave then send to die
- i3 \% ?( k! W% U6 s5 s else inc A_i by 1
) y$ b5 e- U, S2 O5 M3 [ end
+ y! w* N! ^ ~# \% Z, L6 V7 q( x5 Send
. c3 j$ ]( H/ n) m8 M6 @8 |' t6 ?5 Q
% y+ ^% i8 b4 U: cbegin P_pick2 arriving
3 h2 ?/ [" h1 ~6 d set A_i to 114 h$ |4 |% |+ d$ e" p4 e4 @
move into Q_induct27 h6 V9 W6 L; T% S# k- q
move into pickaisle.induct2+ O9 d; N# d5 a4 B+ s
while A_i<=30 do begin/ ~7 W! k1 m9 x3 p" l/ [
travel to pickaisle.con(A_i)" H" ]. B# |4 O7 j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( N1 }+ z' A+ L9 W else wait for 10 sec- b8 [ ~1 {( @. _. b) v
if A_i=A_leave then send to die4 U5 r& b/ X; ^% a/ N
else inc A_i by 1+ d. I( n+ S. Q; ^1 v5 P
end
& ]0 s: \! e+ b+ _$ X3 Mend
8 N- Q; n% ?3 c! b+ a, Q0 Q/ d" s; V3 E( j0 g b/ g
begin P_pick3 arriving
* E3 a/ b2 i/ `! {- P6 L set A_i to 21! H" H |2 U. O' B8 R0 x
move into Q_induct36 U6 m5 ]" K6 n0 e4 U. ?
move into pickaisle.induct3
( Y7 R6 ?% _3 Y: a while A_i<=30 do begin
; t& ?: m" g# B: G2 k- E$ _ travel to pickaisle.con(A_i)7 k( r* T# l2 y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 e* X4 Q! ?1 ]- C& o3 T4 l' {* U else wait for 10 sec
) ]* V0 t& e j$ S if A_i=A_leave then send to die
6 {% T7 d6 T" Q. {$ q& L else inc A_i by 1( v: s8 `+ B; f: k$ R; q, B
end
- `$ _5 t: @4 ]7 z% p( d W# y2 m! vend |
最佳答案
查看完整内容
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,其它按你的 ...
|