|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, W$ \% c* k" E* @7 r$ g/ @; I T8 z* ~8 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中的数值,不知道会不会有什么不妥。
/ R# n- T5 l' V6 s5 G% O% q+ B, `& z7 y8 l6 ^9 ^; J5 Q% s. u, Z. T
begin P_read arriving
5 }/ U# \% l1 K' f while 1=1 do begin: H6 T* l) V; m) E+ N( A: T
read A_tote from "data.txt" with delimiter "\n"
4 k6 m: t, k8 e6 t read A_time from "data.txt" with delimiter "\n"
: J* a, F7 n$ f' y4 K- {6 X read A_leave from "data.txt" with delimiter "\n"
1 K7 R. ]2 n/ O: L read A_picks from "data.txt" with delimiter "\n"5 S \- S- z$ a' c
set load type to A_tote
, t* s& r" P, |' l/ }. D9 I! Y% _& Y if A_tote="tote 1" then set A_induct to 15 q" d: m3 m0 ^$ `8 ?; s0 W1 D7 t6 G
else if A_tote="tote 2" then set A_induct to 2
6 P. \" U% c; S9 q9 R: \ else set A_induct to 3 7 L7 X! ^$ p( O1 P& _3 {
set A_i to 0$ P5 q+ k3 M8 S2 |# T2 k2 r" u
clone 1 load to P_induction6 v1 }- i( }% u
wait for A_time sec' N8 D8 E. J7 s
end! L! [1 Z0 @/ ^* k, A
end* |5 H# O: E9 a1 I1 a! ~$ U
7 Z4 e, z; }& Q8 H# u
begin P_induction arriving. s* \6 K$ s; K) ?# i0 }
if A_induct=1 then clone 1 load to P_pick1
* W9 }) P% X o; d: l else if A_induct=2 then clone 1 load to P_pick2
. ~9 @. i$ ^2 e" h else clone 1 load to P_pick3& }4 \3 w/ H" ^- B
end
1 \: s0 b- P9 u+ [* f* [/ y$ w% C6 `2 j
begin P_pick1 arriving
' M" q( P6 C: e5 U |& J& W set A_i to 1
O. Q, j' T9 f: w# [; b/ o7 h. { w) w4 t move into Q_induct1
# U+ ?9 m. m2 r7 m) J move into pickaisle.induct1) f# c4 J) D5 ^, ]4 r& l
while A_i<=30 do begin
2 r8 m8 |/ o' l6 ]4 L travel to pickaisle.con(A_i)
7 y# l# Q& o( A: p/ Q9 q2 \! | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( c* A* H" P0 l: z- q4 o- d else wait for 10 sec* S8 _, T; N; H, q, ]# ?. I, a
if A_i=A_leave then send to die
$ i: `! ~9 {3 {- g else inc A_i by 13 k! n4 L1 s( A% {* H, Q% a
end
4 N: P" z( l9 F+ v1 H- O* Xend
6 \7 m+ w8 a, b. ^" }
. H( F F$ \. K8 m/ R9 ~begin P_pick2 arriving$ F% D2 K. w( q0 n
set A_i to 11% o# n. b0 n6 q& T
move into Q_induct2
! H# t( I4 B3 C* o" H2 D9 j8 F move into pickaisle.induct21 e; D6 F! Q7 h9 |, z# E5 _
while A_i<=30 do begin# s$ e3 w1 J' O+ Q
travel to pickaisle.con(A_i)
2 x$ {, v' t9 L* _( V' E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" |2 G- J# ~# y- P% Q' M else wait for 10 sec
1 N! F" J$ `5 o if A_i=A_leave then send to die
7 A0 A; q5 Z, z, k# t4 ~5 }$ F else inc A_i by 11 M0 P p1 D' F: C
end
& s& y/ s6 n: i$ ~end
. i$ } d! H3 S8 ^ T! m! Z$ b
begin P_pick3 arriving
- g5 e8 s# P: H2 I2 L6 q8 o set A_i to 215 W" v) E. x( j z
move into Q_induct3, b- u5 `6 Y! W0 Y! Y9 i# S: q
move into pickaisle.induct3
# I3 z0 z9 H1 u, L) v% t+ j while A_i<=30 do begin: N1 x& K: F, ~1 D" ]
travel to pickaisle.con(A_i)
4 M) K! s0 R- k1 H5 ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 P) [" ^5 y. m
else wait for 10 sec+ ~' n2 {% j) G8 R/ p- J
if A_i=A_leave then send to die
7 E6 V2 m' F3 B! ?- N- R else inc A_i by 17 l6 C Z4 F3 z* G3 R
end* }! x- d/ O D7 _& C
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,其它按你的 ...
|