|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( }/ |& r# _$ H9 c( }% I; L8 N& x6 O& A( h! s/ h' n" O# P' r
我的问题是,在每个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中的数值,不知道会不会有什么不妥。, {4 U: Y: n6 D. x
, T6 O( S3 m' k. jbegin P_read arriving' q @& _( h* C' H/ e
while 1=1 do begin
3 N1 d0 h3 @! X3 v S read A_tote from "data.txt" with delimiter "\n"
# ]) P1 D$ l; b q% l* T' C* ~/ b read A_time from "data.txt" with delimiter "\n"( u; N0 }& _3 u- |" o( T7 L
read A_leave from "data.txt" with delimiter "\n"# V+ B& |7 F4 Z: ]3 V/ ^: D
read A_picks from "data.txt" with delimiter "\n"$ G8 l" ~( I5 p: Y3 w# S
set load type to A_tote
9 p8 L0 a' p% @. G if A_tote="tote 1" then set A_induct to 1% w9 j& q0 C& L4 K' ~) M
else if A_tote="tote 2" then set A_induct to 2: D( _# b1 r' r
else set A_induct to 3
3 w+ v( }% w' q, v9 | set A_i to 0) N8 ^7 H, r7 {1 A3 N6 v
clone 1 load to P_induction
9 D- g! D% u2 h6 \ wait for A_time sec
! ]8 H$ @: R$ {1 M8 f end4 z0 U; U a- w! H% q
end6 @9 A9 s6 Z M
) y# o& d0 O( L ~* D* y; b' s
begin P_induction arriving: k% S0 A P @# F A
if A_induct=1 then clone 1 load to P_pick1. b9 D/ @5 O7 y
else if A_induct=2 then clone 1 load to P_pick2
( Y3 ~& |% | u: y0 L$ ` else clone 1 load to P_pick3
H- k# @+ c3 I5 Oend) p/ B$ S8 k4 e$ w2 X; [
' D8 a% x+ g3 g- L' ]! B9 Qbegin P_pick1 arriving6 k2 @+ X3 `4 Z) }1 v' T: ^
set A_i to 1
/ g- G4 a/ j: V) f2 ^ move into Q_induct1& Z, H, @" B1 J" Q# v8 C9 F
move into pickaisle.induct1+ o, Z3 P, m2 F0 s; c7 a
while A_i<=30 do begin" { o8 l2 E# G" T2 e( B
travel to pickaisle.con(A_i)
/ H& q! o, c5 V8 f" g# Y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 ~( O% x8 y5 I# p; D& m
else wait for 10 sec
, W/ e# V2 s# c7 O4 W) z1 g* l- E6 R. ? if A_i=A_leave then send to die, b) [( [& l8 d
else inc A_i by 1
; O5 d% Q ~2 a4 ?# t end ?# J6 U5 o2 B) D3 Z8 L# L- x
end7 E2 [1 k2 n! A+ h: h( N# }
% W- _8 R4 D0 g, Y
begin P_pick2 arriving4 a. p4 _6 a5 ?# \' `
set A_i to 11% i [" l" q4 x2 ~1 _
move into Q_induct2
! q3 [8 x) N/ }/ H( P$ v move into pickaisle.induct2
2 M1 s4 L! T! i while A_i<=30 do begin
' S h: T u( V5 n travel to pickaisle.con(A_i)
* p5 E0 Y% k' L2 A- Y) ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ]3 I+ j+ D r else wait for 10 sec6 R% ?* X, Z4 W, T$ V
if A_i=A_leave then send to die
, O j* ^8 d3 d. n! v% {7 { else inc A_i by 1/ q4 ~& R# d) z* i" g3 L
end
% `- G/ a8 Z/ J# N oend
; Q$ D& k2 }( ?, w: |8 k+ X7 Z' M' ]1 {" H O
begin P_pick3 arriving
: o8 S1 W8 D1 i6 P( r set A_i to 21- |1 N# o) \# r$ U: ^1 _/ ?# b: ~
move into Q_induct3
; Z: F7 h P; z* L3 V- H5 K4 W* Y move into pickaisle.induct3& Y& ^7 |0 S( A U; {
while A_i<=30 do begin8 r" y# a6 g; j( L# K
travel to pickaisle.con(A_i)
9 Z0 ], z' R' P2 N( o1 T! c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) W" k2 t$ w9 O& e- Y, J( B1 E& o
else wait for 10 sec
& ~7 P; j8 {' @- w7 M if A_i=A_leave then send to die
/ P, C* d) }( N else inc A_i by 1
2 h/ g; ~9 M5 N end& U# M" @/ Y# t. x
end |
最佳答案
查看完整内容
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,其它按你的 ...
|