|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- U# y: F3 q4 x, K/ M
3 w# `1 f+ p3 r& {5 z我的问题是,在每个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中的数值,不知道会不会有什么不妥。, Z" s* d9 G& J5 F- x4 |3 r. b% U
0 }1 {; d* |, I! j$ b6 rbegin P_read arriving) Z, M4 D5 u x/ H' y% I
while 1=1 do begin
+ u) E" N+ ^8 c" k' I1 w! t0 o read A_tote from "data.txt" with delimiter "\n"0 I2 {- e0 k% }7 j% T
read A_time from "data.txt" with delimiter "\n"' r3 t6 I# |5 S) `5 d
read A_leave from "data.txt" with delimiter "\n"
$ I9 b# O0 V8 C, G2 R read A_picks from "data.txt" with delimiter "\n"7 l) K* n* W, w$ m
set load type to A_tote; ^- g0 Y9 s: d7 e# {
if A_tote="tote 1" then set A_induct to 1
9 I9 n' q: a1 @5 R5 G; s else if A_tote="tote 2" then set A_induct to 2/ P: ]8 ~0 \, e: W! F
else set A_induct to 3 3 N ~" d5 y" N
set A_i to 0. s. ]2 r0 k' S2 K
clone 1 load to P_induction
0 m- [- R3 C8 \+ L7 y+ I7 u wait for A_time sec" g9 h/ ?" l' j! Y1 h: ~3 W
end. S n' o* F- Q
end
+ I! C$ j$ s, s6 q. O9 G( d$ M O3 t" J. v4 k5 R5 X P# e2 A y
begin P_induction arriving
+ n9 m! @/ o$ r# l$ S$ Q/ e if A_induct=1 then clone 1 load to P_pick1( h! V8 a+ }+ h9 ^: h* D [
else if A_induct=2 then clone 1 load to P_pick2/ ~/ w9 u+ h8 A: e
else clone 1 load to P_pick3
8 F7 z8 w# L+ d' l( @end6 q) H( _% W" j7 Y. @7 @
' b0 C5 P( Q5 b) ^9 p7 jbegin P_pick1 arriving
9 p, s" A; h2 I/ h set A_i to 1
8 l* {& z& K. M$ V/ W2 y move into Q_induct18 E+ p& j) }& L9 W' e# s" \
move into pickaisle.induct18 X8 u+ J, c; B1 o
while A_i<=30 do begin4 c: C! A$ S/ q5 l! y
travel to pickaisle.con(A_i)
5 K& l0 F n. a9 x8 V1 @7 _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ ?7 b' |3 s7 X, ?7 P" _$ ?0 } K. m else wait for 10 sec* p3 [; T4 s1 p0 ^4 L
if A_i=A_leave then send to die
+ P' z9 B. q! t; J; e else inc A_i by 1
/ W" W/ C8 {' p: ~) w9 j# Q end8 x1 u& Z/ F: [! P% d
end
% ^/ f! K: \. @, a& [5 }; Q* H3 A+ F$ o
begin P_pick2 arriving
) G4 S, c# n: x5 v set A_i to 11
* Z% c. K! J2 x move into Q_induct2
# T Q. P9 J6 \% h2 C! s7 Y3 k move into pickaisle.induct2. A( d0 \: Y* T N' u! B
while A_i<=30 do begin) `6 h( J4 p& @; s
travel to pickaisle.con(A_i). z+ G$ E$ s8 c3 E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 B I% @! x9 _$ i" P I8 h else wait for 10 sec
0 Y; B' r3 s' ]" i7 c+ k if A_i=A_leave then send to die3 v4 I1 R: Z8 r
else inc A_i by 1
+ o0 f# [3 v& q! F1 |& t- ? end
, d; |! \% X5 E( n& C( ?end
& B$ K) ~9 J; z* P9 {. S& h) S# H \0 \2 l2 z- l) \+ `. S
begin P_pick3 arriving& c' t/ T H4 T; D
set A_i to 21, W9 g4 d; {/ i
move into Q_induct35 `8 V: d+ F9 I b
move into pickaisle.induct3( }2 m/ D9 s- T6 L- `
while A_i<=30 do begin
1 A. m; n& r2 U/ v8 u. J5 Q travel to pickaisle.con(A_i)* T/ m0 K, K' D2 o/ P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 H$ M9 H& q5 {9 b else wait for 10 sec
7 v* s" V& _* G q' d* G if A_i=A_leave then send to die
9 g0 j. k" _: ^2 f/ G" a4 w else inc A_i by 1
! P9 }, ?. \1 [, \- `4 N& e: N! v end
. J8 d2 i- e7 T5 T ]; E- j Iend |
最佳答案
查看完整内容
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,其它按你的 ...
|