|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) j9 } i7 V4 i- `: @* f; I2 |
: `4 K# a# [' a# d6 h3 N- n6 [
我的问题是,在每个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中的数值,不知道会不会有什么不妥。- L, U0 Z8 K# F3 K
1 S; R* J' r+ [0 n a& d8 A9 K
begin P_read arriving# v- g: s" Q. G9 d+ y
while 1=1 do begin
6 {. s+ R/ e2 g7 O. j$ e; ^/ u read A_tote from "data.txt" with delimiter "\n"
& ~ w5 r* Y6 E" i read A_time from "data.txt" with delimiter "\n"
( }" z& _. P; a read A_leave from "data.txt" with delimiter "\n"
" l4 d, ^8 F9 d( o& C; \ read A_picks from "data.txt" with delimiter "\n"
. A: t2 T" \2 }! e% t! T set load type to A_tote
- G; z' b/ i2 }; R1 F1 J if A_tote="tote 1" then set A_induct to 1
' {1 E* b, K+ ~, m else if A_tote="tote 2" then set A_induct to 2# ?* H" r7 j3 J
else set A_induct to 3 % Q3 G! u# s0 K
set A_i to 0
+ a' s# E7 K, t$ P clone 1 load to P_induction
$ V0 T) h: s% P* o6 S+ U wait for A_time sec
8 L% Q! l: o( e- _' N end
+ q* a- ]" s' ?end
. \, Y, r$ v/ Z+ g9 R) g2 x# S8 A$ o* R. o& V) p3 b* G. _
begin P_induction arriving: p3 @& O ?2 r. P& b, T
if A_induct=1 then clone 1 load to P_pick1
9 C: r$ T9 Q# a# f* x% ^- b9 C! z else if A_induct=2 then clone 1 load to P_pick2
2 [; Q+ B o4 D. s else clone 1 load to P_pick3
7 [$ g5 X1 n$ f) `end- N# x+ e3 M2 R; K
5 J/ w4 ~" z4 d# \9 r2 k
begin P_pick1 arriving* e& q" _: Z6 R* u- e
set A_i to 1# r- K( Q; _8 c$ _" l
move into Q_induct1" i$ @! d8 G) L5 @2 y. M6 u
move into pickaisle.induct14 M$ n/ j4 M8 v8 y6 x& w" x6 _9 @
while A_i<=30 do begin0 S1 F7 P4 O# Q" H% _# H
travel to pickaisle.con(A_i)2 Q E% n0 b$ D5 o9 T9 [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ y6 s( d2 {1 n4 P; D# a: k- p else wait for 10 sec
8 k/ x7 W1 c" @5 w" H if A_i=A_leave then send to die& } q6 E, S1 c; `4 X
else inc A_i by 1
9 D6 n) a8 G3 }5 W' N' B& g end, t0 C3 r6 ?7 R6 h; h" \. x
end
8 g5 t, S1 A% `, e0 B( `, B7 D0 Z% S5 B
begin P_pick2 arriving
Q. X, p( t/ P6 j2 g set A_i to 11( _2 k& N/ f9 ]# _
move into Q_induct21 q7 N# P- N) D% Z4 ?" K, i
move into pickaisle.induct20 t' D4 i. e1 W( o5 O% U! O
while A_i<=30 do begin
$ F9 ^- v% {) O9 ? V' { travel to pickaisle.con(A_i): Z2 n- p: X6 T$ L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 Q* E9 R0 ^+ z- i; x8 {
else wait for 10 sec# t; ^& X# ~6 l% n* ]
if A_i=A_leave then send to die- ^" `/ p! n' D0 M, j
else inc A_i by 1" Q5 T+ Z; m9 \1 F- V
end' A' m7 H& @% }- A
end
1 @ M/ E/ ^) x6 N8 [# a+ R* e( P
8 B9 }6 E" A. _( u9 i6 P* {, G& bbegin P_pick3 arriving
7 K1 D8 }! d$ v( o7 H set A_i to 21' e9 i9 ]% A2 W, B
move into Q_induct3! t" l% l- n( I, x# ^& O3 t0 U. Q
move into pickaisle.induct3
# z: y( d9 W' G8 E while A_i<=30 do begin
. p* O& M8 J: y1 s travel to pickaisle.con(A_i)
; T$ w6 U5 T6 B9 G4 Z8 j4 v5 @ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 E, f+ m( K) x4 q* p
else wait for 10 sec
* h; r2 K8 X5 a s, K/ K. ` if A_i=A_leave then send to die
) j. i7 P: k6 e" O) c else inc A_i by 1
4 P# J/ s! o" ^ L \ end* V" K$ J+ O: Q( o! a2 \1 D6 Q
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,其它按你的 ...
|