|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; P) P, f) f. Q, L9 Y" z# |% M% |: C4 s- q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 s+ p9 i* F: ?$ Q/ J
- c/ a: n! ?" V. x' u; Y- x5 qbegin P_read arriving( m4 l# X! n. G( L' z
while 1=1 do begin
$ K c5 y0 j. v1 g% X6 n& u ? read A_tote from "data.txt" with delimiter "\n"5 j3 J, ]# z1 `. T! a8 @' D
read A_time from "data.txt" with delimiter "\n"" L5 P3 c3 h, e1 _- T
read A_leave from "data.txt" with delimiter "\n"
0 G- D" ~% e( t" v4 n read A_picks from "data.txt" with delimiter "\n"
" {, z- \) u- p2 \* z set load type to A_tote( s$ ]9 a& a6 ?3 M+ ~- b$ b- B+ m
if A_tote="tote 1" then set A_induct to 1
( e/ P3 Q$ l R/ w% W& k7 s& C5 S3 S2 ~ else if A_tote="tote 2" then set A_induct to 2! N% q% N2 x9 R: B$ E& v" g
else set A_induct to 3 ( H% Y& ^: J; K( F! d( h" P/ F
set A_i to 0% k# `& Q; f- D$ T
clone 1 load to P_induction+ Y u' y) t% Q: h- i; I8 w ~
wait for A_time sec
8 D9 d# @. s" M$ A end
8 H# l: x C g* Pend
+ ?/ ^" d( r3 N% b7 f5 A* L# ?% S2 X2 l1 {
begin P_induction arriving
: W5 D) G+ F- B" U* H if A_induct=1 then clone 1 load to P_pick11 V) C! g+ B& h; o
else if A_induct=2 then clone 1 load to P_pick21 t2 F/ U- A( \3 j* I- O2 R) s; c1 m
else clone 1 load to P_pick3
# Y% \/ |% c) o8 L" Hend
3 H4 p( `& _4 j4 r* H/ `1 i( P( n- }7 E* j+ r' p
begin P_pick1 arriving
+ \2 l3 q0 z0 C( l! J7 \; |! E set A_i to 1) |9 B% J2 M. F: Z- p
move into Q_induct13 p( Y y* O" k: T' A2 d- R
move into pickaisle.induct1
* W1 P, z: `& u0 B while A_i<=30 do begin; r6 K5 k4 c9 G0 B. f# m- j
travel to pickaisle.con(A_i)
( l( K! C9 i y' F+ m7 r% L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 Q* v/ A) a- P V$ s% ~
else wait for 10 sec( ~& u+ T! P/ f- Y
if A_i=A_leave then send to die2 }) x' X0 H* r! z: L+ B
else inc A_i by 1
, E- E0 U+ `, Q$ g end8 R6 c9 j) d7 Z) F- W
end# m/ \2 ]. g b5 v
% [" N e5 _; m6 s; \- K8 d' N# H
begin P_pick2 arriving
* ^) Q, d0 x- Q" c set A_i to 11
) J% L* [" o& b. H- L0 b v move into Q_induct2
. i. e% x5 n+ O& G. K: |4 w6 ` move into pickaisle.induct2$ I4 _' s( T' Y3 t' `1 I, q2 m
while A_i<=30 do begin
! C/ B; i, L" Z6 P: u travel to pickaisle.con(A_i)
! H0 I( H7 q& v# A) m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) P4 P, T" r+ x else wait for 10 sec( u9 W+ j, c8 e
if A_i=A_leave then send to die4 K2 N* U6 K3 w9 h
else inc A_i by 1, X6 [( a" D- K/ f, u0 j
end [8 e8 w& l' b( T. x/ |1 I
end/ d1 e, x+ O; O
) z5 J+ r; ^" v4 m1 O% k% Z
begin P_pick3 arriving& \( e4 y8 j! E: O
set A_i to 21
4 E5 j7 ~ O( H, k move into Q_induct3
% @3 K; m# {* k7 E move into pickaisle.induct3
+ G$ p" |) R/ X7 k while A_i<=30 do begin4 p9 ^0 G6 Q! J9 T8 b
travel to pickaisle.con(A_i)# W4 Z- x6 Q6 z. V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, c4 U5 i" D- l+ U5 c8 y) c
else wait for 10 sec
; Q/ ? s2 }& U if A_i=A_leave then send to die( ?% k. }& y$ B9 q5 y H3 W+ F
else inc A_i by 1
/ s6 N4 u1 C4 {# N7 I) Q end
% ]0 H( v% X- d @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,其它按你的 ...
|