|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 d+ U/ s2 M5 O1 |" {+ _6 K
8 \+ B( V6 R) I我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& \0 f; n6 R' Y. V2 T1 ?" w* h' F) r
begin P_read arriving3 j# p1 v- b4 [3 I9 b
while 1=1 do begin
9 P& `- @9 b. r read A_tote from "data.txt" with delimiter "\n"
1 _6 c) T9 z( K- R7 ?/ E5 \$ s$ _6 o* @ read A_time from "data.txt" with delimiter "\n"
! b- K: Z2 t( b, i8 Z3 B( D$ V read A_leave from "data.txt" with delimiter "\n"
6 ~) b/ w7 S) R% J7 U- c" I read A_picks from "data.txt" with delimiter "\n"
: H5 _# {$ r& N/ D5 M1 q& H set load type to A_tote
. @0 Y* p7 j; d; ~0 P3 o B6 B1 N) X if A_tote="tote 1" then set A_induct to 1
* }' X% _1 _4 u, Q3 o else if A_tote="tote 2" then set A_induct to 2. J3 q$ u6 S) t
else set A_induct to 3
: q- `* i8 O) @: l3 ? set A_i to 0) X, ^' u) h: J" W) _
clone 1 load to P_induction, ]" _2 _- ~1 D0 T( j: G" v) r$ D
wait for A_time sec6 l7 U5 C: @. p) h
end0 Q: {1 T- F. h$ ?3 Y" V
end5 f) ^3 `/ p( j1 n: d. _6 R
6 K9 k) b$ }5 k9 Qbegin P_induction arriving' o3 D$ ? P) c( Y! t9 g+ f% i
if A_induct=1 then clone 1 load to P_pick1
4 s; R5 N p0 B, k else if A_induct=2 then clone 1 load to P_pick2# Y: `. o' j& E. C! a
else clone 1 load to P_pick3& z: @$ A& M; a/ n
end4 P8 U: _+ R) o5 m& h; N$ o( o
- `5 y5 B7 c7 t" Y, j8 N- Ybegin P_pick1 arriving
- L1 X# @& q8 W set A_i to 1
) D. h6 }/ ?5 z2 x0 U' }9 W move into Q_induct1
/ A% v& G7 b3 \8 t6 R) E( K, e move into pickaisle.induct1* T# o/ b+ J- ]' @
while A_i<=30 do begin
; L o8 W% l4 ^& e' c travel to pickaisle.con(A_i)
# x- G# s0 y$ e! d3 K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 [, ?# K c8 W' |/ w4 z else wait for 10 sec) U/ ?) f& s7 P9 g. v
if A_i=A_leave then send to die
$ N) S& b+ I2 |4 J. | B- f else inc A_i by 1
) t# N W8 Y8 G end
8 V7 l1 @8 q% w$ eend
9 c4 m+ Z2 {+ \/ H0 ~' |1 ]$ @& D3 U$ V9 w8 y/ k# I
begin P_pick2 arriving! K+ O4 b4 i$ r
set A_i to 11% z4 s8 g1 Y, ]" f
move into Q_induct2" j( l9 R) P" z5 P0 e
move into pickaisle.induct2
1 z# R2 o% P+ D- u6 C4 x- X2 W2 c while A_i<=30 do begin/ y5 q! j2 R F9 q& T# E! i
travel to pickaisle.con(A_i)! s/ Y) `/ K7 J+ O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 N9 S9 H9 l% y5 S2 M. x else wait for 10 sec
4 Y/ Y x8 Q: g7 O9 x; O if A_i=A_leave then send to die+ }0 \8 M! p/ }, n
else inc A_i by 1% ?( u( V% N) ?
end o- w* |, ~# n$ J/ D: u
end* ]& U% }" j9 s, `7 P1 p# n, M
4 o8 x3 I9 @' }' A/ K
begin P_pick3 arriving
" S+ E6 ~5 A+ K set A_i to 21
3 U7 v! Z2 T3 p5 C4 ?# U' P ~: u move into Q_induct3
4 r1 u+ C7 s# J6 i$ Z move into pickaisle.induct3; x- [8 }7 `/ Q% r! s2 E& Q
while A_i<=30 do begin V; `1 T2 ^7 o/ G
travel to pickaisle.con(A_i)
. l9 w4 V) G& \$ V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( T& R" ^. F% F( s& O else wait for 10 sec5 i2 Y" I3 I; s9 @2 O/ Y
if A_i=A_leave then send to die; U9 Y6 U) T4 ]/ q
else inc A_i by 1: l2 j ~5 @- K: u+ r$ ]: ?6 P! B
end
$ ]0 s5 ?4 H" [8 U( P/ lend |
最佳答案
查看完整内容
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,其它按你的 ...
|