设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12360|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" g1 x' D# j9 T! J: H1 J- |% L4 X

$ N+ T. l) k/ E, V! U+ n: @我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 C5 A  j2 X7 I9 g
( p8 S. Z9 J& x2 M' `+ D7 i, v
begin P_read arriving
' L$ h& ]8 b% ?  ?6 j5 t( q    while 1=1 do begin6 `" v; q% t% Q3 ]
        read A_tote from "data.txt" with delimiter "\n"
5 F" r8 M( W4 `0 j% V( O        read A_time from "data.txt" with delimiter "\n"6 f/ b& W. |# Q' [6 h) `
        read A_leave from "data.txt" with delimiter "\n"
* {& `& o3 g0 K        read A_picks from "data.txt" with delimiter "\n"$ }3 I' s, @- Z) K0 w
        set load type to A_tote0 P" |2 E! t0 Q. t7 B2 b
        if A_tote="tote 1" then set A_induct to 1. B1 N/ V" E% C0 l8 _
        else if A_tote="tote 2" then set A_induct to 23 l( N; i. _. A+ {+ \9 U
            else set A_induct to 3    ! e4 |1 v6 r. ^! d
        set A_i to 0
6 Z; o5 f* u' G! G3 s        clone 1 load to P_induction
& t2 u$ n) Z' S% k+ b        wait for A_time sec1 S7 G9 }/ X) ^) V3 E! I
    end0 S9 ], n, v* \! k9 G" b
end
# ~( L. a  H: B2 R' D/ M5 I5 U: I5 Q8 j7 U  z. a# L$ V
begin P_induction arriving
! z/ F- W. M: D* T4 K2 K% F    if A_induct=1 then clone 1 load to P_pick1
) M! L; y5 R7 ~    else if A_induct=2 then clone 1 load to P_pick25 x7 R2 K% m9 ~" r% U+ ~+ b
        else clone 1 load to P_pick3& ~' q1 O7 e  M8 {: n0 D- Z
end
' j( h0 \8 H) j' k& C
6 _' s- g8 L# c" D; F( b4 s; pbegin P_pick1 arriving: @; z, D, y: m, d7 a# P- Y
    set A_i to 1
2 d2 ]5 p' I, c5 V    move into Q_induct1
" e+ l7 n/ H& R) q    move into pickaisle.induct18 h& |0 @) ]% _: l8 p
    while A_i<=30 do begin
1 R9 v6 d! O) d- N5 O, a' R        travel to pickaisle.con(A_i)  O( O& Z5 U2 R$ |% h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 s$ y$ ]6 h! z5 t  o) r) `8 W' Z
        else wait for 10 sec
+ ?& k9 L' D' [3 P4 I# g% r        if A_i=A_leave then send to die
! X! K( n( w' T) t% {& v! ?        else inc A_i by 1
: f( z4 Y: F7 Y6 _6 {, D    end
1 G8 r( o  V9 bend7 ~* }, V$ ]1 M. V" n5 J/ x
* O$ u) Q" \$ s, ~
begin P_pick2 arriving/ m2 p0 j/ ^/ C) u6 H0 f" u
    set A_i to 11% @0 ~9 T, ~9 S# i
    move into Q_induct2
" M; Q. z: f: |" c4 N) B, N& \9 b    move into pickaisle.induct2+ ^- G. _2 D) O7 D' k
    while A_i<=30 do begin% c# C- b/ ?8 c$ n
        travel to pickaisle.con(A_i)
( k' `* y5 W  P  ^: u7 {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" [/ w7 i# W1 c# ?1 O- v# W! R
        else wait for 10 sec
* |& P! f1 g8 p: y0 N+ x        if A_i=A_leave then send to die9 \; F  [# I/ d4 y
        else inc A_i by 1
+ j9 g5 W' V2 T5 l    end
! n9 L' K% K) gend
8 ?: H1 z" o$ \+ n7 J+ D  @; t9 X5 t. M8 k5 e1 M: N$ \
begin P_pick3 arriving' y7 \; v. H- \8 `
    set A_i to 21( H: p! k$ L2 @9 d& F) ]( s, k9 s4 M
    move into Q_induct3
8 C+ o3 C4 n" b" i( b4 R  u) Q, D    move into pickaisle.induct3
# d' f9 v# T1 K; U    while A_i<=30 do begin
. H3 @+ A8 L1 C- q, U9 P+ i- w        travel to pickaisle.con(A_i)
( s* N! t9 `  i4 J1 Q- q0 m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; y3 l: f3 W3 J0 @) l+ F
        else wait for 10 sec
5 N( L0 `" F) I2 p. t! D) X' s        if A_i=A_leave then send to die
  A/ y2 ?& ^9 q9 J4 q* W2 ]        else inc A_i by 15 {  l1 W1 a( W7 n$ w  _+ y) N) \! E
    end  B8 f' w( P( U$ b) [, r' d" p
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是个什么东东?4 Y4 x9 _( A! s' y/ \  Y4 r2 I
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 @: d2 m. L3 \, L! Q

( d( l6 ~0 u' x. k* P3 k( K0 _/ YAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 _* h: x8 j# `( c: g% X" h$ i8 p$ _! P
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- R  S/ b  C; |, ?  F7 a1 u1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 A. Y, E# Q; C/ R5 |2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) ^2 v, S8 Y0 h$ u! L
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 e% e2 g( }0 K& I( U* w2 u
begin P_induction arriving
' h" A& H/ l1 N4 e3 b) f) d* T    clone 1 load to P_pick(A_induct)
7 D' V' E$ a0 I9 a) i* Dend最大的系
7 A1 N* s9 |1 P3 Z
& J! M0 }5 A  B. l, v/ ubegin P_pick arriving
- A2 _/ ^6 W' T( @+ F. l7 f    set A_i to procindex * 10 + 1& `/ S. \# G5 y% g6 K  l
    move into Q_induct(procindex)* `/ n( W8 P& \9 G0 y
    move into pickaisle.induct(procindex)
7 _! z. y' I0 X. h& n    /*check the type of pickaisle.induct(i), for your last problem.*/6 O$ K  c" S* j5 [

" J0 e# x2 O% P    while A_i<=30 do begin
( \3 k  ], Z! [9 P) v9 S& q8 r        travel to pickaisle.con(A_i)  ~( ?. c2 j* }) m- d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- U# O( T5 I$ `2 F/ R$ v8 ?
        else wait for 10 sec
( F& G! B7 b7 {+ z1 j4 V        if A_i=A_leave then send to die3 s4 Z6 j! j/ F3 W5 D
        else inc A_i by 1
$ n- D& S  _: r7 c* D7 E6 b    end
' ]# _4 w2 s: ?$ I% ^$ t7 s8 zend* R) @  U- a3 u8 R
( w5 y+ B2 _3 W4 q9 Y
其中的procindex为整形,代表当前process的序号。
. C$ H2 B0 p) ^5 Nstation和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-1-18 03:42 , Processed in 0.022261 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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