设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15503|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! k0 c1 {" r* h/ x# q
7 N7 |; q$ h5 \5 x5 E5 O2 }我的问题是,在每个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 V( b# ]) ~, ]
$ M, S2 Q; X0 D1 y  T
begin P_read arriving  l/ Z( W- B1 e$ r% W2 C
    while 1=1 do begin3 w) P  V- j! f; W* S3 H. l8 H5 M/ Y
        read A_tote from "data.txt" with delimiter "\n"  R5 H3 A% j3 n; D/ @# ?
        read A_time from "data.txt" with delimiter "\n"* c8 q/ T3 {9 ]2 {
        read A_leave from "data.txt" with delimiter "\n"  f/ R1 k2 y2 ?; [8 K
        read A_picks from "data.txt" with delimiter "\n"- W- K: p* b  K9 W
        set load type to A_tote
! ^$ S+ O  M9 W- J9 _8 ^        if A_tote="tote 1" then set A_induct to 1
) Q( ?' N3 }( I& o, w5 F        else if A_tote="tote 2" then set A_induct to 2% `9 J2 ?+ ?" ?& M
            else set A_induct to 3   
5 O! [+ _5 U( F6 h+ R! i        set A_i to 0
6 |+ ~7 C' [9 w0 R        clone 1 load to P_induction. P% j2 [/ n. F& a4 v; y/ [
        wait for A_time sec
2 g) X" M* W1 M) {* k& u    end
3 B6 C% q% D+ I* zend
* T6 T$ Z& M) R- n0 c; V3 h7 Z: U" [0 |0 l& N( f8 b  v
begin P_induction arriving
# }- \8 W2 F1 W3 |4 M    if A_induct=1 then clone 1 load to P_pick1
' P1 M% \& N0 J" B/ k, W8 P: ]( f    else if A_induct=2 then clone 1 load to P_pick2
8 l  t& H0 A# V        else clone 1 load to P_pick3
4 j' j- ~( k5 t6 v; T3 R, \end: h& Z' `, `* i" U  ]. a9 o

3 N: `1 N5 m* U- D) Pbegin P_pick1 arriving
4 w( K' k$ k9 I+ j    set A_i to 1- p/ R# R- A  @! D; y
    move into Q_induct1. f. _* G; r" }: ?! ]* }; e
    move into pickaisle.induct13 K7 C" q. _. C8 N4 a! N
    while A_i<=30 do begin
1 G+ b& N" ^- P. F$ L; _7 ~0 e4 j        travel to pickaisle.con(A_i)
# O( m7 X) t' ~9 B# D1 Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  H  S  a+ w9 J  k        else wait for 10 sec) W/ e1 W6 r" j. x/ g
        if A_i=A_leave then send to die
3 a) ?! ^" G: |, \( J        else inc A_i by 1
  }* u; G* y% W5 v  H* o    end4 w, b7 _) ~7 J2 j1 F
end/ F- V/ Z: p; F- I1 M8 g2 b

) m; m8 |; d; R  I/ h" ^$ Fbegin P_pick2 arriving
7 K2 A! i8 d, N* l4 V    set A_i to 11
0 ?& @( c2 \1 y: m, u% ^    move into Q_induct2) s1 x/ @1 e: G6 v$ A7 ]3 S
    move into pickaisle.induct2
% ]9 r% `  b" N) ~+ P: [  ]    while A_i<=30 do begin
1 x: a3 {! {5 ?7 X0 G        travel to pickaisle.con(A_i)" w. N4 x8 w0 \% S2 N' r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# F9 G1 A# m5 H+ r: W2 A1 c, ^# N
        else wait for 10 sec! z" Y* z. t, g/ ]9 q; U- Q
        if A_i=A_leave then send to die0 r2 c9 Z0 V. G2 E( h$ u2 u0 ^3 \
        else inc A_i by 1
) O& `# K; a- p: N, I, `9 R    end
( G4 {6 X; f* O$ [- Bend
! r2 u1 M# e, n+ x' r- W( i6 b
begin P_pick3 arriving
# l/ _& O1 d: k. j* }# M& R    set A_i to 21% K% }* c* ^. m' a
    move into Q_induct3, Z/ O' u& _6 S& Z5 M" o
    move into pickaisle.induct3
7 N5 T. q" q) V- b- O- A    while A_i<=30 do begin
6 q: F: K# ^, B        travel to pickaisle.con(A_i)
! k/ e* Z3 I( S. T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) H% @2 o& J( N: h        else wait for 10 sec
2 ~! }3 R) C8 L) _+ N+ K& u        if A_i=A_leave then send to die, |1 Q, [) X8 s
        else inc A_i by 19 e6 n. s- e+ G0 c
    end2 N3 S9 X2 P+ q% ?4 K7 }' 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,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?) c) _! F7 h/ n, E4 W5 U6 `; W
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- Z$ O+ u" L& ?# G: Y5 q( v7 ^6 P$ k& R. Z/ `" |2 T
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。4 L: W) E" ~  g: H$ ~8 V

* o! I' H: Q) d/ E" v9 r: H) \4 e8 M另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 A. C( K" w6 f0 U& p% Q+ [1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 U  T( {& e6 w0 s8 Z
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 g  P0 ^% O7 O1 G) @3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. T% q$ b5 O9 S, {) ]begin P_induction arriving
. _, G) ^& l) I% Z: r) }/ N5 j8 \    clone 1 load to P_pick(A_induct)
; q$ X& U, ~1 X' x; T6 [/ Send最大的系
+ `, {8 f& q9 G* _: {  g
5 g; Y% ?, [/ a# `) }begin P_pick arriving
8 V0 r  m3 o# F& w- m; {    set A_i to procindex * 10 + 1
# n* U* i7 Q1 ?$ c    move into Q_induct(procindex)6 ~; G7 H: ~8 |3 W2 A
    move into pickaisle.induct(procindex)2 b* J! w- _) _' ^
    /*check the type of pickaisle.induct(i), for your last problem.*/, E1 Z" K; @5 [! |: T0 n8 E- F
# y# ^8 w0 o2 D
    while A_i<=30 do begin2 G# K. N8 Z; ?3 }% a  _
        travel to pickaisle.con(A_i)
% ]( }1 w( f4 h' X3 ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 {" D1 c9 ~  `        else wait for 10 sec. ^4 @. X( v* k" {; \
        if A_i=A_leave then send to die: P1 u) ]' L2 l" V, V  @
        else inc A_i by 1
2 C1 P) {$ W. L. m5 u- b6 ]& F    end
7 O6 N% {6 `* e+ pend
; K. w& j9 R% N' s8 z( z* Z
) d: q. l( @9 c1 v" H: |( b其中的procindex为整形,代表当前process的序号。3 j8 N. ]8 b( M5 U$ v4 }) ]; w- k: j
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-9-15 19:08 , Processed in 0.017146 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表