设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13711|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; e6 Z; l- O3 i# y  P% V7 r
% A% @& z( y9 f' b$ b: w* _我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 k9 G: D1 w5 ?8 R7 c0 V

3 u6 x. U9 r% B) ^" l: u* Vbegin P_read arriving- [. G5 t; f& b, s6 S8 y
    while 1=1 do begin
: ]' @; B' W2 v. N5 S        read A_tote from "data.txt" with delimiter "\n") U0 T; u4 T1 n+ O( N" N3 z! t
        read A_time from "data.txt" with delimiter "\n"6 c, e8 ?4 m+ F" v1 o( ]( [2 Z
        read A_leave from "data.txt" with delimiter "\n"
0 S7 o; [* C& [. W1 R/ l& ?4 `        read A_picks from "data.txt" with delimiter "\n", E5 R+ {- u% h) z; s
        set load type to A_tote
1 o2 ^, e, h' O- k6 o        if A_tote="tote 1" then set A_induct to 1+ E4 Y" C9 ]( M+ j+ W4 T  d
        else if A_tote="tote 2" then set A_induct to 26 W& d3 [7 m9 \1 Y* ]
            else set A_induct to 3   
  C" a3 X  u; k        set A_i to 0& u1 j7 m3 p0 [
        clone 1 load to P_induction, L1 |3 Q) M* g$ W* ^" i  [3 Y/ {3 j
        wait for A_time sec
( V: g0 F9 |- Z2 J# b3 I6 ]4 F    end( P0 C, S- z1 [0 k2 @4 p# d
end* s+ \  r/ d; ^' Q: Z
0 O+ z' K- _; k4 W$ Q6 [
begin P_induction arriving5 i5 J  ~2 ?% V" T* z5 ?
    if A_induct=1 then clone 1 load to P_pick1: I: R* p1 N; {* a, I  Y$ ?
    else if A_induct=2 then clone 1 load to P_pick2! h/ H/ C+ b1 W) s3 i: d
        else clone 1 load to P_pick3- l8 Y; g+ h$ _& [0 {7 A6 F
end
8 D8 z" X0 q6 t1 W: Z
  t. r% D7 {4 m* K6 X8 v9 xbegin P_pick1 arriving
& T( i9 C3 ~  }' X* p8 N    set A_i to 1( k0 s6 S1 t8 t" X" A
    move into Q_induct1
6 `9 ]+ T- q) M! O* ]    move into pickaisle.induct1
4 J+ m( Q2 @% @% ~% }: ?    while A_i<=30 do begin
& v! @+ g7 r- k0 y$ F/ P' ?7 |/ ~0 [        travel to pickaisle.con(A_i)3 H. F) O5 T# W% J! F( s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) Q" O6 i( }! M, @        else wait for 10 sec
2 E& C% x; W1 n# B( x2 J1 @2 E        if A_i=A_leave then send to die" v2 A1 O  Y! V. K( W& E, I0 [( z
        else inc A_i by 1: G% @( d( |& ]+ n) ^
    end' U- B% @8 X/ j$ H! b
end
6 _' u3 |9 s$ v. ]# p1 H$ ^$ B% b. h' V& G) u
begin P_pick2 arriving2 r6 |) r; a9 D5 s
    set A_i to 11
- E4 \9 ]; f% [# \2 L  @: N0 A    move into Q_induct2
1 E; Z1 t( b: I5 R7 q3 p" G$ M    move into pickaisle.induct29 }  n& H' U9 C
    while A_i<=30 do begin
7 Z7 w6 x/ h5 @* {% ]        travel to pickaisle.con(A_i)
* c6 ?' r+ |9 `# S: S% ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* K- C8 H4 K* s$ e        else wait for 10 sec/ ]2 }4 ?8 {: u! `0 s; ^
        if A_i=A_leave then send to die
& ?& C0 ]5 z. V9 s. U        else inc A_i by 1
/ B9 p* y4 j3 o1 I    end/ z# |& Q$ X; X9 j
end
8 f( S. n! ]  r9 ]1 Y: |/ u# f3 I( X% m- r9 M% [
begin P_pick3 arriving
0 g/ W: L) e# A+ ^7 i2 Q" w$ \) U$ b    set A_i to 21- F0 J4 Y- c) j) I
    move into Q_induct3. I$ y. N1 h3 x
    move into pickaisle.induct3% u8 ]2 a& v! X# T: D1 i" B) x# }
    while A_i<=30 do begin: b1 M7 P3 }0 }5 w* O
        travel to pickaisle.con(A_i): k$ |1 C4 y. A1 h3 j! U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. H) ~8 P: b- j" }
        else wait for 10 sec0 h, O3 a' Q2 U$ u# l% a" v
        if A_i=A_leave then send to die/ X* f" c1 B, Z; t# `0 }
        else inc A_i by 1. t# X) G% j2 Z0 {5 u
    end
$ d% R! m* C  h( }) _% X: Rend

最佳答案

查看完整内容

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是个什么东东?
. ~) x* B6 H1 M% omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& w- F. k+ K- D8 H. w1 d
" i  E9 m  [) [" D
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 Y& d1 H4 ~4 B9 r

1 _- F3 y- c4 Z1 h另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" o- C' _4 r# }1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# |* O% h* n( ?, X2 {2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ k4 j+ m% O# P* D
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* g9 w% w) ]8 s& Ubegin P_induction arriving
0 Q/ h9 g4 L3 b3 b% T    clone 1 load to P_pick(A_induct)
5 I' w" o$ w, s5 z* e" s& yend最大的系
' G' E) h. h, ^. I, o
8 f# O, m! `( k/ T9 Fbegin P_pick arriving
' q. u7 Z! u3 U+ }6 W. S    set A_i to procindex * 10 + 11 K6 p9 W/ A0 F+ @2 g0 w+ U/ k7 t
    move into Q_induct(procindex)# b, \5 R( D- ]" Q0 ]3 a
    move into pickaisle.induct(procindex)
' s2 x# D; f' V- t8 ^    /*check the type of pickaisle.induct(i), for your last problem.*/0 a0 G+ u& ^+ A! q
1 m  [2 s" p: v! t2 c$ P- R' w' B- a
    while A_i<=30 do begin
; n( [  H% Q$ ]9 ]) L        travel to pickaisle.con(A_i)4 M$ w# z. T5 e5 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 q9 D# w2 y$ O% M8 J5 e        else wait for 10 sec
* s2 f" d$ s& b3 j8 y/ X) c( z9 G        if A_i=A_leave then send to die
: [. h/ p# z% t! q, n8 n4 V" D        else inc A_i by 1
! `0 j) d% r# k    end
# m  r# w& ?1 \end
* I+ x! I! p7 f/ V' X9 T( O" ?* f2 \5 c5 l9 c
其中的procindex为整形,代表当前process的序号。/ ?& l4 G! E0 P4 R8 Y3 y3 z
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-30 06:32 , Processed in 0.017338 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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