|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 O- ^6 J" K1 g! s6 n6 b
9 K: \1 q) r3 D% a& K9 }" 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中的数值,不知道会不会有什么不妥。
" D( `' V9 _" ~' l7 F3 D& ?- m3 `0 S- ?4 t- d7 L! M
begin P_read arriving. U) @) l0 G7 u! U7 [2 @5 `5 g
while 1=1 do begin r# Q, t: j1 R: p2 w
read A_tote from "data.txt" with delimiter "\n"
, a+ S0 O" q6 d read A_time from "data.txt" with delimiter "\n"
0 W- I+ U! M6 y' f$ m1 c read A_leave from "data.txt" with delimiter "\n"2 @; h$ Z& w9 i1 q- E% i
read A_picks from "data.txt" with delimiter "\n": |3 Z! d6 E* a5 I, h5 b+ `: j
set load type to A_tote
# j( h+ E+ g& P" X j* G if A_tote="tote 1" then set A_induct to 1
6 p" z" q: v* `. D else if A_tote="tote 2" then set A_induct to 2& y! V& N2 g7 O3 P; D
else set A_induct to 3 + D+ ~' E- i) L" J& |
set A_i to 0
* u( h. x0 A; G6 l) u9 f clone 1 load to P_induction1 ?2 {5 c, d# G) _0 D6 H& [
wait for A_time sec' F9 q' t; |% Z2 t7 G* [
end
' Z6 F3 q; D# L! o; dend
; T5 i D3 V9 W# o, G& A' J/ C+ n: G4 a$ @; U2 O" m- V
begin P_induction arriving
' V. ?/ }* n. b: b if A_induct=1 then clone 1 load to P_pick1
0 K1 N0 ~& J; z1 z( A else if A_induct=2 then clone 1 load to P_pick2* H: ~2 \3 w [% r5 Y$ f7 b
else clone 1 load to P_pick3
% ^" {( F! V% T* m8 N0 i- s* aend' u l' b: V0 D" o9 U* w* Z/ b1 V
h- N1 C! t' u& u2 y5 Q ubegin P_pick1 arriving% S- A1 I+ v" l, H. M( E) {
set A_i to 1
2 N' K6 [! O3 J; ~ move into Q_induct1
/ J$ t5 @3 K: S9 P" L move into pickaisle.induct10 v6 K, |& _. a
while A_i<=30 do begin7 w c& x4 B% B" N
travel to pickaisle.con(A_i)
% J: y7 [, y' N! a& @" X# O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( i0 A9 C& Q) h+ w" N# ^
else wait for 10 sec
" @3 ?, m4 T6 x9 M if A_i=A_leave then send to die8 Z+ c2 e8 a& |
else inc A_i by 17 N0 l4 L, d- \, f4 Q" z* ^
end
. q& N1 o% b4 r" \end; D2 \7 G; J% t' t/ h9 K3 i- C
3 {/ \. q! P' D6 X) N) K' \
begin P_pick2 arriving; z, y7 j: r$ n4 R: v0 @6 A! j) F7 z8 V
set A_i to 11
+ M" L. J5 ]! E* W. t! e( q. `1 a move into Q_induct2# W" i/ `2 J5 D% n4 F
move into pickaisle.induct2" s( U5 s+ H4 M+ b
while A_i<=30 do begin
+ ]( F$ G0 d+ n1 V0 v* a. v, l travel to pickaisle.con(A_i)
0 K& l) ~5 b5 a/ C" C8 o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- T+ o3 g8 y7 f1 k$ r else wait for 10 sec+ ^9 r$ M3 F1 T3 M9 V/ f0 d; d- H: E
if A_i=A_leave then send to die2 v/ {7 e3 t: s
else inc A_i by 1
' p5 s; ^" w3 a end
7 J" E5 \% y. z7 _. }' o: c! qend
! y0 X5 h) f) A" Q: E+ ?' E+ n
* M, \, s% }) n6 S% A+ pbegin P_pick3 arriving
# w" x9 m) h, O$ I2 q set A_i to 21
. u4 a/ x3 \# i9 {7 q* t% \4 [$ w- I move into Q_induct35 Q3 B- h' P! r1 j* b2 Z
move into pickaisle.induct3# y- x8 I' Q- U2 g6 j1 c( I
while A_i<=30 do begin
& c5 {, {2 c! f! K travel to pickaisle.con(A_i) Y9 V/ m% g2 U- s2 y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec ?, F# @( A$ G: M( T% {* U
else wait for 10 sec* `% R$ B5 L: w! H# v: p
if A_i=A_leave then send to die \( e: g H# [- N
else inc A_i by 1
) i! l. d2 t! j" u8 N. C- n- ~ end' h" z/ k. o# B
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,其它按你的 ...
|