|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. ]! U8 y1 F% v' n
" U; Y" ]/ K' i+ S# y& S8 G, w我的问题是,在每个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中的数值,不知道会不会有什么不妥。, D+ a" i8 h! N
# L% e1 g, l5 g/ P1 f1 j8 Ebegin P_read arriving
+ j) j; j* T) l$ b: p while 1=1 do begin
3 o4 y g2 y) W0 W1 _; ^- |0 G read A_tote from "data.txt" with delimiter "\n"
; R0 q7 R' a$ E" J$ o# ~: T; [ read A_time from "data.txt" with delimiter "\n"7 q+ _3 Y5 m1 n5 h* z1 w- W9 v
read A_leave from "data.txt" with delimiter "\n"& ~" n# G& n$ \( Y H- B
read A_picks from "data.txt" with delimiter "\n"6 N+ p# _: C% d
set load type to A_tote
2 G; ]/ f% j1 |$ W' @; s$ \7 @ if A_tote="tote 1" then set A_induct to 1
* G2 L2 F+ O: B else if A_tote="tote 2" then set A_induct to 2
+ u9 O( B1 n" }# O% D. Q* f8 @ else set A_induct to 3 % `" Y- s7 [. \6 z, ~4 d
set A_i to 0. o. z8 h. c7 C8 a$ X) w2 I4 O z
clone 1 load to P_induction
' y. L( l# q ]9 B o% E. |8 { wait for A_time sec1 \! t5 @, r5 ?* L! W- Q
end
: y. ^* i0 p7 lend! s% O: M @5 Z6 D& P1 C
* U. v* t) Z1 W* O
begin P_induction arriving4 {* R3 O6 L I) S* r" W
if A_induct=1 then clone 1 load to P_pick1
/ e7 i {: A1 J' ~) r: i else if A_induct=2 then clone 1 load to P_pick2( z8 j$ ]7 n' M, Z' ]
else clone 1 load to P_pick3: o$ V) u5 O9 i
end9 z& F( g! ^% y% t j& L
# B7 E- U# O0 P4 ebegin P_pick1 arriving
; l3 H# `/ [1 t$ R- N set A_i to 1) C( J9 o9 {7 Q* e0 m7 a4 l8 a
move into Q_induct1/ M6 W! T* g5 L4 T o
move into pickaisle.induct1
& X G+ k3 J2 S3 x6 \ Y while A_i<=30 do begin% ]. y, j/ s+ z$ Y# f# S" t% F
travel to pickaisle.con(A_i)
" f' N" @6 l2 `0 y/ C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ i) i$ o+ I# Z( [( ]$ h- a
else wait for 10 sec& ^5 u) o+ ~. ~. u, w/ Y' [
if A_i=A_leave then send to die
4 J1 |* p8 S# z; i* C( F5 u. G else inc A_i by 19 {/ ~- s8 J% y0 o% R9 D1 `; F
end) a0 `' S2 I L" U2 U
end% u- o o5 L& F+ T: p
9 m- _8 D" r! H M1 h0 ~begin P_pick2 arriving
& Z! c$ f$ Q3 K+ g- I" Q set A_i to 11
1 G* V* Q, g) ?( O5 J1 s3 J( s move into Q_induct28 `0 ~ v+ y; Y4 G+ q c
move into pickaisle.induct25 h N( S7 Y! o+ ~
while A_i<=30 do begin
" ]' U4 L: A; d+ S' J- A/ M travel to pickaisle.con(A_i)) N' n9 s1 R D! s" R; t
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. `+ ~/ a6 \, F. s5 P
else wait for 10 sec. ^! e) T$ i: g0 L' ?/ W
if A_i=A_leave then send to die8 l( l1 Q! W4 j
else inc A_i by 1
; Q. H; B6 ]) |. S4 m6 q end: X/ y+ a" o1 r, l& z9 u2 \
end+ i0 l1 Z8 v; w, Z
6 ?) X) _# _* |' F2 X
begin P_pick3 arriving
7 w! E6 A; n" _$ o/ i) [, }/ C set A_i to 21/ N- p! \6 ]3 a0 ?. z% l' e! ]
move into Q_induct3
2 P( K: D% i9 E8 K move into pickaisle.induct3
0 U: c& l# t* J while A_i<=30 do begin
; Y" E) O* P5 e, f% P3 y travel to pickaisle.con(A_i); a, S; }, ]- \ D4 a. y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! T! S4 g) w" B7 G, L$ N
else wait for 10 sec
" e8 O3 v, e! j, k% Q if A_i=A_leave then send to die
+ l1 P! Z: s3 V& r& S! n& V else inc A_i by 1' p# P+ g2 D* R0 \) ]
end
; {! Q _* a1 |; k4 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,其它按你的 ...
|