设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12880|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 r. g3 S; r5 a. D! V( _/ p

- {9 N) |$ `$ i* N* D/ `, |$ A: `3 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中的数值,不知道会不会有什么不妥。; u  b: |* a. o: _3 |
- d; s) r) Y! K4 T. U8 W" i
begin P_read arriving) Y' l6 f; M5 }. b
    while 1=1 do begin
% j! |/ i, F9 A$ r- N0 C: k        read A_tote from "data.txt" with delimiter "\n"
! H8 c9 ]. ]5 R: s" L; y- V        read A_time from "data.txt" with delimiter "\n"
2 m: z! i* b' }, C        read A_leave from "data.txt" with delimiter "\n"
; e$ \8 n6 }" g1 `" f! j/ ~7 U6 A        read A_picks from "data.txt" with delimiter "\n"
  |' [# D" s& @' l: C0 C: T. J        set load type to A_tote
* J! d) w9 @# q        if A_tote="tote 1" then set A_induct to 16 a+ f0 E! Z$ m* r9 O
        else if A_tote="tote 2" then set A_induct to 2; p# W* G# x" X) e1 O) w1 d
            else set A_induct to 3    $ Q7 j, c8 l! B" }' \
        set A_i to 0
( m" M% ^) v  X        clone 1 load to P_induction: A( x2 ^& R* O% W
        wait for A_time sec+ s/ t  ^1 s) S- b) ^9 @4 Y+ e
    end1 \6 O$ u" H, i. V; P$ }. C7 \
end
* U! Z" a9 Y/ O/ Y" J! V- ]
& K- e$ y* G/ hbegin P_induction arriving
2 v! s; G4 a1 g2 W$ S    if A_induct=1 then clone 1 load to P_pick1% O, f* v7 k& c( F0 p9 s: c
    else if A_induct=2 then clone 1 load to P_pick2& p* s1 I5 Q# C3 y- _  c0 X" a
        else clone 1 load to P_pick3
4 X1 q9 P( E& T7 Zend" r5 y+ Q! Z/ [- [2 |" n3 h
7 f5 ?4 c% J; d' h! i$ {
begin P_pick1 arriving9 E4 W' n3 _6 G& k
    set A_i to 1
; B: W( v7 G5 X& F% ]7 _1 v    move into Q_induct1
. V& ?# ^6 X, F6 B) q    move into pickaisle.induct1& v, p& @7 C4 h' M5 ]  W
    while A_i<=30 do begin
5 p* o! b' f& E. Y4 m        travel to pickaisle.con(A_i)/ z) D6 N* {% h2 J* T! N$ d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  ^) g) r3 Y' q  M/ ^        else wait for 10 sec5 f! o& L: @# n. s+ _- [0 t* G
        if A_i=A_leave then send to die
1 s& f. u, m( W; @" |2 x) h        else inc A_i by 1# Z' A" n6 h4 _1 m
    end
  x$ a3 D' q  c9 l( _6 ^end
/ h6 F: A5 ]9 x: B2 \8 t$ ]2 b4 D% }1 R# m( H8 e* H* f
begin P_pick2 arriving! P7 C) c5 ~6 i+ T. g% _2 w2 a9 ^
    set A_i to 11
- y- j. l2 C9 P    move into Q_induct2# v4 O% S/ V- k" z
    move into pickaisle.induct23 F" ]4 s2 y0 T/ p% W  A! ?" y5 r' ?
    while A_i<=30 do begin* k7 {3 ?/ I$ o7 V5 |- q
        travel to pickaisle.con(A_i)
! M  t2 b  l7 u- K( ~$ M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ v( Y2 ^7 R. k* A% D- `
        else wait for 10 sec& F4 I8 p, p$ D- Y3 o% {; k
        if A_i=A_leave then send to die8 d" H  M5 n3 K5 h/ {# b: Z8 w
        else inc A_i by 1# H: \5 j+ @$ C; E- z, ?, i  d
    end) m9 |; D1 N6 g3 @* B( I
end
! }5 O$ D: V, w; ?8 t7 F7 m. d4 Q( }) a1 ]
begin P_pick3 arriving
/ w* d8 U2 m6 F- s! [9 B    set A_i to 21: _; e) ]* X! n5 `) k
    move into Q_induct3
3 A2 n1 F/ ~" ]0 O9 i    move into pickaisle.induct3* f  \5 a- R$ W- X, \/ l8 B& C
    while A_i<=30 do begin% m- G& j' r7 e/ G, x9 s" g# C
        travel to pickaisle.con(A_i)
0 O7 i1 s/ N0 M5 @3 u9 D  L8 `, O  {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( J  g( Q3 W) S  @- I
        else wait for 10 sec
& p4 ~% U; S* I# W$ C        if A_i=A_leave then send to die
7 `! k0 M& I. l! I        else inc A_i by 1
+ R2 K% H0 p1 K; m! Z    end% u! w- i, E; C5 t
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是个什么东东?: [. _$ F* U& a- h
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. Y2 e2 W4 {9 g
" Z" ^6 S- @: AAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 Z/ @* ~; B) ]) ^8 b
  t0 J0 Z  F2 @- o$ |) v  b
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:; w& \' b6 @' D" b/ c
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* q+ H' D5 Q$ W
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; F! [: K4 j4 N
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 k5 i2 A: c0 I, q5 V/ u9 Wbegin P_induction arriving
: r* {7 b& q  ?/ G    clone 1 load to P_pick(A_induct)
' N! x: n. K% ~( R0 c* f* Lend最大的系& Z+ [9 {6 U+ d) L, w3 w  l

* P  V; {0 B9 h) k, mbegin P_pick arriving
6 y9 @- y: a+ ], Q, S! n; p    set A_i to procindex * 10 + 1
9 s- Y3 W9 F/ I  r4 j/ B5 ]    move into Q_induct(procindex)
' Z4 G1 y0 \8 f5 o0 B9 c, x! ~    move into pickaisle.induct(procindex)
4 Y! g# d  a/ s- w( O" S    /*check the type of pickaisle.induct(i), for your last problem.*/* l6 K3 V) a  e: W

" y' ^3 M: x3 }( E0 D- {    while A_i<=30 do begin
) a( J8 u" I: H( C        travel to pickaisle.con(A_i)& Q# t, G5 C3 Z4 c6 ]8 [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 T( r5 [0 w2 e8 u1 x5 q
        else wait for 10 sec
) S2 y, |( D& q" @; y* I+ z$ O        if A_i=A_leave then send to die
6 o2 B$ s2 j- t# ~7 t        else inc A_i by 1
) z& ~  A+ {5 a0 g. b) H! Q    end
1 d, C2 T: U/ n! k: Gend0 `( J' z+ n  c

# F. B, M; C, `9 I其中的procindex为整形,代表当前process的序号。' T3 h" e+ K# H6 s/ P( P+ G
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-2-27 03:53 , Processed in 0.018573 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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