|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
f& S5 e0 i) o* f; U$ e6 P+ ~- p2 K
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 h B' y6 M Q6 Y% Y/ q5 e' \' i* e" G
begin P_read arriving
+ r# p5 M# S: w, j while 1=1 do begin
' S& ^; \' b' H2 \ read A_tote from "data.txt" with delimiter "\n"% T( R% Z8 F8 Z
read A_time from "data.txt" with delimiter "\n"
' {0 G) V) D& K7 l* v; @ read A_leave from "data.txt" with delimiter "\n"
; V# K9 s6 u6 h) d4 K& _8 b4 p read A_picks from "data.txt" with delimiter "\n"
, z6 E" u1 _- w9 G o set load type to A_tote) }4 R( Q) g* S
if A_tote="tote 1" then set A_induct to 1
( F0 N/ M I+ ~4 B else if A_tote="tote 2" then set A_induct to 2
% j, g/ T6 B- l else set A_induct to 3
1 t; ^& _2 B- m8 }7 _ set A_i to 0
! j, M7 f% b$ g7 t clone 1 load to P_induction
2 U9 b3 u7 s! b5 `; W wait for A_time sec
4 v9 V( S5 ~7 V* u end
2 s h& y' f8 Z7 Lend/ `/ P0 B H9 |) |6 u
. i8 x. S# A! ?( Zbegin P_induction arriving4 x" T% |4 Y1 Y; y" \
if A_induct=1 then clone 1 load to P_pick1
, x, |5 d% N5 }) M' q else if A_induct=2 then clone 1 load to P_pick2: k0 u z1 }7 l6 I
else clone 1 load to P_pick3
( p. S1 |6 C3 P5 ]4 iend* N: V, B# T; O% d1 K5 V9 U
/ [+ W: q8 B3 u/ \
begin P_pick1 arriving' g- I% [. y* L+ \$ U r
set A_i to 1
2 ~3 J, z- `0 D m- H; t move into Q_induct1
1 g! y. I0 m7 L7 p) u move into pickaisle.induct13 Y' d) ^9 q2 k: A7 |4 w6 \& e
while A_i<=30 do begin
/ p' u& i, r9 z$ o travel to pickaisle.con(A_i)
* m# |1 ]# o8 o% x5 d7 c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ A& O2 z6 C" w else wait for 10 sec
6 S6 g4 {) P! d% | if A_i=A_leave then send to die
) t2 @2 K. O4 r9 d+ f else inc A_i by 1
' q2 }1 \7 Z+ S2 W# H3 A; U! z end) |5 ?5 G* m/ x$ s/ B k" I
end( T5 m* |2 L9 a" D, r: W
( d$ T6 c. D& Q
begin P_pick2 arriving' j3 x) k" k8 p
set A_i to 11
; I1 y4 g! F4 o8 f move into Q_induct2( `( p" N' j$ ^! T" W: p% {
move into pickaisle.induct26 L* R* Z1 q( h c) f1 A1 y7 ~! L
while A_i<=30 do begin
" P, e7 d1 e! i0 e& j0 m travel to pickaisle.con(A_i)6 P' h. w; q: _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 B6 C! {3 z( a
else wait for 10 sec' u) H" g# P/ A" h
if A_i=A_leave then send to die! {4 ~3 V: C+ c
else inc A_i by 16 H1 K3 w p# F+ U
end
# G% W+ u3 F, q& ?end% u2 s% l/ ^; y) p4 u' D: @8 ?" a
7 i/ L O5 Z- @5 |begin P_pick3 arriving
1 G$ c# S" H2 F* L4 _8 s set A_i to 21
" `1 ^ Z' l2 ?! T move into Q_induct3% Y$ J' x" v" T! I% o7 w; C8 t
move into pickaisle.induct3
6 X; p$ v6 v7 {" O) ?$ d while A_i<=30 do begin
4 W0 t0 M( m% m# Z3 s# E, ^ travel to pickaisle.con(A_i)
6 ~) U% o, c" Z5 K/ p2 L8 R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# E! a- ~* ~, H* Q" K7 w$ O5 k! X. g else wait for 10 sec6 v) N2 L0 C G# S
if A_i=A_leave then send to die
I; S/ e# F7 J( o else inc A_i by 1
! j# e; T m; ?) b) y+ ~ ^ end
* ^7 E9 x! k$ ~$ ?( K/ Rend |
最佳答案
查看完整内容
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,其它按你的 ...
|