|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 f1 A/ A) s' ?% W9 c- _$ w" i
: u7 |" F/ S3 s$ w8 s! e我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 G1 K6 M+ O% X! d4 V
/ y, |$ v5 Q& N- A$ M1 a- Obegin P_read arriving
) m. m! Q' u$ _( E |1 @. S while 1=1 do begin5 k) \' ~! M9 E, ?( n8 |( m
read A_tote from "data.txt" with delimiter "\n"8 w/ I. m8 r( R# }$ B2 H) J# C( L
read A_time from "data.txt" with delimiter "\n"' V- x8 Y) X( k% I0 v0 L, l
read A_leave from "data.txt" with delimiter "\n"
* V( u5 L8 z& C" G read A_picks from "data.txt" with delimiter "\n"
8 G2 M9 P7 Y6 f! c set load type to A_tote% I/ `. r6 \4 Y S3 U
if A_tote="tote 1" then set A_induct to 1, s( q+ G3 B6 I' f
else if A_tote="tote 2" then set A_induct to 2
3 I1 m" e9 c/ m& k2 c$ N& s, b5 m. y else set A_induct to 3 3 h( Y% t# F% @/ j
set A_i to 0
7 m& r. z% g" k1 |% k/ d% H clone 1 load to P_induction
% a' B' |1 c" t) b! b wait for A_time sec1 N4 d# u0 T# H3 J* c6 I' Z. E
end
5 R5 [5 n7 W$ @+ ~3 Send
5 t, W# u; o6 l4 v3 r) u& s; d5 D/ g9 ^
begin P_induction arriving4 q# s% G3 t3 ]4 ^2 t: v
if A_induct=1 then clone 1 load to P_pick1
' }2 E# v( d. l+ t8 ]! g0 U else if A_induct=2 then clone 1 load to P_pick2! [, Q( ?4 ?) o
else clone 1 load to P_pick3
' K; D# |9 g9 a0 k. ~! ~/ b8 Uend
3 T/ P$ d4 X; f$ K% f3 `2 A2 O6 |) Y9 C% c/ s! Y9 P9 M
begin P_pick1 arriving5 e; C6 W+ J9 z; |- Z) `- U' w
set A_i to 16 ?. S9 a3 Q6 Q/ T
move into Q_induct15 y' o% F! P1 D7 i* g" }- y
move into pickaisle.induct12 Q) G. y; _6 k6 {1 w
while A_i<=30 do begin j6 ^ {8 N& G1 T) {+ X# t' ?9 ?
travel to pickaisle.con(A_i)- u: f! x6 U M( u0 v# q) v( @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% T6 q* y) T1 K4 \# U else wait for 10 sec' n+ l) m3 }6 G. @, F
if A_i=A_leave then send to die
/ w( t9 W2 P9 @, K6 \ else inc A_i by 1; ~) F: _8 i( T
end
L. L* w) U1 V7 ?/ k" u" rend8 Q# y" A- s) ?$ c8 U( U" S
) j% E F0 K* K: |0 r$ L4 N
begin P_pick2 arriving
' ]8 b% H$ B! O. [( Q set A_i to 11
$ N Y0 C/ J4 ~+ b move into Q_induct2# }4 n3 N8 D, E1 Y
move into pickaisle.induct2
# Q* `0 [; Z+ I6 }$ ] u while A_i<=30 do begin* i2 K+ {1 Z3 N7 `7 E3 @( O
travel to pickaisle.con(A_i)
$ ~7 `- P, U4 e) J% R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: X. X2 e7 v# e L: r& y else wait for 10 sec6 k; B4 N+ E* g4 I7 }
if A_i=A_leave then send to die. Q2 R! `+ a! d. ^
else inc A_i by 1$ r( i. w, B& d
end
1 i, x. Q; Y/ N( E. k7 b* {end2 P+ I! E( }7 L; q" L8 u
& g# p2 ?' B3 C3 \$ u" t) J
begin P_pick3 arriving" ]* [" b' z I7 h2 x: F
set A_i to 21( ?+ N+ q z9 D
move into Q_induct3' r) }/ G5 u& P' `6 [
move into pickaisle.induct3
3 z$ J5 j* A8 I) g+ M( `7 V while A_i<=30 do begin: i1 t. g) Y {" Z2 }1 M2 G9 o9 @
travel to pickaisle.con(A_i)
+ i) Z) c. S3 [2 t+ ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" Z- m4 U. Y2 Q% d
else wait for 10 sec5 }0 E. h6 ?$ |, A) E
if A_i=A_leave then send to die
! c% o$ e& q1 ~! ?1 |9 d4 }; i else inc A_i by 1
* w% F, O! Q1 [' x) | end% p4 y& T) M/ t A3 ~
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,其它按你的 ...
|