设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14395|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ H9 Z6 I5 b: t+ y7 {3 O% H* D8 P) _' C8 |
我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 o4 v1 Z. ?4 Z: s/ C' @
9 K! a9 M3 S6 t# C4 {$ X
begin P_read arriving# d3 p6 M# U- i
    while 1=1 do begin- ?  \4 F3 E: D, c2 \" Y& `9 K
        read A_tote from "data.txt" with delimiter "\n"# v4 Q2 y# g% m4 H3 y
        read A_time from "data.txt" with delimiter "\n"
% c: F, ]8 w  y. G4 \) d) G3 y        read A_leave from "data.txt" with delimiter "\n"  k4 ^2 n5 T8 e/ {; |$ R! H, M+ d
        read A_picks from "data.txt" with delimiter "\n"
& r0 v" t, I( l5 {        set load type to A_tote9 l+ z1 @, v* B
        if A_tote="tote 1" then set A_induct to 1, L4 ~; j: ~/ p! a: Q4 [
        else if A_tote="tote 2" then set A_induct to 2
" }) L. a) v& U& ]5 o3 x            else set A_induct to 3   
3 T$ ?1 d: D1 p4 k/ J& j        set A_i to 0
" X) y+ y8 K. v$ L$ G        clone 1 load to P_induction, H8 P$ \& p; p5 o
        wait for A_time sec% ~+ M( r5 u: }* u1 F1 R; f
    end
, L; j- W! Z' r7 z% t: t& @3 Pend) X) }/ ]+ T9 J  u2 e8 |* i
1 \6 A0 B0 `  w2 w
begin P_induction arriving
/ b  N; e4 M4 o2 U' d    if A_induct=1 then clone 1 load to P_pick1/ t. p  R1 s# _2 K
    else if A_induct=2 then clone 1 load to P_pick2
0 @2 M) j: K8 `9 }- W        else clone 1 load to P_pick3
/ r' i  L# b3 _$ b8 Pend! O& o8 h" w+ I) E
+ S- T* J" ]( o# o
begin P_pick1 arriving1 O: M, T' F8 s) V6 L) ~% |1 x
    set A_i to 1
% u- f  n: _3 x1 o% {! e. K3 l    move into Q_induct1
$ F: `. @! S( f. T- ?3 H    move into pickaisle.induct1
" K: d% b: m3 W: |1 |* _    while A_i<=30 do begin
  S  m7 c+ L4 \4 _7 L        travel to pickaisle.con(A_i)# V( J+ B% K* }/ I* s1 g. O+ [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 P6 z# F4 R" \  u' G8 U! j
        else wait for 10 sec
1 D! H; H/ v+ ?2 `' _8 E9 p$ r" u        if A_i=A_leave then send to die
2 e# ?( A  ]8 u7 m6 z        else inc A_i by 1% ~2 [; [# \0 T) p# E" N+ m. ^
    end- h# r' {5 D1 w  I
end
  i" ]) v1 l$ c# g3 [- K0 @1 t: G( U' o1 r# q
begin P_pick2 arriving9 W7 _) D# d+ p$ D
    set A_i to 11
+ Q' K6 m7 t# I; w$ m$ n    move into Q_induct29 L; m& ?7 H( l# r! m& N( d- n
    move into pickaisle.induct2; z8 A% l2 A* y/ W1 E- f, p
    while A_i<=30 do begin
& P4 g% t2 [# `% A2 d        travel to pickaisle.con(A_i)
5 g# t5 b+ \0 c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 \6 f+ H6 g' ^* s$ u! R        else wait for 10 sec
" `  ]% U- O1 c3 h5 a6 ?5 g        if A_i=A_leave then send to die
4 d+ ?, ?# O0 v        else inc A_i by 1. C- ~8 y7 T$ d7 F+ ^/ _: D
    end
. q8 A1 Y' r7 Nend# D& E0 T1 H- u+ m7 m$ I/ j; A
1 E6 e( I, c7 p7 g: N8 I
begin P_pick3 arriving
) ^* W( o6 q. e9 w    set A_i to 21
" V/ i$ m( w/ ^9 X' ]    move into Q_induct3; i# q& X8 \! A/ V, {
    move into pickaisle.induct3  {8 n/ d# f% ^2 c7 c; Z
    while A_i<=30 do begin( Q5 ^/ Z, z+ g2 \
        travel to pickaisle.con(A_i)
4 n* y* H8 F) O9 _& [( f4 K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( m' a! u  X8 T. w; _( {
        else wait for 10 sec
, w7 S0 L% F. g8 o; t0 a) y8 J        if A_i=A_leave then send to die) M" E! V% }! s$ S
        else inc A_i by 1
8 K9 d+ d( [$ t: \    end
0 {8 x- {7 N4 |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是个什么东东?$ A2 w# {8 a+ Z
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 m2 M' e3 i, V" t
* s! W5 O* D+ C( E4 w: M8 p4 \AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- M" T! ~6 v. U- H5 v* O/ n3 s& R! {/ v( [( Z; D
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- \) Y0 R- h9 w; w( x$ r0 }7 w$ a
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 i% D% F4 K1 b" C
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 k5 O& V2 ?% i* u( y, {, r! O3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 D- s. d$ a" Wbegin P_induction arriving
  R' |. x' v$ [  Y    clone 1 load to P_pick(A_induct)
1 Q; @, r+ r: g( O+ Jend最大的系
3 Q2 q7 c2 F; O/ B' k0 N0 r# @& a1 B7 q- S4 P' E
begin P_pick arriving
7 z' O7 r- S& C; S$ Q5 ~5 h, B    set A_i to procindex * 10 + 15 F4 K) _+ x. n6 }* J( G
    move into Q_induct(procindex)2 v% w' z7 }0 K
    move into pickaisle.induct(procindex)
% ^* L  B) n: }$ i. I& e    /*check the type of pickaisle.induct(i), for your last problem.*/: j' U1 V1 R# Q+ l; o/ h

: J0 r; D* }3 ^% p% {/ \    while A_i<=30 do begin
# ^4 f5 S2 z& e7 n+ q        travel to pickaisle.con(A_i)7 Q4 P# M; ~6 h+ O' v3 N1 g9 k; K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" _+ I; ?# @0 Q) S        else wait for 10 sec+ y( s  }2 }5 J; _! B
        if A_i=A_leave then send to die5 H+ Z$ S8 _  Y
        else inc A_i by 1
( p! v1 T. R/ d7 t7 ?    end$ f4 K) c( G1 U9 {7 L
end
9 U6 @% L& l$ f( E7 ~6 }& Z5 z- S
6 K9 j% W) m8 H5 [" `% d3 f" B其中的procindex为整形,代表当前process的序号。- Q9 I( }+ I* `+ s3 a6 u
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-7-9 19:13 , Processed in 0.013415 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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