|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 J2 T% ^/ ^! \8 d
; N( u9 b4 Q+ w5 i8 M! V3 {我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) ^2 @, Z# Y$ c( a, x$ Z# j
, U+ G( }3 X4 F# q9 `5 G; z; w& J- k3 Nbegin P_read arriving
2 D( q( D( k0 A' c* E$ W while 1=1 do begin* G, Z4 N2 M! J2 c! i
read A_tote from "data.txt" with delimiter "\n", a: X1 c* S1 t( c0 c
read A_time from "data.txt" with delimiter "\n"
: J3 i2 }9 S# u! L& h& z read A_leave from "data.txt" with delimiter "\n"8 r8 Q! \9 w( k" B8 x% n
read A_picks from "data.txt" with delimiter "\n"
. S7 E& | x# r7 _. V9 B set load type to A_tote
4 M4 \' Q* X/ p+ ^" E/ w( H if A_tote="tote 1" then set A_induct to 1( ~+ g! d8 p+ m5 v: n
else if A_tote="tote 2" then set A_induct to 2
& K2 `3 g5 S6 k else set A_induct to 3
( z& A/ ] k* l# g, W5 x& i/ z; F set A_i to 0
, l3 B% r; S; l clone 1 load to P_induction
, G) b& \! G, @ l4 \: I wait for A_time sec! V. T4 ~/ P1 N' x' Z! h$ k
end
+ G. V6 m& L5 V, R' Dend
9 L! t8 b" t& z) g- q! L5 I+ k+ |
3 X& H }( X, U4 T0 x) Q1 X0 hbegin P_induction arriving
1 H6 T/ |$ N O# R- T. T* E2 b if A_induct=1 then clone 1 load to P_pick1
6 h, Y0 |; `3 B q5 c( g" l @' a$ _0 a else if A_induct=2 then clone 1 load to P_pick2
* |$ f3 @" [, D else clone 1 load to P_pick3
3 a4 N' @0 S+ d8 rend
/ m/ \- j- {; f5 L2 P m! T- r5 t" t5 W# v7 P- l" K8 j& o
begin P_pick1 arriving: N$ D6 G4 H0 u- w: P
set A_i to 1
2 j5 l, p! m% }* w9 u( i move into Q_induct1
/ ?4 T+ ` M# Y move into pickaisle.induct1
7 e8 Q! G% Y( v* g0 I while A_i<=30 do begin
U' n* q0 i( [* n travel to pickaisle.con(A_i)! x9 D. [- A3 ^$ T! E* }; t. d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, s) |+ Z2 j0 P" M7 x: ?
else wait for 10 sec
5 A0 ? D3 b8 K if A_i=A_leave then send to die9 m* d# b3 d7 o( q8 C
else inc A_i by 16 y" j" C* g. i2 b# [9 U* S
end
& X0 T2 L/ u% Q* B/ V6 lend8 r: l8 B# C: R9 `. E' ?
/ B/ T, G7 d. N2 J$ `+ ~
begin P_pick2 arriving
5 @' g9 ?9 d) F& d0 F7 l set A_i to 11+ t6 X, p( a. k) D* x
move into Q_induct28 h9 v# z) r z, Q, Z, q A" }
move into pickaisle.induct26 N$ B3 a) N; b8 l: S8 W4 n
while A_i<=30 do begin
. D- ^, ~3 t7 h# {+ x w" x travel to pickaisle.con(A_i)7 C' `0 M) J+ ~: b0 F5 Y; a8 J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* a8 }0 ^; c! I: \" D) A, D
else wait for 10 sec0 l0 p. n% t& A6 |
if A_i=A_leave then send to die
* c8 f3 h$ W& l% m. e; I# T else inc A_i by 1
% d$ \8 B/ s& a+ s3 ^, g* a end
! [) `- ?1 L2 z ~- \3 y/ f2 m) A0 v% Gend1 D& ~& r; L; a7 i6 h3 M
$ i# {% h) M' |' ~$ j6 ?+ ]8 s& b
begin P_pick3 arriving
" @7 }5 H- ^ C% X: w set A_i to 21$ K/ n$ b" g" m
move into Q_induct38 m ~& a6 A. H6 W5 m
move into pickaisle.induct3
+ m" d" k+ M/ g; o while A_i<=30 do begin
. t' |8 l, x) v: w travel to pickaisle.con(A_i)
9 w7 R9 w: Y2 {0 D. O. s$ } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! Y9 J. R/ U$ }* I6 n else wait for 10 sec
, \. _+ d1 _* p. v# S0 n if A_i=A_leave then send to die
f6 o" ]* i ]( c# V& y else inc A_i by 17 n8 Y7 }: Q8 L% V+ Q0 a% Q; D* G% w0 o
end
2 S) H" [, |: _1 N5 n9 T2 bend |
最佳答案
查看完整内容
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,其它按你的 ...
|