|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# R4 i, [0 i/ \7 x0 k
' ^3 D: d- E$ B6 n+ D% J
我的问题是,在每个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 B; `/ N) W8 f- @1 n; {
; d3 u; H5 k( b1 J L
begin P_read arriving
6 F$ P2 a) R. A while 1=1 do begin' x+ G) Q% u6 Z- E; T- y
read A_tote from "data.txt" with delimiter "\n"
, M/ R: @1 ^; s( ]' u, {& z$ z! X read A_time from "data.txt" with delimiter "\n"' b0 `2 @8 ^/ j; i' O
read A_leave from "data.txt" with delimiter "\n" p- T) F& K% F5 @6 N
read A_picks from "data.txt" with delimiter "\n"& y; j3 @$ V* S9 ]+ k M, I4 @
set load type to A_tote
0 U" Q$ k1 o1 D if A_tote="tote 1" then set A_induct to 11 B2 P0 _( Y- _
else if A_tote="tote 2" then set A_induct to 2
. F# V6 c* v/ A& h- ?6 B else set A_induct to 3
, k% y% v6 u ]9 P! l1 J- V! G% d set A_i to 0
' k" f! u8 G% [- T8 X' q clone 1 load to P_induction
' z q W* a ] F& W, e- G5 R wait for A_time sec+ n/ e4 R+ Y$ m& E0 ]
end
4 t* I! E$ [" P# a' pend
+ P. F5 Q2 X2 F+ j* U- K0 U
6 d- M3 B8 i/ F( H9 G0 pbegin P_induction arriving( P: w9 d7 c5 D6 m
if A_induct=1 then clone 1 load to P_pick1
( ]. B" {7 U& j& Y X5 q& G else if A_induct=2 then clone 1 load to P_pick2
1 \# Q3 p( {( { else clone 1 load to P_pick3 o, W8 E8 G" n, W$ _4 c" _
end' I# u& `1 q" h
9 K/ V: \6 t: w* @) I5 Y J% zbegin P_pick1 arriving; d% K# a, v6 I
set A_i to 1
0 D, p1 q" r9 z6 v& v( F9 ~& f% i move into Q_induct1: S& g5 s3 n8 t: h0 [( {( _+ U
move into pickaisle.induct1
$ q) F: c9 ~' L( q+ Z5 k while A_i<=30 do begin; z1 h3 S, m4 l" n& J$ d
travel to pickaisle.con(A_i)
( l2 u7 E! f& W! h7 q/ e+ k+ v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ _3 |* o W# @, ]! E0 L& L
else wait for 10 sec6 v) _! T. P6 z' i9 G
if A_i=A_leave then send to die
: j7 ]* G7 {1 k. x& y" Y: X else inc A_i by 1
, F( h o6 {$ c! T* p+ K' p0 g end! V* ?, a, G6 W3 B
end0 D6 E# @, _# E
: U* j( ?% o. tbegin P_pick2 arriving
1 ^& E( Y( ~" a set A_i to 11
2 V1 L' _( |8 t move into Q_induct2
: {- D% o' m: Y4 `6 ^, ?# p move into pickaisle.induct2! m1 B! A/ _, l7 J9 ]( a3 B
while A_i<=30 do begin+ W2 U+ M2 W- J9 V5 [' ~1 [
travel to pickaisle.con(A_i)% D+ J+ u" `/ I; i, T% O# q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. ~1 O6 ]5 p! B, r: D0 m% M# X else wait for 10 sec
* @; M4 m' e C7 _6 f( s% U* f0 q if A_i=A_leave then send to die. u! N; s! w7 ]5 W
else inc A_i by 1
% A' j1 y9 P2 y- g6 S end) s+ _: V( q% j6 k4 t
end, I w# R% P$ a4 o
4 j3 w6 B7 _( r* j7 H
begin P_pick3 arriving
8 h9 Q1 M, q) C0 ]' a' v set A_i to 21) w% T2 H9 [; q1 O
move into Q_induct3
/ ]. @5 l1 K8 {# d move into pickaisle.induct3
5 j: [5 s. D% d" w% T! x while A_i<=30 do begin
, A& @6 t& [0 x# a F travel to pickaisle.con(A_i)
2 g2 B! Z2 w* Q' l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ {. U2 o# c& b3 k" e+ {( P9 w) i else wait for 10 sec2 B6 g( ]$ m O4 k
if A_i=A_leave then send to die
( \. o2 X- m8 b! G else inc A_i by 1! x# Y* K: z! M9 R3 W1 F/ k: d
end& R# a3 \4 ~ j, h3 N4 [5 y
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,其它按你的 ...
|