|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 i5 M7 p5 J+ ^) D. h! I
* q) L+ g% C$ Y7 O/ W我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" |4 g" k$ B" W% Y& H* T. l) m7 X3 t* i) k5 p) P
begin P_read arriving7 l. @3 O+ P# k, m
while 1=1 do begin
( `0 b8 k; `0 K/ h7 A. s read A_tote from "data.txt" with delimiter "\n"5 C0 A0 k8 B, t; v* a) A
read A_time from "data.txt" with delimiter "\n"
: e2 F/ _3 a& @9 c" T) m read A_leave from "data.txt" with delimiter "\n"& q+ N# |4 z d# s% a$ z
read A_picks from "data.txt" with delimiter "\n"
6 U2 \3 ]/ ^8 \1 E. t set load type to A_tote+ h5 X1 Q7 o" n2 Z; X
if A_tote="tote 1" then set A_induct to 1
9 Y/ P# i/ G' `0 \9 W; C) \ else if A_tote="tote 2" then set A_induct to 22 B' ~: F3 a8 {8 W9 O7 Z( X
else set A_induct to 3 7 \) j& O [1 a# ^* v# _
set A_i to 00 Q5 M) e, T; W* i1 y& g/ a0 _' j
clone 1 load to P_induction
, _5 t. ~* ^2 \& R7 s9 @ f wait for A_time sec
" l# `' Z: G( s# {0 J$ e end
/ j- t H" o1 R8 H! @. E$ cend
) x0 F/ k! e2 \' V8 R0 i, [8 X$ B- _$ Y* x" a
begin P_induction arriving; O0 V2 P" r$ |
if A_induct=1 then clone 1 load to P_pick1 f& C5 c: L& N3 Y4 k& x' \* F8 U
else if A_induct=2 then clone 1 load to P_pick26 t& B1 G+ ^( T; g7 [
else clone 1 load to P_pick3
: u+ m# ?0 o" P6 Y2 Y! [1 _& [end
4 J% Q9 i4 Z1 z% O, z Z0 b* X1 ?- g6 Y% L# g% d U5 B
begin P_pick1 arriving" A& r! I8 P4 p- z; _& ? y5 n5 e
set A_i to 1
, [ M: z; L6 o# n/ b! z5 _ move into Q_induct1- l! F, {% N7 \6 D# `2 D3 z. w
move into pickaisle.induct17 o* o1 e+ @3 K
while A_i<=30 do begin% f! I8 w) ^) b6 e& }" N5 w' J) T
travel to pickaisle.con(A_i). e0 H* L/ ]/ G6 |; g8 w) X, c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ \& f- \# }& t. G+ |+ i else wait for 10 sec5 f* M2 G8 `) [5 l) y$ r8 V2 P9 v
if A_i=A_leave then send to die# m; O3 T+ o" t- h
else inc A_i by 1
4 d- x* B: @4 B! J- G5 R end5 G9 `- M; w E
end( _2 _4 G7 U* [9 I! }2 |1 z
( H5 o8 L) V8 r& t
begin P_pick2 arriving
6 @# T7 |* i( t0 ^; ?! ^ set A_i to 11
$ i2 _+ F9 \1 {+ T move into Q_induct2
/ ?6 h! e/ K& l9 T( g move into pickaisle.induct2
7 ~' x5 I, f( a' l* H) G while A_i<=30 do begin
9 \: a! q/ h7 s6 P: P8 t' J8 t# w travel to pickaisle.con(A_i); F! o# u, g% m# r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( y. K9 j# |8 j+ } else wait for 10 sec
' y- a' l8 E$ f if A_i=A_leave then send to die
7 @. t! X0 ?3 m& @ else inc A_i by 1' P0 X3 B! ]! ?8 \' {+ T
end
& ^( `% q9 `+ j; J+ A, fend
/ B% R9 P+ W3 p4 {
% Z4 b8 K |1 c% i- jbegin P_pick3 arriving {2 w3 |; k9 e( G% \( U
set A_i to 21
% P# R V) A9 X move into Q_induct3
1 K' h. A. Z" p \ move into pickaisle.induct3
- E# K8 V/ d; P while A_i<=30 do begin
- D, |- E# @2 G+ s# s+ n# h travel to pickaisle.con(A_i)
, b9 Z1 _/ t3 w8 N2 b* Y& n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec L2 ]5 f3 e" } r1 E( v+ Z
else wait for 10 sec
: m. j! {8 u* X e9 d if A_i=A_leave then send to die5 Z7 ?. b3 \1 f2 E0 R$ e
else inc A_i by 1
# w. g! O5 `/ ^4 k end0 } F. L3 g9 E# \ O
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,其它按你的 ...
|