|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, U* t4 {- e$ e7 l& S5 \
0 p" j# u# P( 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中的数值,不知道会不会有什么不妥。# a" X2 h- B" W4 G C( `" [
8 h9 N; H9 N' @- e5 I
begin P_read arriving
& y7 N5 H' A; C# v/ Q: U) s6 B while 1=1 do begin
; \7 n7 S" E. N8 y P4 _; A) u read A_tote from "data.txt" with delimiter "\n"
2 L/ h$ o: B5 r read A_time from "data.txt" with delimiter "\n"+ T' k' J% r8 z! Y: I& B d2 @) ]
read A_leave from "data.txt" with delimiter "\n"
6 Q+ U7 s# \2 ]* I, \( D read A_picks from "data.txt" with delimiter "\n"/ M4 M3 }9 @# ? o! Q! R6 ~
set load type to A_tote+ E* E5 u( F% i( F) {
if A_tote="tote 1" then set A_induct to 1
5 H% B7 d; b" }' F4 V! F! e else if A_tote="tote 2" then set A_induct to 2/ o- K3 K$ O7 ^6 b6 A' x& q% o
else set A_induct to 3 6 f) S# g) h" a7 [" H
set A_i to 0
" G/ c2 Z: Z; o0 D6 i clone 1 load to P_induction
$ g- }/ z' h; _' I) c9 Q' L E* o wait for A_time sec
5 h% g- C: V, D8 [3 R end
3 d/ |7 v8 e4 X/ X9 t8 ?end
8 b B, w5 m4 f" r# l; V/ |, Z& s
0 z) J$ X0 C$ Cbegin P_induction arriving2 F! `) I/ N \
if A_induct=1 then clone 1 load to P_pick1; P7 N: n- d) {; v* L
else if A_induct=2 then clone 1 load to P_pick2
; K# ]2 n/ D# _ else clone 1 load to P_pick3
4 ~) F# _# i' i' t# wend) q- Y9 A# M0 u' [
4 @$ b: v2 U) R: a( e# ]- K2 Mbegin P_pick1 arriving; g8 S$ i0 w! O N% g( H/ H2 {
set A_i to 1" J; {( `) P3 W2 k" t) O/ d' O
move into Q_induct1
/ n" j- m1 Q% X; G$ A2 n" Z move into pickaisle.induct12 U3 `7 u" D3 f1 k8 x* N. {
while A_i<=30 do begin7 |9 e& j# m1 T: T' l6 Q+ X
travel to pickaisle.con(A_i)* }* J. n! x4 ~8 }6 K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 V; q. N5 s/ M
else wait for 10 sec* F" u6 X+ e9 Q, }
if A_i=A_leave then send to die
- J4 W6 e* k. S# p" K) R else inc A_i by 1
6 Q* G- b3 x% r; j# r end& \' ?6 m6 q! `9 J$ A b
end
3 [- B7 k [+ T$ o1 t; S- Z8 Q- [+ j+ `- c3 v1 I. j
begin P_pick2 arriving$ q& k& c. b& _. s1 i, X
set A_i to 11
: v# n \( Y: S1 W9 Y9 N) i move into Q_induct2% O5 [* j! X" ?9 v' X) K2 W* |
move into pickaisle.induct22 c B6 ~) M3 o" X8 p
while A_i<=30 do begin# @% ~) f* {6 J4 B7 R9 I8 @0 p% e
travel to pickaisle.con(A_i), @- L) E/ ]3 C0 p1 U+ U1 w9 h
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 y# C( F" L: j8 e) u else wait for 10 sec) a# W* D9 ?- z8 }& V$ l9 D- G: t2 b
if A_i=A_leave then send to die
3 n& t/ u+ U$ X5 `$ _ else inc A_i by 1
4 ^' r! b; F3 L end
% ]0 D; }7 D# H$ P8 d" f) Iend
T. y9 P' R. }9 n5 K& n- P7 S! `* e" W3 ?% U. j9 h1 o
begin P_pick3 arriving. f! v1 ~0 D8 H/ b& z) c
set A_i to 21# g" q/ ^, }: Q5 K3 @9 U
move into Q_induct3+ D3 `9 M1 U# f& z; {# k4 }9 Q F
move into pickaisle.induct34 f& ~4 ^& R, g$ D3 ^
while A_i<=30 do begin- d) l3 i/ l4 l1 v
travel to pickaisle.con(A_i)
) {8 G; m3 A r, Y* G# _6 Z# i% E0 H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( P5 h$ Z0 d' m1 y; c& H else wait for 10 sec
+ }& {0 T$ ]2 ]& C. [ if A_i=A_leave then send to die
: g& M8 c! K, c% Y" y else inc A_i by 1
9 b! S- i7 Y( a: `' H/ N% T end
1 R5 `3 ]; G. rend |
最佳答案
查看完整内容
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,其它按你的 ...
|