|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 o, t% W; ~# D/ p) `
! j( t4 k: a6 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中的数值,不知道会不会有什么不妥。
: F; E# n4 b& d# J3 ]9 F8 |% K, q* @5 o
begin P_read arriving
. H; t7 |4 D2 e; `# [1 ~2 E while 1=1 do begin
1 Z; D- ^) h- B- X: _/ Q read A_tote from "data.txt" with delimiter "\n"
4 ]& ?: c+ G1 W read A_time from "data.txt" with delimiter "\n"
8 P9 i4 h' k2 A) Q# E" u read A_leave from "data.txt" with delimiter "\n"
! [* t) X- p! X0 k. ?- H7 d$ C read A_picks from "data.txt" with delimiter "\n"
9 M9 y u! B" k8 c8 T! A1 ] t set load type to A_tote1 Z+ E R# v" |# T+ X$ H
if A_tote="tote 1" then set A_induct to 1
" f( i# Y: G5 S) ^$ o else if A_tote="tote 2" then set A_induct to 2
. f; Z2 n) ^4 d& ~ G5 h5 d else set A_induct to 3
2 |$ N! {* Q+ \4 Z; ~( a, ^2 } set A_i to 0" U2 r4 s& J" s# Y# Z
clone 1 load to P_induction
' f, r$ Q7 G: `3 `" R) n wait for A_time sec
" R. \8 z. x$ \ end
2 {- D8 _# l& D( c6 }8 gend
; o( L- d$ f+ o. Z' Y
; p5 [4 V* h- n) `! Gbegin P_induction arriving
4 `8 P& B' S9 q, I5 R if A_induct=1 then clone 1 load to P_pick1
) x2 ]$ x) @4 {* S+ s% K2 @ else if A_induct=2 then clone 1 load to P_pick2
' Y1 A# E0 i* A7 @. | ]7 ? else clone 1 load to P_pick3
0 b1 p- D; f' T! r& `end( F# E" [ c4 G- R, J0 r3 S
! |2 _# l S1 A. L( w6 I) X6 Zbegin P_pick1 arriving
' ~% A# Y: e& R. V# @ j) f% o set A_i to 19 `# R. w, Y) g) g( n O& r( s
move into Q_induct1
9 s) g* G8 J; j! C) C' e move into pickaisle.induct1& f7 v$ B {5 ? \$ c
while A_i<=30 do begin
1 _8 r: j) ]: |& j: c+ e travel to pickaisle.con(A_i)+ ?" H- B& X, C, _/ i1 E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% R4 g3 O! T% h$ d1 P8 l, h else wait for 10 sec1 B7 N+ h1 ^) G2 O3 U" I
if A_i=A_leave then send to die. i/ c4 Z0 Y( x
else inc A_i by 1) Q; b3 F4 s8 E" [7 x8 |% \
end
; _8 X6 q7 F; A: F" a; l1 g, |end
# `/ [. N0 L$ D% x8 _
1 F+ @: U% O. x. X% g8 `begin P_pick2 arriving
9 c# b* D% `/ }7 T set A_i to 11
p2 C( d9 n3 K. ^& V move into Q_induct2
/ ?1 x$ D/ H. X- Y X5 Q move into pickaisle.induct2
+ \, F2 I$ B' {- w a- L! @ while A_i<=30 do begin
* Y( `4 J: {" ~7 Q: d2 T travel to pickaisle.con(A_i)
( s# Y4 \( B% C2 u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 |+ @# j% b5 o6 T5 q; O' N1 d! a else wait for 10 sec
0 ~' |, [" u0 D. {- P7 I if A_i=A_leave then send to die& V1 w9 T- b/ B' z8 v" _- [
else inc A_i by 1
3 A1 V, C1 n8 R: j0 L. E end
1 J6 x2 @. r/ [5 f9 O5 Hend
7 ?8 g' R. x# ?, z/ |7 q0 }% v' c. R
begin P_pick3 arriving
' [, u% L8 e+ R6 c% B) t e set A_i to 21
7 a/ w. ^' e: Y move into Q_induct3+ V R- }! j! ^' d* N( p. s
move into pickaisle.induct3' H' z# S( K* }! A; |+ F
while A_i<=30 do begin3 W$ `, F$ z. I1 _
travel to pickaisle.con(A_i)7 f/ E7 a* q v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 A* N! s a( h7 D4 W
else wait for 10 sec% q: D3 b5 c+ O# V
if A_i=A_leave then send to die) }, r% z* c& j9 @- r6 e
else inc A_i by 1( B3 M3 V+ T8 C" M E
end
/ g- u( }2 [" S3 h2 uend |
最佳答案
查看完整内容
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,其它按你的 ...
|