|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ _+ F4 }4 W& ?, R( }! d0 l& s
" j) g. k% G' k( v# _6 L, A9 D M
我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 z1 x; R! F& p: a1 Y2 S
5 ~ S4 C) m$ L. F3 v# R# z) Obegin P_read arriving) S4 |) A$ i3 V
while 1=1 do begin
0 m2 O8 r7 j9 G/ ^) C+ V4 N read A_tote from "data.txt" with delimiter "\n"
8 _# [: v% ?) R3 x3 S read A_time from "data.txt" with delimiter "\n". {) ^7 f. t5 V
read A_leave from "data.txt" with delimiter "\n" T" }$ s8 u% ^1 V0 U, r
read A_picks from "data.txt" with delimiter "\n"9 X/ _* e0 r8 E3 f5 h% f
set load type to A_tote& r0 B- C. T b3 @* ]
if A_tote="tote 1" then set A_induct to 1
+ g# X9 A6 F0 s5 a& Y# n else if A_tote="tote 2" then set A_induct to 2
; ?( m. w! e* U else set A_induct to 3
6 N' D- j c" q+ ^0 E2 x# z: ` set A_i to 0
' Q: n7 r/ A& I Q$ ` clone 1 load to P_induction( x' K* e! g4 Y; O
wait for A_time sec, ~: Z4 h9 ~3 b2 ?2 A& D0 ?* B
end2 z3 u. M' |+ W4 o6 L
end! X# g' k4 u4 k$ \, F% S
; ]3 K- q* {# ]- X4 g: g* Wbegin P_induction arriving
! P3 E2 F6 l1 d1 W5 p2 n if A_induct=1 then clone 1 load to P_pick13 f$ H- \' E4 Q( [9 N3 f
else if A_induct=2 then clone 1 load to P_pick2
) v% I1 ^/ \# Q: g& E else clone 1 load to P_pick3
) [6 H) l) w, Lend, p1 Y* n4 S" `+ L Q2 g$ ~
/ r+ F/ k2 W3 I$ x2 G- k/ x
begin P_pick1 arriving
K6 Q P H5 ]6 a: A set A_i to 1, A' }3 Z% I; b2 y+ T' v0 v
move into Q_induct1' p/ q: U$ u3 S$ N$ a" P) r
move into pickaisle.induct1
8 W, i; ]* z9 t2 U& I while A_i<=30 do begin
( m# j) l- i3 z5 H# t/ I travel to pickaisle.con(A_i)
6 \& d( Q. s7 x: H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ R0 u5 h( g" v, e2 N& [8 k) r else wait for 10 sec: v6 M) I& T9 E# d
if A_i=A_leave then send to die( {& u& d4 V' M1 y2 }6 }
else inc A_i by 1
; T! }! P, d% P8 r- ^3 E' |5 m- t end* y; `' `$ F" P8 V5 s
end
" t, M( v' h ^4 a
: j9 Z) o0 `* Y7 z* ]begin P_pick2 arriving5 |0 A. _& A V+ ?' l3 X" L
set A_i to 11& R2 w. [2 E( z+ `( _& |) Z
move into Q_induct2
0 `# W4 l* U$ w7 O2 E1 L+ C% [" i9 O move into pickaisle.induct2
' Z& u, M* u. C while A_i<=30 do begin
: p: i z; }3 j: D travel to pickaisle.con(A_i)# |/ @' l& q" ~, S# H& G/ j& {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec P; a. s% M" ], e/ F
else wait for 10 sec% x8 ?5 j: R4 U
if A_i=A_leave then send to die- q/ v. U/ i ^2 |% J( K: r% p% Y- }
else inc A_i by 1% v) Y, L/ K: H0 ]' W$ H
end( g! p0 c4 A5 C2 H7 A% S0 u: ]
end- V8 I. n/ q' h( ~2 B
; u- u. o' P2 J( D
begin P_pick3 arriving
( u: {: o; ]5 X4 ?7 @ set A_i to 210 N8 ]% G5 R1 X4 {
move into Q_induct3
& M+ U7 Z5 r1 C* \ m move into pickaisle.induct3
. D4 Y4 d- R6 x7 X0 b! U while A_i<=30 do begin
) B7 H3 N) A% U( z6 c* z- i travel to pickaisle.con(A_i) w9 b- i8 Z* Z7 K# A6 Z8 H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 q/ ?: ]# T. @6 B
else wait for 10 sec& y) p( ~4 ?0 Q9 H' f- D" ?( j
if A_i=A_leave then send to die0 H1 @3 e$ o8 s) k8 ?+ `
else inc A_i by 1# s, _1 U* z( W, c' y+ @# P0 D
end6 K3 |9 K% c9 W& P0 B
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,其它按你的 ...
|