|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 E) p- g4 h* R9 Y9 H! }
3 W, N7 k& ^' m7 N我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 Q5 R6 O4 g6 l9 L. D) Q3 p0 c, k0 f5 v- [) j- z9 A( z
begin P_read arriving2 q7 @; z1 e: W' R
while 1=1 do begin
( q0 a' `1 w; z" v1 a, l4 P read A_tote from "data.txt" with delimiter "\n"( n9 w3 T1 Y4 S- g2 h9 ~- X7 F: K( K8 p
read A_time from "data.txt" with delimiter "\n". \5 m' c! F0 O- ^: h) B
read A_leave from "data.txt" with delimiter "\n"% L, p) i/ R' l4 F
read A_picks from "data.txt" with delimiter "\n"
l& T- {0 H: b i* w1 z) U/ L set load type to A_tote
7 p5 P s {0 X if A_tote="tote 1" then set A_induct to 1
1 C* b1 V1 p3 A( d4 B) A/ \7 T+ d else if A_tote="tote 2" then set A_induct to 2
, k2 M2 ^& W# c2 V else set A_induct to 3 8 N! [( ^, x, @5 `: m
set A_i to 0. W( T% Z7 I6 J% j1 k$ Y
clone 1 load to P_induction
$ g8 z) f+ s! ?2 c `) W0 R wait for A_time sec
8 \% D* B: f+ C- k \3 A end
& [* y3 d, z4 Y' T$ Oend8 {6 i. |: _( H" x
7 F: \/ ^% b: ~; L6 x7 _1 Lbegin P_induction arriving
1 Z0 r5 m1 `4 x! [, p& A if A_induct=1 then clone 1 load to P_pick1) O- v5 L; I2 h8 \% y
else if A_induct=2 then clone 1 load to P_pick2) p% r" Y/ ~ R9 y% p- @. x7 L1 k4 j
else clone 1 load to P_pick34 e" g- n# j, U: I) a+ R
end, b9 M1 q; e$ K0 v4 D$ Z( h+ V# T
j# M8 m& M2 e; o& N! C5 Tbegin P_pick1 arriving
/ X3 M% H7 q6 t1 K$ f U; O+ B set A_i to 1, ]% D* y+ k D( k* S
move into Q_induct1( A( e: h& k7 Q6 K+ c
move into pickaisle.induct1
. q7 {; Q2 e1 i0 h$ u& k( I while A_i<=30 do begin+ T W3 t* x# Z r2 ]% v: h: e
travel to pickaisle.con(A_i): p/ T7 D+ p& V0 J/ t/ k, l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 \) \* z& g5 |- ?' X
else wait for 10 sec
& q* Z. \# `: e/ C; X if A_i=A_leave then send to die
! o) g2 a9 b3 |) f else inc A_i by 1. r0 {' B* R3 X- @) j3 `" G
end
8 t. }, U% c8 {/ Y, C# X3 F' xend. u1 Q) G- `4 W& y) F: N# f* A
4 |4 H9 {& Y) }, Y% ~
begin P_pick2 arriving; J z! t4 o" P( a5 {5 g, Q8 ^$ o8 O
set A_i to 11! g# x7 E g8 S8 K0 {: ~4 M
move into Q_induct2
& {( R4 p( u4 o9 Z4 K4 }( n move into pickaisle.induct25 ^- |* V# }; i9 Z
while A_i<=30 do begin) M8 p8 K" W; i; z. m* k
travel to pickaisle.con(A_i)( l2 d# N4 C. a) B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 }! _& k; E3 e: U4 V4 }8 x8 ]1 ]
else wait for 10 sec( e* H& f9 f5 k, A
if A_i=A_leave then send to die
- h0 h$ h- c2 T0 c4 D5 R1 F7 ^ else inc A_i by 1
; s0 ^( Q; @$ a) Y end
' H4 f: H: }4 X. Bend
: Y1 v1 q: C: E0 P# a
8 R5 s0 [8 h( A# d, t9 Bbegin P_pick3 arriving
/ t, ~, ^0 a& x, L0 q, Z- ` set A_i to 21, k# b3 I" S- N5 t: x8 h, ?- L
move into Q_induct3
0 s% o' o; ` Y move into pickaisle.induct3
! Z* E+ I/ e* s+ s while A_i<=30 do begin& z5 Y5 p- j+ t% g7 |$ \2 |
travel to pickaisle.con(A_i)
, K0 u- z& @ u+ ?( H, t+ F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. E3 D& y# ]' l) d9 [9 t& c! H else wait for 10 sec
8 ]* t5 Z& a% J& x! G/ H if A_i=A_leave then send to die* G t& L3 v1 o4 f; o3 K( t6 a. G
else inc A_i by 1
! t5 G% e- K6 w% j0 h end; P: |, r4 J2 L0 X
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,其它按你的 ...
|