|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 G7 p. x( Q$ P& {7 Q# c) V9 l3 v) c; f2 Y, M0 G* y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。" L! W( _+ r7 @' w1 c, t. [) }
% O9 Q* A/ ?; a$ q; c: F. Lbegin P_read arriving
/ L4 t- [$ T5 p1 l while 1=1 do begin
2 L3 O8 h" j; l9 A5 N; h5 f read A_tote from "data.txt" with delimiter "\n"
. w% ]$ O$ t, E' k3 P& j read A_time from "data.txt" with delimiter "\n"
+ l2 T6 u/ l% A, K5 M2 \6 @ read A_leave from "data.txt" with delimiter "\n"
( P- @; a ~& [; u/ O" m& L read A_picks from "data.txt" with delimiter "\n"9 m% f0 P/ j* W; t% M0 D+ |
set load type to A_tote0 y: S7 G7 z* \% \: o
if A_tote="tote 1" then set A_induct to 1
) H; `9 c1 G9 _; W0 D' _( a, v; ]" C else if A_tote="tote 2" then set A_induct to 2$ p% ]$ H+ d4 @$ ~9 v J) i& ~
else set A_induct to 3 3 Z& M% S) }+ C
set A_i to 0, O* j9 u5 D+ d: A5 M) R5 L' ?7 `
clone 1 load to P_induction
! U. k# N) H; U( n1 w: q& p) i wait for A_time sec$ i! M+ N; F! B* P
end
* O3 G9 O% k% G: b8 y6 ?end/ Z+ t! I% r! k M8 E- T
" i) S7 {% B+ y% y+ r8 R
begin P_induction arriving F: J. q8 T9 L
if A_induct=1 then clone 1 load to P_pick1
3 j4 `+ c+ X0 p X7 H# O3 W, o else if A_induct=2 then clone 1 load to P_pick2
; P: m5 O$ w9 g0 A. `- @. O" @ else clone 1 load to P_pick3
, }; b! Q+ n. Q" U! Lend
3 J# X% c$ f. q% s# \1 X' _& T: X
( {3 [8 z5 y& J3 Hbegin P_pick1 arriving
( [' Y$ y T- c set A_i to 17 Q3 S. q% }& t& w) X
move into Q_induct10 T$ }* H& p/ [9 N/ O0 g3 C
move into pickaisle.induct1
S2 u2 a) v& t while A_i<=30 do begin
% d1 K! i5 p) T! i' E | travel to pickaisle.con(A_i)
6 U$ P6 i7 b: E- H1 [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' F% B) b+ x C6 J else wait for 10 sec
( ^& N2 q6 H% \' n" [ if A_i=A_leave then send to die# r' y ?* z1 y3 I5 [+ E8 N" u5 z
else inc A_i by 1
8 I8 L+ L) A7 `7 y/ g/ p end
# B/ [; N' l$ cend
# w5 }/ m% q7 X6 t0 X/ A2 F* w$ l3 `) u, B7 D
begin P_pick2 arriving1 O; L" L! ~9 F# W" S
set A_i to 11- Y" c3 x, A5 G8 f8 d
move into Q_induct2
, |" i- c6 D6 E q* L N move into pickaisle.induct2
9 ~3 M8 Q, u \; }$ V6 d& p while A_i<=30 do begin
+ j4 Z! A) k, i" l8 [" } travel to pickaisle.con(A_i)
- m& D. y$ V7 [; m/ z) t# P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 V0 ? }0 Q" Z. z5 Q$ T
else wait for 10 sec
$ X7 V9 M! j! `1 y) n if A_i=A_leave then send to die
4 t+ A/ K# o5 [4 } else inc A_i by 1
0 s& R' P" ~" V1 s! A end; [7 P4 d0 Q7 V
end5 M0 X( h, x7 u, h% J) a
' f; i( `6 [, O$ P; _ W
begin P_pick3 arriving
) |5 y& H o" Z0 y+ Q6 M set A_i to 21
! x2 J0 L# @9 S" z. U2 D5 K move into Q_induct3- v$ _0 B$ ]* h# |
move into pickaisle.induct3
* \) m& l* T+ S0 \1 `! [4 i while A_i<=30 do begin
" _. x0 z3 K: ]4 n0 H7 q travel to pickaisle.con(A_i)2 H+ k5 Q% m/ u8 N& C- y/ Z$ o
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 q" A9 U- @6 s" n, O: Q/ q; `
else wait for 10 sec
; V1 b9 T8 U( }4 ?+ f$ P if A_i=A_leave then send to die2 Q* r' N6 L0 L+ @ Z. G2 z
else inc A_i by 1
* \2 C9 I6 J3 ?7 U end
" \1 P2 f" O5 |; N8 wend |
最佳答案
查看完整内容
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,其它按你的 ...
|