|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ `+ t- s% v! b$ z W3 W* V' V7 A
% e# ]# p7 J0 J+ S: O/ X
我的问题是,在每个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中的数值,不知道会不会有什么不妥。; }; Q) L l: u' I6 M7 m
/ d+ j# O4 J+ i/ s! O* i3 Sbegin P_read arriving5 o, {# Z5 L" w, L- V$ u# [
while 1=1 do begin
0 C% S' w5 z* X' s. j read A_tote from "data.txt" with delimiter "\n"
1 k7 X' C V" q% E4 W$ o read A_time from "data.txt" with delimiter "\n"& j# A- R" Z8 g' E8 c1 i f( X8 T
read A_leave from "data.txt" with delimiter "\n"
$ O7 N2 s4 y: W! L9 Z* H& v read A_picks from "data.txt" with delimiter "\n"
+ s8 p- P8 U, P/ I: H9 I0 H set load type to A_tote8 n9 } R% ~+ x
if A_tote="tote 1" then set A_induct to 1- H) ?' f3 n1 U5 |# T
else if A_tote="tote 2" then set A_induct to 25 G) A( m& m4 q& B4 x+ R
else set A_induct to 3 " b G2 [8 R2 g
set A_i to 0: g( f6 v2 G3 y! U/ C
clone 1 load to P_induction( B; w4 f: w5 C4 X) s
wait for A_time sec
/ M' ?; F* U1 l$ c$ h end
- l' F- E8 ]$ uend( Z/ Y% N9 N P9 X5 t
1 ?, d0 ?8 r6 Q. K2 ^: S8 I2 I7 @begin P_induction arriving
8 R) |5 C" u* C if A_induct=1 then clone 1 load to P_pick1
% k2 u! ]- \ t else if A_induct=2 then clone 1 load to P_pick26 c9 r1 j" E% J# A( M
else clone 1 load to P_pick3- X/ k/ l+ g) Y: B
end X1 v5 I) Y- f; q
" K" \& j/ `) t, t" S: j7 a' ]% Z
begin P_pick1 arriving
' k1 e2 c {" E) v3 `" n set A_i to 15 E' d* @# U( y: V
move into Q_induct1
/ X0 w# q; q& M2 J- j0 ^. { move into pickaisle.induct1
& P' Z$ {# D* y while A_i<=30 do begin4 `/ R% S1 j# ^* n$ d
travel to pickaisle.con(A_i)+ E% i8 [+ X+ M; B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- V' z2 z0 q. \' k+ E
else wait for 10 sec
& Z5 @! v3 ]; G* `" {$ S* d. i8 t if A_i=A_leave then send to die3 Y8 U, d h' S& x! h* d$ \
else inc A_i by 15 O- S8 L& j. u; k3 m' ]; W
end
2 j) d) [# z# K2 w, C6 Lend
- p6 ~" w, E1 A0 }% ~
\/ n" H9 k4 Z4 G" v9 i% d( k4 ibegin P_pick2 arriving" L: z9 I$ R' H5 e
set A_i to 11
o- | x& R2 R* q, Z1 I4 v6 k2 c move into Q_induct2
& n3 p; k6 T) R move into pickaisle.induct2( ?# h2 S- t) {" [# n6 @% l
while A_i<=30 do begin
) e$ G3 N" j. }* n9 I5 _. ?1 ` travel to pickaisle.con(A_i). P' G# A. z0 d, I2 w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 k6 q0 C, Q8 y0 |3 r( P
else wait for 10 sec
% B) r' W" q/ ^0 l, J: H: \$ G& j if A_i=A_leave then send to die" g+ p* |, H" P7 L
else inc A_i by 19 Z. ~' A1 {" U4 I# V4 g! J
end
; |8 ]% @ h+ |/ D) ]2 m' I& T ]end5 g- m E( X( D( k; W- V7 g& P
, H, f/ o W9 {* J( A. _begin P_pick3 arriving( \' j' J/ {, S0 E! @6 x" H, C
set A_i to 21
- _2 d0 R2 n0 e1 _ K6 x) w* r move into Q_induct3' p, g0 s" Y5 n1 D/ v" f
move into pickaisle.induct3
% G) c! c# I8 y& W8 I: b, p while A_i<=30 do begin( s. ?0 ^3 o b! N _/ a. P
travel to pickaisle.con(A_i)
( b; R9 [; [3 [9 D7 e" l6 { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 e, v" G/ h/ q9 Q8 X& c
else wait for 10 sec! R7 M( q& u# H' t. l ^, @0 d
if A_i=A_leave then send to die4 F+ G9 l$ f3 G3 \( \( a! [) U
else inc A_i by 1; P B" `' A: }. i! t
end
9 ~6 j/ O3 v. A b5 m# n( {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,其它按你的 ...
|