|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' K) ~ o6 v: o- {$ @0 M" ~; T% n% b( O' K* D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 ?7 t. D; b* ~6 ^1 W$ u& m6 b% ^/ q0 [$ r- q/ f' w; z R- O. g1 U1 {
begin P_read arriving% D+ v2 v7 \4 u6 D& k7 c
while 1=1 do begin7 `( b# b9 N& B
read A_tote from "data.txt" with delimiter "\n": H" N) j" X ?5 M$ y
read A_time from "data.txt" with delimiter "\n"
- \# @% y4 N9 ?% J- @. M read A_leave from "data.txt" with delimiter "\n"
8 Y: J4 }' V/ o7 q3 o' }3 w: z: B) F read A_picks from "data.txt" with delimiter "\n"
0 T7 d" R F k U" C0 A! _- q set load type to A_tote
- k& I4 z% E+ R+ m9 L& F. G0 E if A_tote="tote 1" then set A_induct to 14 c0 p5 s) u% D/ _
else if A_tote="tote 2" then set A_induct to 2
) H, B+ h) _& h5 ?0 p) w else set A_induct to 3
" A; x. E; U% E0 z4 B! F6 F set A_i to 0
# t; K7 q! T: w* |& | clone 1 load to P_induction* D7 l4 {( N& b7 X6 ~! a* @- {5 g
wait for A_time sec) U, a5 K- v- u% l5 R: g# R6 v
end1 @5 y4 d8 z- ]/ G `
end* f. \9 D1 t+ Y/ @9 p6 a5 E4 z: a1 ]
8 K. ~: B* ?6 C6 U7 B' |begin P_induction arriving& F4 s2 O8 k; k& M6 `
if A_induct=1 then clone 1 load to P_pick1; ?0 |4 M$ g" ~
else if A_induct=2 then clone 1 load to P_pick2
( n! D* u& k1 B# z& l/ j else clone 1 load to P_pick3
% |2 Y' Y! t+ A( V) U& Rend, x$ F! |/ B: K$ W1 {3 {
4 R# n8 L% z! b: ~( `
begin P_pick1 arriving
, I/ J' V! N4 v! ^ set A_i to 1
( {9 J# G' c2 k3 w' e3 n move into Q_induct1
; o% |3 A4 A0 B* R2 q: f move into pickaisle.induct1
+ V6 L$ }4 X, U4 g1 @+ L while A_i<=30 do begin4 m( L9 \7 T6 N' y3 G7 i- N
travel to pickaisle.con(A_i)
& f: J$ r2 h% I4 E) b% D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ t; k) [, a p/ p/ d2 g0 R
else wait for 10 sec
) ]7 } Q F8 W5 B* o. x0 C! a& A if A_i=A_leave then send to die. }- R! a4 r9 p$ f+ X* P( n
else inc A_i by 1" w0 K0 }6 F( D: o
end# x; n8 F+ a f/ ~! H& k
end
3 G/ L1 }- w8 }2 e: X @$ n4 W; E( K. B$ g I, |
begin P_pick2 arriving
9 G2 |% ?6 N- n3 P) v' r; F set A_i to 11
9 M, J: G- m K- L# [5 @ move into Q_induct2* o; j3 u# T3 ~/ o: w4 V$ x- C* C
move into pickaisle.induct2% P; q% d- ]2 ]6 {9 Q( Z
while A_i<=30 do begin6 l6 ^ T! q! p3 h- e
travel to pickaisle.con(A_i)) o- E! b' Y3 |0 n9 T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 R( [. y9 |2 y# Z4 E7 W else wait for 10 sec( |$ M8 R+ n7 C5 U0 g* M* w: q2 u
if A_i=A_leave then send to die
' I/ ^# d/ p- C( b, d7 o) B$ E else inc A_i by 1. l7 S- A! N3 T5 Q0 J9 H
end
. F1 P8 \. Z7 m* `- j2 Z! Aend
' T( @8 O! u1 n/ `) b' K" S3 e3 `0 O- l# W* i* c) e0 w' {
begin P_pick3 arriving* q/ P8 G% T5 y7 H) G5 i( p
set A_i to 21
t* z! [; T `- R move into Q_induct3$ s- Q {9 K: y3 J
move into pickaisle.induct3! |8 W( h8 L4 v. n/ K( P, d
while A_i<=30 do begin
! |& B3 {# v* c; | travel to pickaisle.con(A_i)
# p0 j {. L* G9 z4 u! L& L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 z% i0 A8 G7 q else wait for 10 sec& ~7 ^; {7 F! [7 K* o) W
if A_i=A_leave then send to die
# [' o5 j7 \0 t& K3 V5 b. U else inc A_i by 1
Z, ^7 W4 b4 P# x% G$ a end) R! ]- v* F# S, c2 E( z$ \
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,其它按你的 ...
|