|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 N0 {: K) V3 J% X
/ I' E- g: h3 ^1 W$ U我的问题是,在每个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! v7 E1 Q" Y. G( G1 E
; D- r/ w ^- i3 A' @begin P_read arriving' W& k7 \, a' r. v
while 1=1 do begin
, i+ ?6 S* x6 u. x6 F9 r read A_tote from "data.txt" with delimiter "\n"
3 d1 c) z! ^& ?/ V9 L; }% m0 f read A_time from "data.txt" with delimiter "\n", u `2 L; L% }# N+ O
read A_leave from "data.txt" with delimiter "\n". @& |- @3 a# ]% g
read A_picks from "data.txt" with delimiter "\n"
- b {7 j$ l0 G/ g, c set load type to A_tote
4 a0 |" z& n( ~' I7 ^ if A_tote="tote 1" then set A_induct to 1
, j. }0 m% o0 E2 a else if A_tote="tote 2" then set A_induct to 2: e* G" Y- E% t; [% E" H2 K# ~
else set A_induct to 3
) _+ j& i+ j4 g @; y7 n- M& q( x set A_i to 07 |( T' q8 o1 Y8 A: @3 C
clone 1 load to P_induction
/ ^$ _4 d+ K8 R1 Z/ O& ?% L wait for A_time sec
* j3 e0 w7 m3 w; d# c* @! ? end* L6 O! ~& u" l; J* {
end
4 r( C! V1 E/ Y* e7 @% J( Y: S
" o" u& e! B* x. U- [" H1 Q; i+ X+ hbegin P_induction arriving3 i6 {7 A' ]; h
if A_induct=1 then clone 1 load to P_pick1
2 T" y+ H9 p; A r( W9 Q else if A_induct=2 then clone 1 load to P_pick2' x S6 I$ P: _+ t" q! J9 k7 L
else clone 1 load to P_pick3
" [. `6 G& l& l8 M- \. I9 fend" s1 m: p- k, I( B2 ?9 U
3 q& J# T$ ]2 K
begin P_pick1 arriving
# x( \, Q" m' n; m1 e7 W0 l set A_i to 1$ J" a9 j5 D# }5 J) o! f" y: O3 {
move into Q_induct1
; i" m4 ]% ^1 b5 v/ p5 f4 p move into pickaisle.induct10 R& n% C$ ^$ f$ ~
while A_i<=30 do begin
( J/ H9 A5 x$ g& t1 A4 f travel to pickaisle.con(A_i): _5 P" _6 N+ _7 f/ R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ c/ g# W+ x3 \
else wait for 10 sec# p* o. o. d2 J1 J
if A_i=A_leave then send to die
9 `6 Q S8 D+ ~ else inc A_i by 1
* W0 T, L4 G. R9 L end( T* a& \% Z; U( x# H
end: m' ?. M* v% h% u
. x9 l* q6 j1 mbegin P_pick2 arriving$ [+ J4 I* S/ z
set A_i to 11
( J2 c# z% z2 s move into Q_induct27 k' D: w: ]# K. o! [$ ]" q. p* h
move into pickaisle.induct2
# i% |2 a! d5 E9 [+ R& C3 x4 G4 r while A_i<=30 do begin; P- E) O* d( H0 m
travel to pickaisle.con(A_i); W: H Y. b+ I5 {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ E* }. ?8 B3 V1 x else wait for 10 sec
4 F j/ w* E2 x4 @/ _ k: H if A_i=A_leave then send to die( E; k& z* |' b! J0 b* \: A
else inc A_i by 1
; e! ~' n/ v8 y m end+ T4 b. w9 u2 Y/ {5 r: [
end
/ t. U; W/ N0 Y+ Z+ ^5 T# y8 y+ e+ R3 J
/ q, f8 m. X8 l0 _7 Y7 obegin P_pick3 arriving
- q; i0 S8 e1 l. S: h" C. ] set A_i to 21
. {! T. d4 V: Y" B- U; F3 N. }5 T move into Q_induct3
# P1 p* ^: [& P; ]% l& p( w9 @ move into pickaisle.induct3( |% s* |1 z' g! w. t
while A_i<=30 do begin
* N$ m; w! O& i, j travel to pickaisle.con(A_i)1 _: z. Q0 U2 d5 t) b4 W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. S# ^$ B+ e/ j& o1 G else wait for 10 sec
9 @& P; L7 v" Z( D- v- g/ l v if A_i=A_leave then send to die
8 Z5 f+ s j. o% c4 u4 R* N; _: u( Y& `+ Q else inc A_i by 1) x* }8 ^9 ?) N0 K8 V/ J" W
end
6 ?0 J# X- T# Vend |
最佳答案
查看完整内容
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,其它按你的 ...
|