|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! l H& J% h6 ~# n" }3 m; B9 s0 f! M) ]8 N4 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中的数值,不知道会不会有什么不妥。( n4 y( G) W& B% v6 u
9 @2 U# H0 `8 h" s! O0 J8 H lbegin P_read arriving Y- X" k8 M9 s
while 1=1 do begin' l1 D9 d, v5 W1 c0 j
read A_tote from "data.txt" with delimiter "\n"4 k0 G( |' g# H8 m/ g0 T2 H
read A_time from "data.txt" with delimiter "\n"7 |" `6 o+ p, |7 Y) K) }
read A_leave from "data.txt" with delimiter "\n", h9 O- F4 W7 `; l4 V8 H
read A_picks from "data.txt" with delimiter "\n"( M5 O2 _, u* f! W- E
set load type to A_tote, X1 A8 D) e2 I1 i# ^# u
if A_tote="tote 1" then set A_induct to 1/ X# u9 H* W: B
else if A_tote="tote 2" then set A_induct to 2
0 p, w9 d8 a8 B: _; k, n else set A_induct to 3
7 o9 H( ?1 \; e2 F set A_i to 0, j; w; }, t9 O3 y( q
clone 1 load to P_induction; `1 Y2 V4 E m' n! I. z
wait for A_time sec
$ R% d A0 y0 G2 C end
0 L, c3 K1 ?+ x+ M* D; C3 S6 n( Dend
! h6 _; k3 U J1 }" q7 x* L$ j2 k' K: L9 z/ ^2 u3 p
begin P_induction arriving
, O& x( H) K& _" X) o if A_induct=1 then clone 1 load to P_pick1
! |- A. }) j6 F else if A_induct=2 then clone 1 load to P_pick2$ [: ]; U7 R2 M8 G I
else clone 1 load to P_pick3 _! a; L4 t) ~' \ F
end
( x% r9 i" b1 T" B: N" G: Y
4 i/ B l! @: G7 Y [7 U( nbegin P_pick1 arriving
% g. j9 _' v0 R5 i; j set A_i to 1: e0 _0 Z$ f9 z) ]. }
move into Q_induct10 b+ j5 [) ]& f/ [# k
move into pickaisle.induct11 ?2 r& _9 g/ ]1 e- n5 p( \$ t
while A_i<=30 do begin' T) L1 ]1 a% A3 s
travel to pickaisle.con(A_i)
/ t* T: i2 R( x0 L1 ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 [' w+ U ?( F& \# S else wait for 10 sec
% M, y$ z. ^# o+ Q if A_i=A_leave then send to die
6 g4 [6 b$ `5 ]$ s% [( ] else inc A_i by 1
3 [7 y" c# B1 _- I% Y) ] end
+ o; g, {" @1 Rend
/ L7 ^ |# S5 F5 k4 t; S6 @
4 F8 A! h% O) ] _4 ?! T+ E: }begin P_pick2 arriving& r. |7 f, i0 P1 x- K
set A_i to 115 b$ W& g! G# t: d4 m C; h
move into Q_induct2
4 y; R: z& `! x4 P9 v# }$ t; r move into pickaisle.induct2
\$ J% o. H2 k$ _ while A_i<=30 do begin- Q% V* W, R; J/ m
travel to pickaisle.con(A_i)
7 j i7 K$ ?( K/ Y" s% ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: z2 |6 p" p( f! p$ K* O: @% v' }
else wait for 10 sec
& [, X4 S: R# x' x7 g0 Q if A_i=A_leave then send to die
! r( z) W- O5 {6 e else inc A_i by 1; ~- P1 }0 k& J2 j
end' p! M s: h: Z
end
4 V }; t& V8 {# Q j
* u- O) k/ I4 v5 g" fbegin P_pick3 arriving
. H8 b; p. c0 b. ^& [" Q6 N set A_i to 21
/ `2 g: i; z. Z3 x" A2 c ~ move into Q_induct3+ c5 |1 C5 ~8 _, L# ~9 C
move into pickaisle.induct3, E) Y3 X5 Y3 j0 ~
while A_i<=30 do begin
, j% s6 ^7 P' a D. O+ X$ T+ z travel to pickaisle.con(A_i)
, p! u& r3 I0 g( V; a# j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 H/ f2 X3 ~; G3 p' u Q W2 ]6 Y
else wait for 10 sec3 @* g$ X) i0 t& B8 Q
if A_i=A_leave then send to die& I1 b2 A0 a2 Z% J
else inc A_i by 15 J$ J) [. E+ A+ S2 ]
end5 W/ h6 i. f X
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,其它按你的 ...
|