|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' e/ w$ Y! F$ T; r) {# t; w4 j
- r, N7 x( w; T9 Z6 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中的数值,不知道会不会有什么不妥。. V1 j% h3 d: J/ T1 T5 r4 k
. N+ P1 @" [/ e) W" U" z7 I" a2 O7 G
begin P_read arriving
; ` P4 M* h0 \& v2 M while 1=1 do begin
# k' q. {* a5 [4 y read A_tote from "data.txt" with delimiter "\n"
0 V. l9 i- S7 p, c6 l: s5 Q2 ` read A_time from "data.txt" with delimiter "\n"
( p3 r* s7 s0 X0 r read A_leave from "data.txt" with delimiter "\n"
1 F3 P; I9 _3 W. Z: q7 F1 T read A_picks from "data.txt" with delimiter "\n"2 f: Y( [0 l* Y# v/ q& R
set load type to A_tote1 f: F- t2 G0 C* p* y0 |5 e8 i8 C* m
if A_tote="tote 1" then set A_induct to 1% F, q, ?/ v6 d
else if A_tote="tote 2" then set A_induct to 2" \" a- x& }# Y" \
else set A_induct to 3
~* N. G0 [4 ~7 @ set A_i to 0
0 ]( G8 F6 K0 e6 o8 B5 q; a# ` clone 1 load to P_induction9 y6 s% m( @( `
wait for A_time sec- ]+ ?/ b# t" G9 Z9 i
end
9 C# }$ I4 x! n: t" V- x: Lend3 W% Y& s8 Z, E- B9 ]; O9 H
& X r2 g$ K" \5 }: z4 R- ] p
begin P_induction arriving
/ ]( r6 A1 j7 ~3 J% j* e" m if A_induct=1 then clone 1 load to P_pick1; G/ S$ b M9 i8 `/ X$ \, m* o
else if A_induct=2 then clone 1 load to P_pick2
* g! G7 m3 \4 z/ C; A$ d else clone 1 load to P_pick36 Z" B: l9 X ^3 |( v8 ^" ~
end3 [7 N" m6 ]$ Y- ^9 W+ ?# I( _
8 _3 m& u0 @" E. D9 |/ T) ^
begin P_pick1 arriving
* S" A* G8 w1 t( u: q' ~, T set A_i to 1
2 }* y2 {8 f( v' I. E move into Q_induct17 {& ?- K0 w% G* s
move into pickaisle.induct1
5 d2 Z' ]1 @. l( Y5 d8 Z, v while A_i<=30 do begin5 D* ~6 } P/ }( L
travel to pickaisle.con(A_i)4 c7 ^7 |$ ?. ]+ g- N1 O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' U- b, L$ G- w- b8 T else wait for 10 sec
0 m# e2 ?0 r5 E- u! w if A_i=A_leave then send to die: L3 Z8 T+ M8 o! ~: L' e: b/ Z# |
else inc A_i by 14 d6 @" Q- x) P3 x
end/ [: ]7 x! s( {2 ^7 G! h& ]; d
end
( C# Q/ o5 I$ ?7 f [6 V* D+ |6 V" N) w5 p3 z. V
begin P_pick2 arriving
6 S% n7 N. z; p0 M. f set A_i to 11
6 q( Z9 k/ N* W- X1 o7 N! { move into Q_induct2* U0 r1 [- Q/ ?6 c$ L/ q) l b% l
move into pickaisle.induct2: q. D1 F. @( t {
while A_i<=30 do begin- V3 E0 B$ B: L: _7 [
travel to pickaisle.con(A_i)
+ Z6 ^* F/ x% P) _5 {8 l& h. V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( A; r* K6 ]/ o3 N else wait for 10 sec
8 r. }) O: i1 \! g( | if A_i=A_leave then send to die: u# `& h$ B6 J5 ` S/ s
else inc A_i by 1
( L& W. `- W c3 K, y M9 i end7 v2 I; {9 p1 J, C8 v- ~
end, R l c1 B' R! x
2 \/ p6 U# N& V% V5 Y% b4 o. z- L, M
begin P_pick3 arriving
4 |! i& L8 f6 e" K* _2 h1 ]5 G set A_i to 21
# x# W9 p) Q4 A2 Y/ f# Z( @ move into Q_induct3! y7 ?& {$ G3 L* y
move into pickaisle.induct3& {) O1 b6 O6 U1 r8 S6 L2 X
while A_i<=30 do begin% \: U. y$ M+ o- O' E& B
travel to pickaisle.con(A_i)
/ m. n" v8 s8 M+ b$ a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ Q5 P1 `) }4 E
else wait for 10 sec( g1 j8 A+ V) K2 C$ s
if A_i=A_leave then send to die
) U0 n8 M! J6 w+ `" F else inc A_i by 1
a' ]3 \) m0 w( I3 \0 V3 T0 Z end
4 m B& C9 D# A" X: T( C: T( vend |
最佳答案
查看完整内容
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,其它按你的 ...
|