|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( }, l( C3 Q1 C6 S$ I
9 l$ E G6 j: [) \3 F8 u& h
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 F0 K: b0 r$ o5 z6 f( D# P- q9 s1 i: Z
begin P_read arriving6 K% z! U+ E4 G
while 1=1 do begin. v8 Z _) t, y( e5 y
read A_tote from "data.txt" with delimiter "\n"$ m9 l* \4 F" O/ C8 W
read A_time from "data.txt" with delimiter "\n"
3 @8 J+ D8 J9 ?4 D read A_leave from "data.txt" with delimiter "\n"
: K: _( R2 H0 I read A_picks from "data.txt" with delimiter "\n"
* K- y, z: p# ?! `0 k set load type to A_tote4 ~+ O, ] G( O6 T* M- j0 i+ u
if A_tote="tote 1" then set A_induct to 1/ ^/ e5 h+ i. I* m/ t. \
else if A_tote="tote 2" then set A_induct to 28 [3 W1 Q, W8 b8 K5 ?9 N
else set A_induct to 3 4 @4 d& y8 E: ` ~( F
set A_i to 0& g" E5 v9 E1 H( i Y: F3 [, u
clone 1 load to P_induction7 Q/ [; z/ v/ \+ {) g# `
wait for A_time sec; `, L' @2 I, Q7 V5 w/ ]& S5 N
end+ Y2 x, t) H6 k( l8 A/ s; S
end& J3 D( w2 n/ ?# n$ A8 `2 ^
7 w" a4 L1 A* q7 A" xbegin P_induction arriving
! ~7 J" J s# i2 ` \* a if A_induct=1 then clone 1 load to P_pick1
& L. G! Z. ^0 q( x \! e: a else if A_induct=2 then clone 1 load to P_pick2
3 e0 }. W5 h" ^# b+ \5 R! ] else clone 1 load to P_pick3
/ ^# c7 P' P) O$ U6 Y# F% P0 Nend; X. }# G0 h* d& Z' R; O
1 r m$ h r5 J
begin P_pick1 arriving" b$ N! K" `6 }% p! O% r7 C4 P
set A_i to 12 a9 H1 S1 g9 P: ~4 y
move into Q_induct17 p1 ?) N6 c, n Q; ~! j/ d
move into pickaisle.induct1
; K: P7 W6 w3 r( P, T3 o% D( J while A_i<=30 do begin" P, y& {1 T7 W& z
travel to pickaisle.con(A_i): H. ~6 @0 S1 W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 m/ {* a; }, Y1 R+ \* Q7 @
else wait for 10 sec/ Y$ f1 f% P( k$ {( ?3 y3 |
if A_i=A_leave then send to die
) k# K" p1 V% r( l3 J7 u else inc A_i by 1; ?6 q2 w( y$ }# q3 Q
end* D! E5 v+ e+ P; T0 k
end
+ Y% w& Z. a7 f0 d$ d: Y" p1 f( H t
begin P_pick2 arriving7 L" r& P* W1 Y. _! Z K( E+ {
set A_i to 110 |4 ^$ x# t8 j9 G N3 z z9 |
move into Q_induct22 \. g% ~9 I3 s) K. _2 V3 W
move into pickaisle.induct2" H! a3 Q) d5 E' Q) d
while A_i<=30 do begin
- L% ^7 p/ g7 b% L/ Y travel to pickaisle.con(A_i)
- j5 b7 C3 o6 N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) t. m9 ?3 Y" r/ D% w+ M else wait for 10 sec+ x3 F/ A+ r2 Q& j- t- Q# \/ g6 {
if A_i=A_leave then send to die1 K8 A& S7 t1 f" i5 j {7 }
else inc A_i by 1
6 A! g3 d& d- n) t j$ ?% v end, M* e+ g' ?$ {
end; W G* a3 z9 L$ x; q) B
4 l* [8 E5 W5 b+ X6 Z- d. Z5 Y
begin P_pick3 arriving- u6 w [ {4 D; ^9 W
set A_i to 21
5 t% V7 h5 ^4 X4 x, e& L, A move into Q_induct3
+ p# k$ S' H8 c. [# k5 x$ \ move into pickaisle.induct3
; H4 g, u( B/ g% Y2 R& z/ I while A_i<=30 do begin
, w C" l8 F5 H; I% R! m travel to pickaisle.con(A_i)& O% R' `- T; k( v! A4 B* P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 e$ H' Q3 k. p# Z+ ?9 g; P" ^
else wait for 10 sec
N* J! s1 C) s: g2 R if A_i=A_leave then send to die( O3 u& I0 R# n( c& T9 `7 X
else inc A_i by 18 o/ v' t/ {! T& J) j! e1 v! s
end, K- A5 Q" a1 Y. ?& N7 ~. z
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,其它按你的 ...
|