|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: O" \6 G- F* i6 k, x- O
) [# N) _ d' R9 q. c2 j
我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 \. Z2 N8 D# k T9 K1 B. p
- \) `! M9 B: S4 T$ k
begin P_read arriving- J' u" p$ V8 ]" J2 H) T
while 1=1 do begin
. v1 W. F* t1 A; A% V read A_tote from "data.txt" with delimiter "\n"
' L4 f9 _1 f. X& V' `3 _3 P; q% I& L$ ` read A_time from "data.txt" with delimiter "\n"
8 P# ]- w3 |0 E* a0 ^8 y read A_leave from "data.txt" with delimiter "\n"( |$ p8 f+ R$ d8 V ^ k
read A_picks from "data.txt" with delimiter "\n": V& x( C; h/ \% Z
set load type to A_tote
~9 ?3 v& d* C+ A( ~2 I if A_tote="tote 1" then set A_induct to 1
$ f8 \% A3 P8 r$ F6 w, x) |% x' e else if A_tote="tote 2" then set A_induct to 27 ~$ M6 j7 `8 u) ?5 d% R
else set A_induct to 3 4 M: p$ }/ \, T
set A_i to 0
8 X; w, M# r, ?0 T" b( B/ Q clone 1 load to P_induction
5 g% P& K6 W$ W; B1 a. |( ^/ _ wait for A_time sec, r& s2 q; U3 ^7 v; T' Z$ k& ]* [
end9 D: Z( c) e7 ^0 L1 m* z' J. H
end
# U. k( N% c6 ^* m2 ?( G% S
d0 Z# A" M8 G, \. Ibegin P_induction arriving
* {2 u! c- O4 {$ G( c0 A: x if A_induct=1 then clone 1 load to P_pick10 L$ l9 p# A7 [: |) U8 p8 \4 W8 N$ I
else if A_induct=2 then clone 1 load to P_pick2# g8 E- P/ \+ ?& x% H" D z
else clone 1 load to P_pick3
& j' ?! }2 P! v, e# t- x5 K% Rend# m6 f6 Z+ f8 |4 E8 k) n: m- U5 C: u) D
# @& Y( k; R% \$ f' ?, M' P- Ebegin P_pick1 arriving
2 g3 ^: o$ ]; ?) v' T* ^1 W! V3 [ set A_i to 14 Y; R/ `! b7 H+ {# O) Q
move into Q_induct1
l& _5 E. V1 n4 c, E; Q move into pickaisle.induct1) L& q. w v0 X2 N* P8 h
while A_i<=30 do begin4 F0 _& X& @$ F2 a: r, W" w
travel to pickaisle.con(A_i)
) a/ A1 @! F3 P0 O' u' r- ?/ x2 f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 a. v: K- ]! }4 w5 N; m# Y
else wait for 10 sec& {+ ~; `% R) O* v4 l1 q
if A_i=A_leave then send to die: T% E& y) E+ c
else inc A_i by 1
9 U u9 X4 @9 c6 T9 l end
$ u/ V9 @. m2 a6 I$ v9 gend$ f, _! T0 I' m. X. n) @2 i {
8 ?4 R% i4 u% N' E5 k" l
begin P_pick2 arriving
) O* C/ H5 n. |( v3 H0 n set A_i to 117 H0 u8 @" j* s, _$ b
move into Q_induct2
3 P6 S2 L; j: f2 p0 P move into pickaisle.induct2
( i9 P" d$ C7 B& B0 C while A_i<=30 do begin4 a- l p3 n* C9 U, W% B: j: p
travel to pickaisle.con(A_i)
8 L6 n2 {5 w9 _4 M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! a$ i* A% i2 m/ z% L$ ~7 i/ @- D7 D else wait for 10 sec/ U3 p' B. H. F1 \1 z g
if A_i=A_leave then send to die$ W& C5 U9 [5 G- y" o' W
else inc A_i by 1
7 T. ^. x3 _3 b. R3 B' j end' ]1 p8 K' Q/ A$ h
end
! n6 m; Y1 O) J4 q3 Z- q
W7 f; g8 F: {3 M# `- Tbegin P_pick3 arriving, ~' r* A. \& e- `
set A_i to 21
' X) g' H9 D: K, q9 {5 b& I& ] move into Q_induct3: f8 J$ u( Q8 u& G
move into pickaisle.induct3
+ D9 Y/ x0 h: u% C while A_i<=30 do begin' V1 l* T' s* x7 g
travel to pickaisle.con(A_i)
1 w2 P. S1 N1 U, _& Q2 C4 W. T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 @8 F" [2 I+ p
else wait for 10 sec
1 _- g# x3 ]6 F7 O* F if A_i=A_leave then send to die3 k5 x- C& U2 u# S$ \8 e6 a
else inc A_i by 1; U6 K3 F' q- \8 A- K) S5 U; ?
end; e9 `$ v+ ^6 m$ G2 s2 n
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,其它按你的 ...
|