设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13512|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, d% `! ~( E" k; B5 \9 k

; V1 n" k6 X& Q. R  w9 g' l我的问题是,在每个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中的数值,不知道会不会有什么不妥。  H3 H0 _3 D/ t4 \0 ?. x; J$ f
* x1 l; V. q, I! ^
begin P_read arriving
7 f/ B  l' O3 c    while 1=1 do begin8 [2 ]$ g: \% ^- k* r+ p$ _
        read A_tote from "data.txt" with delimiter "\n"/ q) h1 d7 o; i8 v" h
        read A_time from "data.txt" with delimiter "\n"
& U2 P$ A; n: r        read A_leave from "data.txt" with delimiter "\n"& _. {% t* k1 B9 s  B
        read A_picks from "data.txt" with delimiter "\n"# V! \8 l9 a5 s
        set load type to A_tote
0 h, M7 R6 N0 {* l& M        if A_tote="tote 1" then set A_induct to 12 q# l- j7 x. t' l
        else if A_tote="tote 2" then set A_induct to 2
, u& O; I2 O4 S0 T( J5 l7 |            else set A_induct to 3    , ~7 l! f0 T1 L) V
        set A_i to 0
5 F; A- L" @# |, U) h  m        clone 1 load to P_induction% D  e; y3 I1 k9 j" C1 D0 }
        wait for A_time sec
! y+ V4 E! M( m! u& s    end* @1 z* @7 f6 d2 `+ W
end# A& y- F% x8 ~5 n' z4 Y

1 f* H- V  J2 h- w5 O! `9 Z6 k. Ibegin P_induction arriving
& d  P+ V. S5 m7 y) `" R    if A_induct=1 then clone 1 load to P_pick1, c' E: A6 K) K4 t6 W
    else if A_induct=2 then clone 1 load to P_pick23 Y5 ^& k" j- K/ b7 j( I
        else clone 1 load to P_pick3; L- c5 i4 u' F' W! `" @& m
end
5 C+ U3 M3 j3 J8 v& ]1 m
6 I+ @) w" H% rbegin P_pick1 arriving
4 i1 ~5 T( O% ^, [8 M    set A_i to 1
- A- Z1 ]) M& A% N- Q    move into Q_induct1" ?9 n" @( w* j% d! B1 k9 r* |
    move into pickaisle.induct13 }. v3 o1 u# m, H5 u$ q
    while A_i<=30 do begin! @5 R+ R0 y$ F( o( l
        travel to pickaisle.con(A_i)
8 @+ W. h' Y" v( N0 }; Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! S+ ^5 s$ \4 W8 q6 X8 L        else wait for 10 sec& ~; W0 P; e* X; j7 f" b; C+ e
        if A_i=A_leave then send to die
& j( @: c6 C( `- t" `        else inc A_i by 1
( `0 L& O' z. `! J    end
# S2 c5 k( `6 J6 U: A- ^" ?# Y3 \end2 m' c. P8 t  T* z, w2 p
9 |' ~+ Q8 z( o3 ]0 P
begin P_pick2 arriving
' L! `8 h+ }8 @    set A_i to 11* _! W  ~  \3 X  n" Y7 J4 V
    move into Q_induct2
9 L* R* ~, |4 F    move into pickaisle.induct2% l+ w) i3 W6 S0 [* C3 e6 m. }
    while A_i<=30 do begin
( ~6 K% E; {- o3 q5 B3 x* e6 @6 Y        travel to pickaisle.con(A_i)  w, ~+ \7 @. o1 g, u& g- b1 A2 s# Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' m0 D/ h. {: T) a' w! u+ _        else wait for 10 sec# }$ {6 b# B; V1 `6 W, A
        if A_i=A_leave then send to die
0 V/ B; F1 M8 S1 n3 X% t5 S        else inc A_i by 1
4 f$ i/ u% `: T9 ?8 n    end
! z! z( \. i1 Y7 eend# A! v& X5 U! l, D+ D
) ?7 Z. W" ^5 F/ y7 S. P5 [9 M9 z
begin P_pick3 arriving/ u6 h2 b3 I  J0 y
    set A_i to 21! L4 U8 `" h& ]
    move into Q_induct37 U2 R) E6 Z5 H" t# Z
    move into pickaisle.induct3# `; \0 }) R" N6 y& \
    while A_i<=30 do begin4 |. l0 U; A4 s) G
        travel to pickaisle.con(A_i)9 s* G% C+ [( E) p9 H5 D2 u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" P/ ~$ }! e& Y
        else wait for 10 sec$ O6 B, g  m( K  X5 u, X: h
        if A_i=A_leave then send to die5 L/ h# q7 b4 ^% I' r! e3 {! P( c5 M4 n3 ~
        else inc A_i by 1  y9 S$ Q+ ~- J
    end+ ^. s& K, y8 J& u
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是个什么东东?" v$ ~9 Y% L* E1 Y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?8 c! q7 W* `3 n3 ^/ C! I

% y1 r5 o5 `2 q1 r+ {4 ~. o  _* pAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ P* e7 |3 p' Z% E/ T

/ u7 @( @  @5 p/ L/ M" u另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) [2 a% u5 F7 @. N
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. U; g1 [( }. C; o2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 h3 o/ S0 y% n7 E2 h3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' E5 n3 g& z& [! N
begin P_induction arriving
9 }& u% L$ t4 u& b5 k    clone 1 load to P_pick(A_induct)' X/ |8 u4 ^9 B5 p3 P+ J' ?( [
end最大的系7 M+ |6 h, M4 y* t' q
- s" n& A' J$ ]4 G
begin P_pick arriving
+ Q5 R2 l1 ?4 B) Y+ p    set A_i to procindex * 10 + 19 |) ~0 _6 `5 M5 P
    move into Q_induct(procindex)
8 ^$ B* B6 E5 c8 @  d8 n0 G5 B    move into pickaisle.induct(procindex)* l1 Q' g' F8 {7 Y
    /*check the type of pickaisle.induct(i), for your last problem.*/" A  R' L: t5 c% @, I6 t( `
* q( X$ j1 h% ^( t5 S
    while A_i<=30 do begin
5 y! T6 n: l) V: E4 o        travel to pickaisle.con(A_i)5 c  s4 L- \9 u6 |# M8 K2 L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( e8 L$ `6 O( Y        else wait for 10 sec. {4 h7 W1 y  s; T3 o
        if A_i=A_leave then send to die" C, D" z( U4 G0 d
        else inc A_i by 1
0 j* c. u5 y* ^/ M  c& r) j2 X& j    end2 h- ?( Z0 g/ H# F; J3 h
end% a, m+ F( F3 L6 i  R3 y4 k7 e
" I$ `$ f% H" T. o1 Z1 E7 c8 N
其中的procindex为整形,代表当前process的序号。  ?, ^3 G' f" k4 B, H' j9 e
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-4-18 07:21 , Processed in 0.018128 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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