|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" [4 w& S( Q! a5 w
- Z, d6 S1 t5 I! b) z我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" i( J# Y o1 r5 U; U4 \
! h& X4 R( j3 d. sbegin P_read arriving! d9 q) Q9 K9 d9 u1 J( L
while 1=1 do begin6 N# q& u" f" j$ a. N. Q2 _
read A_tote from "data.txt" with delimiter "\n"/ S4 L f5 |$ M1 ^
read A_time from "data.txt" with delimiter "\n"5 h7 P. U W) O7 i
read A_leave from "data.txt" with delimiter "\n"& s) ~- L/ [5 b9 q( M" ]% E/ H; @
read A_picks from "data.txt" with delimiter "\n"
; ?6 c) t5 v, \( t; s set load type to A_tote
- @5 I# F! u; T( P! ?( u1 t" S7 A! W if A_tote="tote 1" then set A_induct to 1, k7 b! [+ O( `4 ^
else if A_tote="tote 2" then set A_induct to 24 X& S( K, ?. E
else set A_induct to 3
+ W% M1 x2 v R. w, J# }+ P. A4 N set A_i to 0% F$ j9 s. A7 u3 @1 a: f
clone 1 load to P_induction
" w2 O+ _3 ?/ j1 d wait for A_time sec
# e6 s( X3 q8 B( X4 e9 j5 P% X( k3 d/ W end$ D( }# X8 |' y: Q* N; L% j; U
end" J! W( r# K+ Z
( E |! r/ h4 G+ }& Lbegin P_induction arriving
0 u0 Z. B9 X% ]7 ~ if A_induct=1 then clone 1 load to P_pick1
5 n4 N" Z0 p( x! ?, m1 c7 K else if A_induct=2 then clone 1 load to P_pick2
0 ]/ \9 X. d9 E N$ t else clone 1 load to P_pick3
" c+ ~. `- ~, Oend$ u. i6 w8 R5 T( x+ f0 D8 K5 R
( D/ A7 E, N4 h* }, u' J
begin P_pick1 arriving9 s0 W. v" J# w( _- ], b
set A_i to 1
; Z% d+ g* e+ W9 i2 | c8 v" J2 n# e: D move into Q_induct1
7 I- ]% K0 W! X" l! P7 U. p/ O" Z move into pickaisle.induct17 A, m9 M5 n: ?: R
while A_i<=30 do begin
' N0 [, R5 o Q" W4 b0 d3 Z8 @ travel to pickaisle.con(A_i)
, B0 v/ k8 U0 @. \% v u3 w if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 m+ E2 P* u) D% o, E% S. T, O" E else wait for 10 sec4 E/ N2 h, }& p" S. u
if A_i=A_leave then send to die. N. { ?6 I2 s2 y! D# O! O
else inc A_i by 1
# ?+ q- i4 {$ f, m5 T* \- x end
1 C$ W5 j7 t, H9 L7 bend) x# E/ E% h! ~, h, t$ X# a! p
- j6 i- t3 o( c- n, ?& e# D. Dbegin P_pick2 arriving
3 _. h0 @. v5 E3 T set A_i to 11$ L5 ?" X$ g' S- h$ u* b- h
move into Q_induct2
3 R/ v( S5 [; d1 H/ A( Y: A move into pickaisle.induct2
& h3 W2 @1 O3 L& ? while A_i<=30 do begin. y6 \* m; i2 J6 H
travel to pickaisle.con(A_i)
0 O3 z3 {3 f1 \/ v o+ f9 M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ b6 N, g4 r& S. @( ]. m
else wait for 10 sec+ T6 U/ C: N, e2 E3 [! R; M
if A_i=A_leave then send to die
2 l3 }6 T! a+ A* s else inc A_i by 1% q! N [8 y8 l$ j4 r; H& V
end
8 m$ \) m+ m4 k, Kend% @: h7 P0 \* ?" g2 a. H6 L0 A
' X% [# |( A# q; w9 ubegin P_pick3 arriving/ W. P9 t8 s6 C* p
set A_i to 21
9 E; ]$ P& g- n move into Q_induct3$ ~0 @3 u0 f2 a5 E
move into pickaisle.induct3
9 [8 s& c0 Q7 M9 x, O while A_i<=30 do begin
# W* `9 p7 Q+ S+ K travel to pickaisle.con(A_i)
3 u1 E3 }- V( A& t8 R* \. x- K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( w3 S* i0 ?1 f3 T4 l5 _1 ~0 Z7 ` else wait for 10 sec! _9 T4 h+ g; _9 V
if A_i=A_leave then send to die5 ^) @9 }8 ^0 x: b' n- r0 H2 I
else inc A_i by 1% ?1 ]! O4 } C6 q3 C9 F& \7 z2 m8 x7 I( }" L
end
4 R, [ [4 ~4 M T7 ~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,其它按你的 ...
|