|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ [: R0 S$ K! q# v2 q7 ~
* c/ m0 {/ |6 w1 u0 r, f
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
C* T& a5 u- X' [7 d8 U' l5 v/ u# }8 y9 h" S" F0 l
begin P_read arriving! m0 A% C- S# n
while 1=1 do begin
& Z9 t& c+ J; L6 f+ m9 X read A_tote from "data.txt" with delimiter "\n"% c3 H t4 m* L& Y* N
read A_time from "data.txt" with delimiter "\n"! @$ \! \; G, h
read A_leave from "data.txt" with delimiter "\n"
# s8 N8 y$ o; V: P+ P read A_picks from "data.txt" with delimiter "\n"# C) @4 A+ q: Y6 E9 G
set load type to A_tote3 d! \; f6 ^6 J* U, w- d
if A_tote="tote 1" then set A_induct to 1 y1 N, t1 `+ i6 `9 k4 C$ x& a
else if A_tote="tote 2" then set A_induct to 20 J0 K N8 J( i C; |7 ~
else set A_induct to 3
- ^5 Z1 w' F7 P set A_i to 0
0 R% l& f6 I3 ?9 {0 b clone 1 load to P_induction( i Z8 h5 U* X
wait for A_time sec0 v: |4 G6 d. e% r) v! ^
end8 }5 O$ R9 f* L/ _8 `, o% w
end' u- e0 b# h9 |+ s$ M/ |1 e* Y
+ b- I4 W2 v' E; W& t# E
begin P_induction arriving
. f# z- C& O7 L2 N if A_induct=1 then clone 1 load to P_pick18 o4 S: O9 @- w7 j0 d% L
else if A_induct=2 then clone 1 load to P_pick2
0 x8 U9 w, Z, W' F' m& V: x else clone 1 load to P_pick3
, H) C. B* @2 G Send
/ ]2 P9 c, {6 v$ S p8 j0 Y( i
' w$ c3 g6 Y& [6 U/ e. E/ {begin P_pick1 arriving) b- ]0 `5 j* _" v
set A_i to 1
* ]" e9 e3 }+ v; U8 T) I* ]8 w move into Q_induct1 I& F* Y. o8 c' X" S
move into pickaisle.induct1- d0 i8 ^: g# X2 S
while A_i<=30 do begin
& m4 C3 F z0 C+ C2 t/ b travel to pickaisle.con(A_i)4 `2 M2 T7 F4 ?; T3 R, S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 `' z% H: f: [. O; W+ g4 z
else wait for 10 sec
- P6 H' Q3 [. V- x, P% S if A_i=A_leave then send to die. d! B* ^4 _" g8 r1 k) {7 ~
else inc A_i by 1, Y4 q" `5 X+ U2 J, x4 P! u8 D
end% J0 {% k4 Y4 W$ |# i9 w
end6 K: a% D) a$ j) r# r( u9 t
% [ Y0 W5 b* j& M4 Z
begin P_pick2 arriving% k3 L9 A7 w( A; G2 W
set A_i to 11, E8 b' l) R2 p3 U
move into Q_induct24 M3 }! |" H0 `
move into pickaisle.induct2
1 U M% v' y) @- M8 w while A_i<=30 do begin$ I4 z9 T7 @/ F7 ^) K
travel to pickaisle.con(A_i)
7 N6 o$ f3 O+ ?0 f; j& v: i4 Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- k, `0 r" T' ^3 Z) \; E; C! t* _ else wait for 10 sec" p5 e; x( B w; Q7 \
if A_i=A_leave then send to die
/ n; H8 j/ Y, n- _' Q else inc A_i by 1) \, [/ n# s3 r
end% I! b/ k% T' |. \
end
1 W9 i0 B' A( o; y; ?0 D8 I+ t, e# U1 _( K! }5 ~* {) F
begin P_pick3 arriving5 ]7 u" L& x1 X( s D F. Z& m
set A_i to 21
E1 J/ ]- F% c% N move into Q_induct3
8 E5 {6 r2 M! O \7 N8 C move into pickaisle.induct39 G3 T% s' r! `% d
while A_i<=30 do begin" {* l: b# Y* ` \; p% q+ _
travel to pickaisle.con(A_i)+ K& j) |/ E1 A- z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. M+ }# `; G2 [6 {" e m
else wait for 10 sec7 g# E- B8 t" u
if A_i=A_leave then send to die6 X4 v$ a: Y; L6 N0 T' l
else inc A_i by 1
/ S/ H3 T9 u! Y/ b' V* a( K end
) V1 u0 |( q* K0 W# z D qend |
最佳答案
查看完整内容
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,其它按你的 ...
|