设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12536|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* b7 ]* w9 G0 W" U. w; J8 e/ u- _' \  Y2 j
我的问题是,在每个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+ U' ^& h9 W
: b7 [: ~6 U0 _, D) H
begin P_read arriving' p  g. ~' ^' t! l$ c% a% j
    while 1=1 do begin$ W; y- u( R% ?/ Y. G0 p
        read A_tote from "data.txt" with delimiter "\n"
7 ?7 Y8 u9 T/ B3 P# N        read A_time from "data.txt" with delimiter "\n"  j4 B8 y- e/ G: ]. Y
        read A_leave from "data.txt" with delimiter "\n"! r. R6 j0 k$ b- D0 L5 s1 D; Y
        read A_picks from "data.txt" with delimiter "\n"
4 ]) N/ m0 P) {: ~        set load type to A_tote
" \, `1 e. Y* D- v        if A_tote="tote 1" then set A_induct to 17 h4 }6 c' \4 B. |
        else if A_tote="tote 2" then set A_induct to 22 S# [, F( F& |8 X2 f8 g8 _$ _5 X
            else set A_induct to 3    $ f# I2 f: x8 _. w$ F
        set A_i to 0
" k1 m! m7 {9 D; H; V6 V" k        clone 1 load to P_induction
, ]" D& Z8 a* o$ D% k) L( c9 s        wait for A_time sec
* F' ]5 {1 {( M; q3 J8 L( J    end
4 t6 l# g/ w2 ?4 U. xend
6 F  [+ k1 `- a* O! E
9 f  ^7 [% w5 g! k% Z2 e' ebegin P_induction arriving* D  h3 e# Z0 i, I' `4 ~
    if A_induct=1 then clone 1 load to P_pick1& w% }8 T# C: s. u: `5 H
    else if A_induct=2 then clone 1 load to P_pick2
' T9 R. u. q1 R) V5 r        else clone 1 load to P_pick3" y2 }0 F& a1 D0 Y" r
end
; F  K. w9 m" a% P6 j4 z3 M2 b* m0 q0 x) M, X
begin P_pick1 arriving
  J8 D8 [+ ^: D( l9 _2 r    set A_i to 1  \$ h5 K7 p: p
    move into Q_induct1- p4 s8 ?0 }. x
    move into pickaisle.induct1' f/ s( @8 I$ R+ y+ L" H
    while A_i<=30 do begin  B  t. a8 q' }5 q& L% W8 [
        travel to pickaisle.con(A_i); `. `  w$ x1 ^( i" ]5 S9 e5 C: W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( ]  k7 o. ~2 W9 b( ^; r0 M
        else wait for 10 sec
* r4 a9 j' g: K4 J4 k        if A_i=A_leave then send to die( z* L2 d+ ]6 b4 }4 s
        else inc A_i by 1
  I5 I3 x# a3 q" y" _. v    end( {6 ^) o) S5 F2 g
end
* b% w" r$ A' \/ D, e2 h. A  }. Q
# H- X. M  ^9 {) p' _begin P_pick2 arriving. h. M  i: m. q2 ^7 Y
    set A_i to 11( A3 V- t3 W  Z
    move into Q_induct2
& b. F7 Q. p9 i& G    move into pickaisle.induct2/ B4 V- X  E+ W8 c  ]
    while A_i<=30 do begin
; z* |& B* u0 g9 e7 v        travel to pickaisle.con(A_i)
. O3 f$ ~+ q) Z1 J" z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# G& l, ]& }, L        else wait for 10 sec
* _' f' [7 M( R, _' W+ f. S' {        if A_i=A_leave then send to die
# ?: F& U4 [. @5 h* K        else inc A_i by 1
( s5 T% S" |1 J/ D2 l" c    end
9 T# n  P% D3 q, iend
5 t1 P* p: w% T1 Y4 a) j
4 T! K( [# ]# p6 X7 Ybegin P_pick3 arriving9 v- q' D# n6 D' V6 J9 ^6 _3 K3 p
    set A_i to 21
4 z( ]# W9 @+ `7 T9 q- E! m: {1 e" N    move into Q_induct3
! ?  |4 V# j- {$ X5 i    move into pickaisle.induct32 Y. R4 `# |+ b: S
    while A_i<=30 do begin
' {" g* B; m3 y5 {" k        travel to pickaisle.con(A_i)
2 L2 @4 Z$ T: b1 c% e) ]- \9 T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 |) \3 U& A% ]% Y: b/ f        else wait for 10 sec
4 p/ J& V( I5 t9 j4 c- N5 q        if A_i=A_leave then send to die2 J, C& A4 z# P" A  y
        else inc A_i by 14 N/ `5 K1 q& v: T! g
    end
7 @; \( y4 ?3 V. ?) K1 q2 fend

最佳答案

查看完整内容

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是个什么东东?/ h, K: c8 ?$ [* V
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. Z. @$ P) }3 R: Y% `0 H$ w

) R& k+ L/ X& b  h( vAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 q5 r) X7 s  Z9 U- e
+ I7 w7 m" V' x. Y
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' U& s* [" ?2 A# P1 e
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& Q' U3 w, _) j" X0 O; G
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 W, G& y6 M- M1 Q7 [. t3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 R$ d% V* O8 ~$ h+ t) i8 L7 u; b
begin P_induction arriving9 n$ S9 s! T1 J6 |9 _& ~' w
    clone 1 load to P_pick(A_induct)
- l3 E  o4 `  g: Xend最大的系8 q/ e9 @0 K# }/ |3 _- m8 d" y* N
+ T) k$ v+ O4 t5 Q4 V, T! d
begin P_pick arriving  A+ `! q8 j% e/ i3 e
    set A_i to procindex * 10 + 1  ]" f3 p, e! y. |6 ?/ j
    move into Q_induct(procindex)
, v- J+ m2 k7 d3 s% c, s    move into pickaisle.induct(procindex): z. S$ q0 Q. J' B8 X+ G
    /*check the type of pickaisle.induct(i), for your last problem.*/+ m& \. c% c" S( I2 M8 d, O

8 |  s& }9 O2 Z" H% U    while A_i<=30 do begin! J7 r/ C7 ?! v' d5 n1 @7 G' J9 N
        travel to pickaisle.con(A_i)4 J+ Y6 n7 K& [; l! e" S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# E2 K4 G8 Z9 B, s: x0 c; [        else wait for 10 sec5 h. q  q* K9 f2 j# r$ F1 B  o
        if A_i=A_leave then send to die
) X. G4 s/ O/ n% n' L* _3 P- U        else inc A_i by 17 k. r8 Q, C5 Z# z
    end
% [3 H8 C8 U8 A8 send  q# k- q5 V% A- [0 c3 f" }

; m- K. p; k& ?4 ^# W7 `$ K& o& _其中的procindex为整形,代表当前process的序号。0 S; X! T5 D. O1 c
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-1-30 16:04 , Processed in 0.018670 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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