|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ a# D& l- s' L/ L# i
; V6 {2 ~6 a4 a1 t我的问题是,在每个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 g& m4 t, c3 X( n: s/ }4 N$ P
4 K* z+ ^3 G6 S0 [5 Sbegin P_read arriving* a( M3 ~4 t. O4 |- W. C' {, Z
while 1=1 do begin
+ N1 p" ~! A3 j( s/ j2 j7 E read A_tote from "data.txt" with delimiter "\n"
2 v7 K8 Z/ O& U' e read A_time from "data.txt" with delimiter "\n"
! |0 Q5 K- Y4 e; l read A_leave from "data.txt" with delimiter "\n"4 g8 K6 v" l6 V2 s
read A_picks from "data.txt" with delimiter "\n"' T) U! ]7 d& ?, l5 C
set load type to A_tote6 l2 B, D' }! ^6 F; p
if A_tote="tote 1" then set A_induct to 18 `) t" a! B9 v+ r( V! u
else if A_tote="tote 2" then set A_induct to 2
7 g: y( T8 B, V2 z' ~" o) a( B else set A_induct to 3 2 I( c; r+ A: o: V
set A_i to 0
1 p) j: t, m$ z& ~ clone 1 load to P_induction
. J6 }# H5 ?& u wait for A_time sec
* c. R9 }, j7 \! l end9 u1 w5 j# J2 U9 v) t" H- W& d
end
* ]& _/ y% L+ G* d' V+ Z" e6 e' n+ ^5 |$ M+ M' u" I
begin P_induction arriving! D* ]4 h. P5 r" s# n( ~
if A_induct=1 then clone 1 load to P_pick15 A* [4 w( s# w. ?6 [7 Q* N
else if A_induct=2 then clone 1 load to P_pick2
8 _+ G; t, M h5 t1 x3 e else clone 1 load to P_pick3
$ o1 t4 B+ |% {! lend
- E% E' T% m+ _$ E. g- X
3 g! p( P6 W/ s7 q8 nbegin P_pick1 arriving
6 B- y5 ?' B' F( G3 r( k set A_i to 1
2 S( l1 c! Z0 |, J# U; n. \6 [7 A move into Q_induct1
. P. N8 C8 ^& k) U0 o' U$ Q! @+ r move into pickaisle.induct1
* t' X& V# V6 h: E" k/ i* f while A_i<=30 do begin
2 g3 m# X9 C* O e/ e* E. H2 c travel to pickaisle.con(A_i)
( {$ `, K2 j& t; f6 F5 p9 S$ G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 Z2 |7 R. Y" _1 V' \# S, \
else wait for 10 sec& \3 A% y0 z! _' g1 R
if A_i=A_leave then send to die
+ `3 e% E8 N3 l( F4 e1 K1 R else inc A_i by 1
1 Y, F& s' I+ w1 r end
/ @5 ^4 j( g& G( d7 a! tend2 C/ l4 }7 c$ Z e& ^/ A% X% T9 {2 Y
7 A* ~3 f Y/ l) d/ fbegin P_pick2 arriving
" k8 B/ U' K$ a3 U6 _( Q set A_i to 11
3 I8 A' y# {8 t" d, D4 |: t move into Q_induct2) V0 f0 Z8 i- r" k0 J5 v7 z
move into pickaisle.induct2; s, |9 Y, Z( C# s
while A_i<=30 do begin
8 b) k: H( c8 U( G3 x) M& t+ r travel to pickaisle.con(A_i)1 s+ e/ N; B. f; K3 o6 Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ p/ ? K. C4 _* E, \: E! w else wait for 10 sec
" ~; t/ j2 b; d5 [! { if A_i=A_leave then send to die
2 h, b$ M( v/ o else inc A_i by 1) J2 e- h7 ?: r6 N: t) \
end
$ {5 |7 j' J+ t, K7 rend
. p3 e. }1 w! @, ^
* i# x( J4 X7 @/ t) s) E$ u, fbegin P_pick3 arriving
) x/ ^" s9 b2 K+ Y# O9 k$ z0 ? set A_i to 210 s1 s! h, Q# @. ?3 o
move into Q_induct3
2 V* X2 Q' E. N2 S \: n move into pickaisle.induct3
t. r- A0 h+ n, e- t' ` k while A_i<=30 do begin
b3 p! l+ X8 u0 a6 a. w+ r travel to pickaisle.con(A_i), f5 ^8 i3 ^+ m9 o
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! W4 p8 |1 E) o4 {, }4 q$ T else wait for 10 sec
) c5 p7 U' Q9 a if A_i=A_leave then send to die
b5 E! V' U3 S# a/ i L else inc A_i by 1: X3 F3 Q- D) O% X% Q
end
3 {8 q9 W) \# A: z' ?# u4 c( 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,其它按你的 ...
|