|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ E6 q) W' f* A! o' z1 M) t
: [- H2 ^/ b1 ?) I" }. l* ~我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 V# G$ u5 N+ S5 B, W: p# G
4 N( s: W6 N' C" w5 J! Lbegin P_read arriving
1 P, e' p2 `' _/ l/ v* T while 1=1 do begin' V( W0 A. _ l; Q0 M' s7 ^3 e
read A_tote from "data.txt" with delimiter "\n"
% d9 n6 c9 V+ Q- I; d read A_time from "data.txt" with delimiter "\n"
+ ^5 p; h* B8 A6 T9 X' W( t read A_leave from "data.txt" with delimiter "\n"
. D' p; S4 d. \4 L# ?! Q read A_picks from "data.txt" with delimiter "\n"' N, j6 d% f b& {3 |6 x4 S0 `
set load type to A_tote
9 p$ \. N2 y* _* ?1 \4 @% e- x9 T if A_tote="tote 1" then set A_induct to 1- O0 N2 M4 R' G5 U0 v
else if A_tote="tote 2" then set A_induct to 2
* X% w( T! f+ N7 V else set A_induct to 3 8 J9 g% Q4 v( B8 C
set A_i to 07 I# @" L0 }2 u' j' b
clone 1 load to P_induction' d" k' P: [4 t) p+ P* k
wait for A_time sec
' ~- N5 i+ M8 G1 s2 p0 r$ j end
1 r% G- |1 f9 j9 e# _end$ _4 _: B+ d" p, V( m0 \2 x+ F% x
+ ?4 b% c+ s& [* X# R( [begin P_induction arriving
/ A% h }" \' E2 d if A_induct=1 then clone 1 load to P_pick1" t! A9 c0 C& `3 y3 E
else if A_induct=2 then clone 1 load to P_pick26 D* t9 K: u1 p$ }
else clone 1 load to P_pick3
6 z3 M$ i! V4 _7 s+ p4 Qend
# v( }; s' C2 W9 R+ r; y2 o, ?2 I0 r$ \; [$ q7 j
begin P_pick1 arriving6 x" I7 z ? @# z/ y/ X( J2 \- R
set A_i to 15 m9 C6 B+ I6 R
move into Q_induct1
' L' V/ o" j' K: i: ]6 O' P4 c move into pickaisle.induct1
/ L& f w5 r2 S) ^ while A_i<=30 do begin) f; Q [# Q) R0 G% G K h* I, w, Z! Z
travel to pickaisle.con(A_i)" S4 \7 r) m" F O8 A! T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! X# {" t2 _7 u5 Z else wait for 10 sec+ q4 p/ g6 z3 k% M9 D; J
if A_i=A_leave then send to die+ m) T# N# A+ z- E0 O1 Y; k3 j
else inc A_i by 1
& V* a* f! U4 Z4 H# j# ]0 G end) ?8 T. N6 o" Z5 k" M
end
. ]1 w6 N' w+ r9 H7 a: S9 m. i
r$ O9 z" _6 ]begin P_pick2 arriving% ~) l& ?& H+ D( t
set A_i to 11" Q* k `; O- B$ ]$ ` |6 `
move into Q_induct2; B# G3 ~/ i+ Y% L
move into pickaisle.induct2& j: o' G& k/ l$ E
while A_i<=30 do begin4 }6 {( \5 y$ R# H1 R. p8 B
travel to pickaisle.con(A_i)* F6 R' V$ h6 k {+ s+ p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' y% h' i& A9 k% i else wait for 10 sec% O1 E: H+ j& b& Z$ A
if A_i=A_leave then send to die) U: z+ |4 J# `. t3 [
else inc A_i by 15 {, c5 g8 Q* @9 ^
end! o) u! P# N+ U( s4 z% W% v5 ^$ E8 ?
end
, g3 V( O; B0 @9 c
4 s5 i. X& ~4 ~ Mbegin P_pick3 arriving. {1 N- u% V/ a
set A_i to 21
' T j' `5 y0 H1 R move into Q_induct3
* T( f- G M& _3 M2 M8 A move into pickaisle.induct3' Y5 T% K! b1 W# h
while A_i<=30 do begin
2 ]' h% W$ x1 r9 c: [ travel to pickaisle.con(A_i)
" k6 P1 ^; {* C8 y4 M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( e3 X" G7 x& w8 t) C5 W: Q' l+ z else wait for 10 sec7 y J& F. v8 z8 k3 v
if A_i=A_leave then send to die7 c! |/ C4 q! Z' x( T
else inc A_i by 1
! m4 h7 V: i$ G( Y9 t end- K; o* Q+ g) H$ Z5 u
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,其它按你的 ...
|