|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 R: t/ p) r7 J, w
. V2 |4 o( \' J8 R* 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中的数值,不知道会不会有什么不妥。
( q- H1 l* |) [( @4 ?# J6 L+ p
' q. ]4 d4 ]; d# Cbegin P_read arriving; R0 r# Y! I5 _" U4 E+ U
while 1=1 do begin
o8 _9 P( \8 { read A_tote from "data.txt" with delimiter "\n"4 V/ a/ W q; h9 E
read A_time from "data.txt" with delimiter "\n"
2 @. v) B" b6 l1 F7 Q$ e: ? read A_leave from "data.txt" with delimiter "\n"
0 x, c; D) l1 @& K read A_picks from "data.txt" with delimiter "\n"+ ]+ l, o, |7 ^/ v
set load type to A_tote: ^; j( H0 Q5 s* E7 X
if A_tote="tote 1" then set A_induct to 11 f6 N* U/ G$ k
else if A_tote="tote 2" then set A_induct to 25 o* \2 ]: T5 C) U' o
else set A_induct to 3 & U% [9 \2 G1 A5 J) r8 Y0 g$ Q& @# @
set A_i to 0
& x& |8 s9 a o# `8 i* d# M clone 1 load to P_induction
3 a( ]) k& d& p( l" _" z wait for A_time sec8 _2 @ n6 V: Y0 u0 r" b
end
* X9 R }1 G xend; s5 L% p& k+ Z! S* v& Z+ D
7 y7 F2 O/ D, Z `begin P_induction arriving2 ]$ V, S- o: Q: A @. ?
if A_induct=1 then clone 1 load to P_pick1; O3 L. _' @% x8 d
else if A_induct=2 then clone 1 load to P_pick2+ c8 y: H' V% a( l
else clone 1 load to P_pick3) ~4 E) W1 B5 J1 _& p3 V" _ K1 a
end' l/ E: V" `* N2 G
% L) K+ z3 u4 obegin P_pick1 arriving6 N" b5 _0 \( l1 G$ k% T
set A_i to 1
0 t# c$ m/ G) t move into Q_induct1: U6 f6 m, B5 ~3 F( t
move into pickaisle.induct1
" W3 G6 q1 _7 y& c2 u/ e4 g6 O, j while A_i<=30 do begin
0 U5 ^& G: U% J% v$ ^& M travel to pickaisle.con(A_i)
3 |" ]* `, X" y( n# H- G# t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) E/ H% ~# S4 U3 t/ m$ | else wait for 10 sec
: Y5 a+ k5 G1 f/ c) D" M$ E if A_i=A_leave then send to die% b0 ]) |+ f. A) R# T; x8 D
else inc A_i by 1
% S) I9 a, E% `0 w3 v9 L end- ?# H1 b% W+ K6 b, v! \* K6 o
end
; Y+ q6 j; f B; I& e7 {" w1 {0 @$ s
begin P_pick2 arriving) @0 l$ R0 j6 Z9 J" s7 z) r
set A_i to 11# d v. L( \, y9 ^- {
move into Q_induct2
. M) ^' l4 P { move into pickaisle.induct20 \9 t- Q D' J6 G) A9 w6 Y. F
while A_i<=30 do begin
. h/ d) w" d5 f1 u" K! e travel to pickaisle.con(A_i)9 R6 g- W' ?, t: t- g' X# h/ C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ S! V( b$ u, G; x& f+ W3 Q2 g4 p1 E else wait for 10 sec
9 l9 ?% V: P4 d! `" y if A_i=A_leave then send to die
" D6 B* t6 v4 y else inc A_i by 1* F! Y1 M) `% C' I
end$ b" T+ F. [8 G+ H: Z1 t) m
end; \0 U/ V" c6 e' t
7 B3 d2 Q3 ]4 i; S5 b. q2 c
begin P_pick3 arriving7 T+ S/ `- S3 g: e
set A_i to 21- X# S4 J. o( w) R8 X3 k# x) W S- O
move into Q_induct3
, {$ \: y. E2 [" J6 C move into pickaisle.induct3
2 c8 T7 P+ P F! v2 i% Z* b while A_i<=30 do begin
1 T! w/ _; i7 J2 o travel to pickaisle.con(A_i)
+ [* t3 g" t/ t {5 w/ ? if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' E8 Y( Y. @* q' H$ @ x8 p5 \
else wait for 10 sec" u! D3 ?! s1 I1 h
if A_i=A_leave then send to die+ {/ u' y `6 Q2 h% l2 \* [2 J% V
else inc A_i by 1: |5 Y* G" v/ X# |- B
end
' F7 G" b0 }5 l- c$ _8 H6 b, L* lend |
最佳答案
查看完整内容
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,其它按你的 ...
|