设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13401|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ Z8 f2 K: d4 g  j

0 \: Q, m6 R1 J2 ]5 M我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ [" F  w0 v4 |0 d
+ D* `% ]! T# Lbegin P_read arriving0 v) I7 D4 R4 |3 [$ r  Z
    while 1=1 do begin
$ |8 D) W3 j) _        read A_tote from "data.txt" with delimiter "\n"
6 k" P: ^4 n7 a+ o( W% \. m        read A_time from "data.txt" with delimiter "\n"
5 O( V/ P! T# z. Z( c, v  y: G; a9 @/ A        read A_leave from "data.txt" with delimiter "\n"% @  Y( ~* b5 o/ L
        read A_picks from "data.txt" with delimiter "\n") I# \) t- D: a" a9 `
        set load type to A_tote& i$ M1 Q! E8 l0 ^/ _+ r
        if A_tote="tote 1" then set A_induct to 1; j8 V' u) N7 X. G" \6 D; K4 t
        else if A_tote="tote 2" then set A_induct to 29 i: a6 B$ j- m8 l
            else set A_induct to 3    0 ^6 y9 e1 w( S0 |5 {* e1 ^
        set A_i to 0
! L$ C2 y1 [1 W* t9 t        clone 1 load to P_induction8 k; ^3 d2 N$ ^. ]0 n
        wait for A_time sec
! y8 S$ k; q1 ^6 ?' q9 o" C( w% R' Q5 M    end
/ j" l7 b6 N5 S7 r2 Jend6 P' y+ S$ {+ `5 ]; q! \  S
7 t" l3 ^# K- q/ X! G1 ]
begin P_induction arriving
2 p- I' V9 O" c& z3 _8 K    if A_induct=1 then clone 1 load to P_pick1
& R' @3 [2 n6 V    else if A_induct=2 then clone 1 load to P_pick2$ s7 S# b; b6 p* S, o* x! f
        else clone 1 load to P_pick3% X% Y' J* P: J
end5 b3 ^0 q& r+ [4 S' Z2 K. M" i
( l2 f1 w' ?7 i
begin P_pick1 arriving2 H% `$ L$ E+ j+ O5 i% @
    set A_i to 16 ?# _6 C; ]9 p2 \* S6 T
    move into Q_induct1
1 I% \2 |. G  H; t9 d( H! p    move into pickaisle.induct1" Y5 G' w! @) M3 u8 |& g) F
    while A_i<=30 do begin2 H( H' \- B6 @, {  F8 C: d) s
        travel to pickaisle.con(A_i)
: [5 b. e2 ^: L! N) `7 ^% ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 c6 ^# e. ^% U+ T
        else wait for 10 sec
1 I+ U& [- F) A% w! E        if A_i=A_leave then send to die
. s. j8 O% l/ x" K* X* W5 m        else inc A_i by 1
. x: T3 v3 i7 X0 V" A' U. |/ t    end4 H8 ^* ^( Q+ v% w
end
' r3 ?  `; u5 \7 I% i2 e
& m2 J1 \% G8 Rbegin P_pick2 arriving
% z9 v4 J2 @( t& {+ E7 G    set A_i to 11
$ u( P! s0 h1 D" g    move into Q_induct2+ [0 q5 k# B1 a8 r1 }+ m! a
    move into pickaisle.induct26 d" p6 c6 o. A7 t8 c+ w0 b
    while A_i<=30 do begin7 ~+ i: c0 O" F  T& n
        travel to pickaisle.con(A_i)
# S% L: x0 R7 k" e4 q1 r. P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 y4 R. V9 b8 U" d" f* n: s& h
        else wait for 10 sec+ E" N, Y. B' b( U* o2 s
        if A_i=A_leave then send to die6 ]7 K8 D8 J8 {
        else inc A_i by 1
! y: F# \/ L$ E8 X7 l2 N6 |' F    end
/ t9 x1 o2 A4 C6 Q7 f& i6 c5 Rend" N$ j8 s% Q/ M
0 j( v% \( |8 y. U" {- P9 G* e1 ^
begin P_pick3 arriving
2 S8 i( E, X$ N/ C  F! Z9 Y    set A_i to 21+ C; ^& |1 Z# y6 D( z
    move into Q_induct3- j  n) Y; \1 j4 M
    move into pickaisle.induct3
* A; Q' N7 z3 x    while A_i<=30 do begin" `( K( G. N. E8 ^; t
        travel to pickaisle.con(A_i)
  O3 ]6 M- m- _4 S2 b6 x$ W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& |8 D! B; v' V5 v! Y        else wait for 10 sec
& i( f7 V0 i% V7 N        if A_i=A_leave then send to die) M) f5 h$ r7 [/ t+ Q
        else inc A_i by 1
& ?+ {  ~7 a, \9 }$ f  b    end
9 b; ?! G" R8 f3 \) w5 k% Dend

最佳答案

查看完整内容

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是个什么东东?# }' V9 E# B2 J8 _4 F: S
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  D' Y- {2 P, e7 O9 g5 i

: @0 e9 q  o* C1 a. ?3 wAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: _3 W. M8 o* @. i; t  m. D
  e2 l; `& j( _. k0 o7 a
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  W5 C  L8 I* m0 w0 G5 f* [1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 G& C# X7 j7 C+ }% i! W
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 g- ], p* [" j2 E: a) j
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 ?) i6 Z0 {( E4 xbegin P_induction arriving9 V; D. q2 K( C4 d
    clone 1 load to P_pick(A_induct)
0 h2 f. s# T; k  lend最大的系
& W+ E- F( S1 X9 `' J( B" R( x7 J# w# N' h/ m) v
begin P_pick arriving/ B4 H7 K# t) {* h0 H$ @: Z
    set A_i to procindex * 10 + 1* D2 c/ j7 Z+ i/ O# }7 y
    move into Q_induct(procindex)
. s3 T  P% S# ?6 v/ [    move into pickaisle.induct(procindex)+ k/ S" @/ n( u% u' z; \
    /*check the type of pickaisle.induct(i), for your last problem.*/
4 a- n( p8 T/ d" t1 T! |8 a2 M% A, B
    while A_i<=30 do begin
/ T/ S; {# y  C, A5 e) T6 `# ~        travel to pickaisle.con(A_i)
8 V$ h" \: N0 j0 A/ p* r. N9 ~7 w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 R1 X8 j7 f' ?+ {5 x! f3 g        else wait for 10 sec
2 d/ H$ _7 T9 C8 Z' k        if A_i=A_leave then send to die
, ^1 |" L9 m/ L$ z2 F        else inc A_i by 15 n2 T0 m1 U: k1 v( e- c
    end
3 x! y) D) y- g7 E' K5 G; Fend" v' u( B% e* g0 {2 g" I. G

; \5 ]% O: k  N9 {; z; A9 ~其中的procindex为整形,代表当前process的序号。
7 d. A0 H) b- D9 Hstation和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-10 10:30 , Processed in 0.017587 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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