设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15656|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( I8 B! {& w2 y2 f3 R
: p2 O1 F2 k% H6 D我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 l3 n3 d& \, m0 W. k
( c8 W; p$ K' T& kbegin P_read arriving
: P- j5 E4 R2 J/ |! O7 ]    while 1=1 do begin- f+ a; O0 L* ]$ d) u- w
        read A_tote from "data.txt" with delimiter "\n"- k/ b' [6 `4 x! t  o  G
        read A_time from "data.txt" with delimiter "\n"
7 S; u6 H* t: b/ M4 q3 `! ]        read A_leave from "data.txt" with delimiter "\n"
$ {5 p/ |. L4 J: B" H2 d7 x7 O1 [        read A_picks from "data.txt" with delimiter "\n"
3 E  N9 R. p, ^! _0 ^        set load type to A_tote
9 Q& e) q8 b0 Z1 a+ e        if A_tote="tote 1" then set A_induct to 1* B' }0 a) Q! z1 C3 V/ I$ F
        else if A_tote="tote 2" then set A_induct to 2
, ?& C( Y; i: L# d; G6 J9 j  Y            else set A_induct to 3   
6 N" e( l! s5 Y6 s        set A_i to 0( G3 \2 K, [! H6 t: {
        clone 1 load to P_induction
- s" K: a/ S* z  Y4 `/ B        wait for A_time sec7 ~$ x& m' E6 Y8 W1 b
    end
" x7 S3 h1 m6 @  G. Vend! q% _) d1 H& _) \4 R  l, h2 v

7 O# a) {  d, l+ N! `begin P_induction arriving
. E2 G# H5 e5 t    if A_induct=1 then clone 1 load to P_pick1$ S# }! G9 j% v( V) y
    else if A_induct=2 then clone 1 load to P_pick2: v3 [! D$ ]1 v# D
        else clone 1 load to P_pick3- J: C& d5 n1 g) Z3 i9 S
end
. I7 T  a# B) t
: f4 v, O1 O( x7 K! o$ y( Ybegin P_pick1 arriving
) k# ]: t5 P5 P2 R" t& ]0 K* {) S" M    set A_i to 1
3 k- o* p" ]8 V- R1 ]5 D    move into Q_induct1- V# d, r% a$ U, ]+ t
    move into pickaisle.induct1! c/ Z. G6 i$ G. a6 i- f
    while A_i<=30 do begin
& Y! \6 f6 Z2 o        travel to pickaisle.con(A_i)/ W! [: q; Q; O. F: `' t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, u8 l6 g/ Q9 F6 |, G- }5 E
        else wait for 10 sec# a& h) A; K) g$ K; R
        if A_i=A_leave then send to die$ F6 E: Q1 M1 U& U
        else inc A_i by 1& _; Z! j) m2 q" t2 b: ^
    end/ r, D3 W# f, m6 ?; K
end
% }6 D7 E5 h2 H8 \5 S0 v& Q. Q# o# i7 G( G1 \
begin P_pick2 arriving
* v, E4 X" Q' G4 n: p4 z8 W    set A_i to 11
+ F  `8 P6 i  ~    move into Q_induct2
9 Y! a5 g+ p$ X2 r& H, R    move into pickaisle.induct2/ X; R" {% `) q- @: c) S5 ~" z5 E
    while A_i<=30 do begin
! x' Q, H( ^/ Q. u- [        travel to pickaisle.con(A_i)
- I$ c6 o* C" H$ n. w( \% @2 v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ F. X  B  d5 m( s4 L& }        else wait for 10 sec/ ?% k7 n3 [3 N; u8 i
        if A_i=A_leave then send to die
9 p- P8 K" ~( m+ k        else inc A_i by 1( C7 `" r- b: S2 X  C" N
    end
# \+ q3 Z9 Y2 V2 bend
& a2 _7 O/ _8 W
# d6 a/ G" e( ?begin P_pick3 arriving( l2 Y4 j' ]- A4 O$ l
    set A_i to 21
  _, F) ?$ F7 D/ Y! J; O: I: B    move into Q_induct3
5 {: R; w, [+ O4 ]9 i7 `( l    move into pickaisle.induct30 G2 [8 W2 P: ?/ l. U; v
    while A_i<=30 do begin
* ?7 p8 u( y. i3 `        travel to pickaisle.con(A_i)
0 y; c9 |& W+ H; g, Y9 u" r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 l+ w1 H) A1 N7 E8 Y  h4 i        else wait for 10 sec
& o0 U8 p( H$ e- m/ f        if A_i=A_leave then send to die
: e# Y7 C+ Z; X. `% H        else inc A_i by 1+ C2 _8 W. x% C) z
    end* R9 }% n* z5 m7 V# E3 \1 h
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是个什么东东?
1 }% s' p& p% c. j' t/ I" j* c1 lmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, D( ?" w/ U- ^4 t$ D' \) R
' w8 Y. k5 k8 v7 h. f$ ^% }- G
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: m0 |. b# V+ Q; X
" [6 P( b  m) Q2 I. P9 [1 n9 a5 Z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  q& `, Z- y* G) A' H7 h2 g/ n; Q1 s
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 ]( H+ C* F4 H% \9 w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, k& F. ?  c& J8 s7 x+ q
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 \: J) D' h8 z: I. j; D- N/ F6 qbegin P_induction arriving/ M! M  W+ V6 k8 ^/ F
    clone 1 load to P_pick(A_induct)
& _, ~/ n2 r9 s# D- B- p. s. cend最大的系
0 ]; d, B( ]% C" J+ g0 b) \6 p! K1 C/ D# |5 m% q: `. a9 F$ I
begin P_pick arriving& n  o& b; A3 f- q4 C
    set A_i to procindex * 10 + 1
1 z$ |, A8 ^- y. C& X3 H    move into Q_induct(procindex)
' C# ]( ]4 J( @8 Q; L    move into pickaisle.induct(procindex)
+ d- ?/ V: k: k) S+ E    /*check the type of pickaisle.induct(i), for your last problem.*/
, l: G8 A/ E, P- ^' b  Q3 j4 ~$ r1 S& k( q  H8 C
    while A_i<=30 do begin
- M+ d+ C( k6 e) a        travel to pickaisle.con(A_i)
* }' \" ~: }: \6 W3 ]( M$ ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 M1 Q, a4 g  v* y) P$ y3 X: L        else wait for 10 sec3 N: v% {1 b3 c7 D  ?
        if A_i=A_leave then send to die
0 w8 ]5 M+ k& Y9 h# D        else inc A_i by 1
( L* x1 F# O3 }" @    end$ l$ n! G4 x, y* [( z. d, Z
end
  b- Z2 S1 }5 b+ y' i& U$ j4 y& W* _8 `( D; E5 h/ S' K3 o
其中的procindex为整形,代表当前process的序号。3 b  A! o8 X% G+ a
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-24 23:31 , Processed in 0.017150 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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