|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 J6 ^3 {+ n+ x- _: u0 U2 F8 Y$ t% X( l, M# X# B& i
我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ H6 i# I% B& H) B3 P3 E$ T& X
, `) W: L, T+ e* }9 ~
begin P_read arriving
d! V- h6 b) O1 b" I while 1=1 do begin3 g8 g; C! M( }( l
read A_tote from "data.txt" with delimiter "\n"& A: O9 x4 U' T5 |
read A_time from "data.txt" with delimiter "\n"
2 h; l5 s7 E/ |. Y$ V/ f read A_leave from "data.txt" with delimiter "\n"5 r- P9 v4 Z, {
read A_picks from "data.txt" with delimiter "\n"8 }# \" X) W4 J# Y6 n& u, ?
set load type to A_tote# z( ~! f; |* a3 o' Y
if A_tote="tote 1" then set A_induct to 1
0 B" M. K: A0 C else if A_tote="tote 2" then set A_induct to 2
+ w/ S* w+ u7 j) H, x else set A_induct to 3
% S0 p" M3 U* e+ m set A_i to 0
+ z1 @9 Y* P" R clone 1 load to P_induction
# A0 X* l- Q5 ?! M wait for A_time sec
0 a8 Z' X7 U: }" q end
: F; r1 m# |" M7 V* cend
U7 _7 u" h7 X* V4 z0 `( E; N) M; ~0 M4 b, a! G/ C4 p4 z
begin P_induction arriving- K3 j) `; n8 K) X: X
if A_induct=1 then clone 1 load to P_pick1
9 M7 j E0 k5 a( b2 T else if A_induct=2 then clone 1 load to P_pick2
; |! A3 M$ Y$ k' d' m1 ~0 Y6 ` else clone 1 load to P_pick3
1 I) j0 D5 z: f# rend# t/ ?( M: M1 b! D) K# W: j
0 O: L; p3 j x3 F
begin P_pick1 arriving
; d9 d1 ~# M# v$ @" b" W set A_i to 1
7 l9 x7 i* e, y* E9 ]+ U3 I* d9 ` move into Q_induct10 C! L: ]" H& g/ I6 Z( i) k
move into pickaisle.induct1" P: Q1 D1 o, k8 r9 [! s
while A_i<=30 do begin/ }4 N4 q# E+ _; x( F2 O8 r
travel to pickaisle.con(A_i)- X8 {7 g, @/ N6 c0 O, q, `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: ]) f7 i' B2 k! ?6 z
else wait for 10 sec
" d" I1 e0 n* z% J# u5 v0 p- f if A_i=A_leave then send to die0 G3 R1 ^6 r; ~6 e1 M3 g# J5 L
else inc A_i by 1+ v+ s- ]. c% g4 R
end
{& S9 w( S# r, Zend
% E/ ^* ~! N) D ?2 m( o1 f4 b& X
begin P_pick2 arriving
/ r8 o3 n1 e2 b set A_i to 11& a' @9 p5 P& U& G
move into Q_induct2/ `+ h$ S0 K: n& P
move into pickaisle.induct2
- x( v: j! G% A3 c# w while A_i<=30 do begin
: @* {* `6 \# h* m( s travel to pickaisle.con(A_i)
' ?" P: s8 e( b: W- I0 _+ K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 G2 b/ d ?% b+ y9 M3 n
else wait for 10 sec a+ ?/ Y5 L) k6 W9 F3 ^
if A_i=A_leave then send to die
1 b9 Z8 O2 x& b' o& s else inc A_i by 1
0 V. i' ^, b" ^( j9 I) {) R end
- {( d. ?+ o8 Tend
4 r8 p4 e" R% g& ^+ c2 L
; M9 a# X9 z7 ^0 @; |begin P_pick3 arriving2 M: j, S, x r |4 E( z! m. f
set A_i to 21
4 L9 y4 r/ S% G' J+ v move into Q_induct3
+ r3 W$ N0 H$ N# Z( ?+ h move into pickaisle.induct3
0 @$ T! d9 E/ r5 g while A_i<=30 do begin$ I+ Q! U6 u4 W' Z! a' Y
travel to pickaisle.con(A_i)+ r% ~' {* R# q5 c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" {' ]- M2 _) S( L N: l- Q
else wait for 10 sec
: x& _ E! x. {+ R) @ if A_i=A_leave then send to die5 R Y0 H' g7 S- f1 U4 g
else inc A_i by 1( W1 J' A7 W: L7 H- V6 c% s7 h
end
& E1 Z4 _& b* c% e3 y% m2 send |
最佳答案
查看完整内容
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,其它按你的 ...
|