|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- {9 h/ P2 f0 M3 y6 Z
( p5 [0 s4 ]0 ^' L& o4 v, ^我的问题是,在每个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中的数值,不知道会不会有什么不妥。* y0 j" n' w/ o. N8 k3 W Z# m
. g+ P! `6 K0 Q( L2 o! \: d
begin P_read arriving
2 x( Z! V! _, F% j, D: K' R5 a$ v while 1=1 do begin
3 e2 L [" K) R- [3 O3 f' ^ read A_tote from "data.txt" with delimiter "\n"; D: j4 E3 {! f& ]* v! G7 B8 Y
read A_time from "data.txt" with delimiter "\n"
2 l' q! G$ @' B. ~: ? read A_leave from "data.txt" with delimiter "\n"
, y0 P5 z2 t4 u# `9 Q! D% F read A_picks from "data.txt" with delimiter "\n"+ c+ q; e W/ d! `+ X' ~
set load type to A_tote8 g4 y, P' ~9 l0 e. J
if A_tote="tote 1" then set A_induct to 11 P( w" g" ^; D9 V
else if A_tote="tote 2" then set A_induct to 2
# v! M+ Y0 m( R, _9 G1 J else set A_induct to 3
9 ]/ C0 W/ C8 f+ ~6 e- K! F set A_i to 0 u& |% b( U+ e" Z
clone 1 load to P_induction6 d5 F0 s* U, l' Q+ d3 j
wait for A_time sec
! e$ X) w2 p5 P2 V) } end
! @7 T1 n2 X5 O9 Oend! d" B: d' y. f; H) ]0 D9 U
) a" _# \6 a1 X7 e y' t! e" h
begin P_induction arriving. z% s5 i9 ^: u5 G, l1 v
if A_induct=1 then clone 1 load to P_pick13 p# {7 h e2 l
else if A_induct=2 then clone 1 load to P_pick25 K9 P& B/ U) S% ~! |' p% M6 v
else clone 1 load to P_pick3 I" m& o# @0 @ u
end
, f: V: R+ n3 a7 d* j" c; n/ Q/ b) q8 u8 w+ I
begin P_pick1 arriving
s6 D/ ]/ \3 d0 x1 N$ f set A_i to 1
( a1 |1 k; W$ p7 q* e move into Q_induct1
3 J. c% [; |# m7 ]8 v move into pickaisle.induct14 B) Y7 q* ]( O5 L$ O1 p
while A_i<=30 do begin: G* ^) X4 r, T4 c T
travel to pickaisle.con(A_i)
! K( X& r: q7 {& a- g1 m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 U, z, [0 |" z2 J& D( d8 F else wait for 10 sec& e. j9 ^( N% ^7 |
if A_i=A_leave then send to die3 `1 r+ b8 m8 y2 p: y
else inc A_i by 1
+ ~# Q% T h- b end( q; t' ?/ d2 ] j' z8 h, ]! R
end
) O, h$ J& m A+ K
1 {6 B: y4 P H- Q- N8 obegin P_pick2 arriving
' @$ j9 W+ r* B9 A& Y1 @ set A_i to 11- m2 V; O# t. ~# Y
move into Q_induct2
) t; D3 p3 A, @* l move into pickaisle.induct2
; d" k/ p& C& T) `9 F while A_i<=30 do begin; j0 r4 D* C6 U
travel to pickaisle.con(A_i)
3 R0 D6 Y3 w% i& Q' o+ t) H/ { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, O- P* D/ C" P else wait for 10 sec, ~# W6 n/ R+ h, `* F* M2 ~
if A_i=A_leave then send to die7 k! `0 u2 E# U* g& [
else inc A_i by 1
5 L! X' e- ?; } W$ @# \ q$ L, o3 w end1 x, O+ e1 q# K7 K3 h+ |) O
end- {% k3 n/ Q% y& e
) C" P' {! b* A8 |8 Vbegin P_pick3 arriving
% O- V$ h" |1 a! G set A_i to 21
2 _+ X! [7 A- @2 t$ b6 u* z move into Q_induct3
4 {5 V' k- o y) N move into pickaisle.induct3- D! I0 _0 |2 ^' Q( d* a+ p
while A_i<=30 do begin
; J4 ~! p! ?2 D0 B' |! r travel to pickaisle.con(A_i)' X% {1 a( Q! h" m& W: j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ f3 p6 x4 G; X9 O/ [/ X2 w else wait for 10 sec8 |# C. i2 q0 I3 _ e2 X) P
if A_i=A_leave then send to die, H( g) E8 r& s- a
else inc A_i by 1
- q( w/ D: ?3 U+ y7 c h- F" y% p end
' s/ P& m: w7 t1 T- k8 ]: send |
最佳答案
查看完整内容
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,其它按你的 ...
|