|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; L( T* B1 V+ g2 ]$ q% Z
" Q- l5 v: J c- Z+ }/ U$ F我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 ~2 {' q- Y2 a+ Q9 C
( y$ c/ u7 M: l5 g5 ^
begin P_read arriving/ i4 `5 s( Q' i+ e; c- z
while 1=1 do begin
A$ R( o! v; @5 f q8 \ read A_tote from "data.txt" with delimiter "\n"7 G( O' W! n/ Y5 J* q5 F8 i
read A_time from "data.txt" with delimiter "\n"
- I7 U% s6 e- r1 ?+ U V4 O read A_leave from "data.txt" with delimiter "\n"
/ ?9 W# r C6 k- t0 V8 k4 _- y. w read A_picks from "data.txt" with delimiter "\n": S8 D! ]. F1 Y4 I
set load type to A_tote4 u1 z9 U% N) ~
if A_tote="tote 1" then set A_induct to 1
' l: [ m" {/ d6 Z }( F else if A_tote="tote 2" then set A_induct to 24 h' R. y# |5 A t
else set A_induct to 3
9 c8 g9 d2 z# s set A_i to 07 d# K/ q* }- q) Q5 s4 \
clone 1 load to P_induction
b+ ]6 Q0 t: y7 f1 p+ q( j* P wait for A_time sec' J* ?0 G! O9 T; s
end
$ W7 R/ b" Q0 I5 `4 \# f$ M0 Mend
- P% I. j- C! D5 z. V
" c' B3 i/ l7 Tbegin P_induction arriving7 v! {* D) |7 a
if A_induct=1 then clone 1 load to P_pick1
7 ?' }8 I. U7 U" x6 M* c. k else if A_induct=2 then clone 1 load to P_pick2- t+ X! `6 h) r# {( F0 ^) K! ]
else clone 1 load to P_pick3
" @$ M# e+ g7 \end
{0 P2 _/ @/ \
# L+ }, E$ G; R& R; p+ W5 Sbegin P_pick1 arriving8 u% j/ ^/ h4 L" j6 s2 B( r, G. O- C0 X' X
set A_i to 1
4 L1 M4 x9 o( V move into Q_induct1$ i4 c1 P# @. d9 T2 M
move into pickaisle.induct1
' E+ C+ x0 E3 g( Z) `2 v while A_i<=30 do begin
/ l( z% M+ b- _' S, g4 r( H travel to pickaisle.con(A_i)
& S: j# S8 l# A1 G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ x7 v3 k4 p% {# h
else wait for 10 sec6 \- t- n+ Q* ]0 f9 O2 E+ L
if A_i=A_leave then send to die9 G' e" j. J, A5 v! H
else inc A_i by 1/ c* @1 ^" j* D! n* }& h3 h
end
' ?2 z% x! p6 o+ k/ |* B$ Nend$ Z! X" q+ e* W3 y* P
# o# T9 e: P0 |4 w/ \& i
begin P_pick2 arriving
1 \1 |6 E9 X% j set A_i to 11* g2 ?% g# w! |6 S! W/ u% o4 K
move into Q_induct2
, i% {/ j+ s4 ? move into pickaisle.induct2& k; o. d3 E* T; K/ b
while A_i<=30 do begin' _- t1 q1 \0 Y t! d
travel to pickaisle.con(A_i)
! ]2 u2 N( Z5 B1 P+ P4 E% a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! E- U' f/ A D3 T% Y
else wait for 10 sec) O: E" s: x" o- w W) y
if A_i=A_leave then send to die" X1 r; _: W7 _7 v. C$ a) G6 @+ W
else inc A_i by 1) r$ L- N. n; H8 G' h
end
0 ^3 e( _' `3 U6 c, j" w% {end
" P) K' K/ L; H7 y- F. C0 s: v% U4 e0 Q" l5 v
begin P_pick3 arriving1 m o# ?" l0 p
set A_i to 210 e$ V- v* X3 h O
move into Q_induct3
7 S+ C$ F, ]% ]5 y* F& A! C move into pickaisle.induct3; |3 q' e# q1 @! u- h* X7 y
while A_i<=30 do begin/ h, [, Z: U8 j$ p# I
travel to pickaisle.con(A_i)
6 W/ b1 u% D! I+ P* x: N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' E0 ?5 P' \8 J; h
else wait for 10 sec
% e: r8 x" D% P: t3 M2 d1 m if A_i=A_leave then send to die- ?* v9 z$ j o7 b @0 N! a# \/ s$ Y
else inc A_i by 1
8 `+ g, _ a2 h end
; z0 J$ U4 O* L& c+ u0 jend |
最佳答案
查看完整内容
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,其它按你的 ...
|