|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 t4 q5 q4 f# S) ~
9 t' a! f+ n: E+ y: U4 X/ ]/ ?3 Q我的问题是,在每个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中的数值,不知道会不会有什么不妥。; A Y0 q S: }! J: C
# t! {! R( ?) u
begin P_read arriving
, C8 B1 h4 ^0 R7 t* e* M/ e while 1=1 do begin3 A: i/ T5 ^, r! g( B& N
read A_tote from "data.txt" with delimiter "\n"
" H- g6 h" j2 M. d read A_time from "data.txt" with delimiter "\n"
5 j! |+ ]5 m- I6 B3 _ read A_leave from "data.txt" with delimiter "\n"9 p4 {) e+ N: ]* C' y, J5 i V
read A_picks from "data.txt" with delimiter "\n"0 G% d: f) R7 m% p. c5 W+ O
set load type to A_tote
" S) @+ C6 s6 E* o: Y3 a if A_tote="tote 1" then set A_induct to 1
$ l# l2 L; H9 a! b else if A_tote="tote 2" then set A_induct to 2
- |4 a7 ?7 Z- C7 e3 u0 G6 E) F else set A_induct to 3
" b" u. E" [; c3 T set A_i to 0
% {& Z( q8 {; ?+ w' @ clone 1 load to P_induction
" K: _- A: G; |/ J, B- C7 h wait for A_time sec
. p8 p/ W/ S" s. i( [. y0 g end
* [) {, X/ R( T0 q/ e0 s, R- Wend6 a. T6 P$ I9 l4 S# j" h. a1 ^
- n1 a6 f. \* p% Q1 E/ Ibegin P_induction arriving+ _; U" `* X+ x" E' t/ Y, a8 M$ z* V
if A_induct=1 then clone 1 load to P_pick1
4 w5 z, \- B- L# ]1 ^ else if A_induct=2 then clone 1 load to P_pick2; a8 e. k% M4 r$ g
else clone 1 load to P_pick3 U; D i- F. T7 Z
end6 y+ \* i& k# }+ Q. E3 _3 O* m
5 r( l- V: S# G+ P4 Mbegin P_pick1 arriving
4 ?) K* |1 c% c, w; _ set A_i to 11 d9 m" Y; `* @" }+ j' z( T
move into Q_induct1+ s0 z+ J+ i' G" {- D% E# @! o- {
move into pickaisle.induct1
3 E! `% X2 U% X' j* l# w while A_i<=30 do begin
# e4 T% K) r9 z; K9 P9 K travel to pickaisle.con(A_i)
+ r/ `( T5 ]: ]0 C H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& [, y" S, c0 y6 n8 W5 Q else wait for 10 sec# c# J1 p! Y+ `& ?0 ?7 ?! M6 m/ @
if A_i=A_leave then send to die2 ^: J+ _5 p0 {8 a( V, V
else inc A_i by 1
4 J# s/ q/ `, z* D/ v0 ] end7 N0 n3 r4 }1 r" A
end/ b) V( o6 Q$ ~9 c4 Y
* p6 f Z# G- m7 ~( f( }
begin P_pick2 arriving
6 ?' _0 P+ \4 W3 l+ N1 R set A_i to 11. \/ B( o2 @& `$ `; \- F6 o6 @
move into Q_induct2
) c+ u9 }4 }+ l$ U move into pickaisle.induct2* W$ L4 D5 N% X) a. r
while A_i<=30 do begin. g" _0 T9 m4 v$ c; r: v
travel to pickaisle.con(A_i)
/ b4 q6 S. @. |5 } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 \( ?0 a) v/ J6 \( U/ @1 z8 Z& D else wait for 10 sec
" [ Y8 O$ y& I6 S7 U if A_i=A_leave then send to die5 L) g- k* Y$ [, Z3 I! ]
else inc A_i by 1
9 |" W0 a4 {; @2 y end
' H* V2 E* ]; b4 n5 c0 }1 t! a- P8 Iend
- y% K) p2 y; B7 x& F! y, z' P$ ~& }2 E: l& C t
begin P_pick3 arriving$ s9 B: J; H6 {) I& k) y
set A_i to 21$ E2 h, b6 L- U4 s& w$ M
move into Q_induct3
9 C( f% s; x; C2 v8 U, I3 z( \ move into pickaisle.induct3
; q( C2 E9 l/ X' f while A_i<=30 do begin
7 d: ?4 N) R+ a4 Y: H2 ]6 n; B! y9 g travel to pickaisle.con(A_i)
0 U4 y! |3 B- O* n* N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 c9 b6 F9 w9 W4 R4 p2 Y8 z else wait for 10 sec
( b2 ?) \; s- M3 u! Y) J- O, o if A_i=A_leave then send to die. o' d; q( k: N% T; y8 b' Y8 F
else inc A_i by 1
" x0 h% ^3 k1 y$ E1 I& ` end; w A6 }! E! j: A, W; 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,其它按你的 ...
|