|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢; Y k3 p, u6 r) Z9 z. e! w9 V5 z
; |( I: n* V5 K+ p
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
- H0 u" D8 [& ?0 S) N0 N: T& q
/ ?! N4 X' b1 Y" C) lbegin P_read arriving2 ?3 }/ W+ H" _# l
while 1=1 do begin
& r7 ?- R& f8 d l& t& w read A_tote from "data.txt" with delimiter "\n"
4 e0 Y4 n+ ^# y, h# ^5 b7 ] read A_time from "data.txt" with delimiter "\n": C- v6 e% T* _# N3 ^/ K1 v& z, z
read A_leave from "data.txt" with delimiter "\n"
; J0 e! ~ w1 f: I9 e' v# e2 L read A_picks from "data.txt" with delimiter "\n"9 r2 d2 G0 W# t0 p$ b$ ]- j
set load type to A_tote" {5 m' E5 j9 M7 m+ h, U0 {
if A_tote="tote 1" then set A_induct to 1* q/ n2 O8 u' V! t5 K
else if A_tote="tote 2" then set A_induct to 2) z: f; t! V) U! x
else set A_induct to 3
& T1 d, ~2 Y \ t set A_i to 0
" w& S% e$ |$ j7 `* M clone 1 load to P_induction
! `. h# u) S0 H wait for A_time sec
$ d. f" R4 [ u8 U end' C6 T8 C9 u5 P+ v
end0 _% B/ ^4 ~# U/ P% ^- Z0 [
6 F& ?; V# W$ S& H
begin P_induction arriving
$ ^& p1 H- [8 \' w0 ]8 H! s if A_induct=1 then clone 1 load to P_pick1* ] a5 \" a- e# I& {1 H! ~) \
else if A_induct=2 then clone 1 load to P_pick2
& |* A9 x0 o7 s) A. p C- X/ {/ y$ f else clone 1 load to P_pick3
4 i/ n& t. Z- iend
# {* K l8 j& O2 U5 w9 A, R- N% B# f/ c) G1 t- ?% y* L
begin P_pick1 arriving
; n9 C W+ a7 L) b$ B# ^ set A_i to 1
' f8 J7 v( {0 |/ H. s1 t' x- [" x$ L move into Q_induct17 X: n' Q1 U% w' G
move into pickaisle.induct10 T* r2 o B5 Z4 J( f/ N1 X
while A_i<=30 do begin+ B& [- j& i/ o
travel to pickaisle.con(A_i)1 Y9 s3 ]3 l- D% G. A- S% G
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 I1 i5 X5 S% H: q else wait for 10 sec
" x" y* d1 F2 p4 F if A_i=A_leave then send to die& A- f- j! E t* z# [$ ?+ t
else inc A_i by 1
+ @2 }1 M, f# O end
+ O# Q- Z' U/ R4 M) U. |end
; @& ?: Q/ K) j$ _/ D' ^/ @/ u5 E. V' j! ?4 o# w% g. S$ z$ T
begin P_pick2 arriving
1 x# i: {. f- b3 z* N0 g6 E set A_i to 113 m9 B8 V" Y! n' J" ?/ j
move into Q_induct2
8 {9 A( }; T% t) Q3 E, E+ h move into pickaisle.induct2/ Y9 } o# u' @2 ?" t
while A_i<=30 do begin4 F `3 ^! l a1 N/ D
travel to pickaisle.con(A_i)
1 u. F: X( |8 R7 j5 o& _/ h' | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% E: d( v& t; A1 C
else wait for 10 sec# `0 P+ a7 q4 z5 ? F
if A_i=A_leave then send to die1 E9 r! z$ C, J2 k( N$ @
else inc A_i by 1
+ ^+ S9 |) ]% n0 C- j end) l+ G, b& ` T( F& a _
end
# m) G" _! c. u( U# k& }1 `" Q* d; P" }; t. f
begin P_pick3 arriving
c8 N- U; T0 W. |1 R' T6 l9 n5 D set A_i to 21
+ a" O5 r' h: \6 @ move into Q_induct3
- g% Z1 U5 U7 z8 Y move into pickaisle.induct3. w% d/ F' s6 S; F- T2 W5 E% Y
while A_i<=30 do begin
. d$ a0 B t2 o; L travel to pickaisle.con(A_i)
( h0 l3 L# r) s( x7 R% \+ p. ^, p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 z* K0 w4 S& ~( ~! C& V3 I* G
else wait for 10 sec
0 Z6 S! J/ M1 i! N4 A if A_i=A_leave then send to die
, P0 p2 ]% e0 E" v3 {$ Y else inc A_i by 1
6 O3 a' x& S0 M& I7 n6 I. N$ g end! x h+ R+ s2 l# _
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,其它按你的 ...
|