设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11676|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" ~5 c( _: s! `, q+ e" |, [* `! X5 P  t( {3 _8 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中的数值,不知道会不会有什么不妥。
( X7 _" l/ d7 r* w; V8 n; y  y1 q
7 E, w! p) l  Z6 t/ f$ @; y$ J! N3 {, Pbegin P_read arriving+ n9 o5 ^+ J9 [, f" D+ B9 v
    while 1=1 do begin
; S' t1 j8 P2 N7 V2 ~7 W7 B        read A_tote from "data.txt" with delimiter "\n"
  l: R1 z3 g. l8 P+ _' E        read A_time from "data.txt" with delimiter "\n"0 b3 g& |: s3 Y8 [. {
        read A_leave from "data.txt" with delimiter "\n"7 F( |' @. j8 @: [8 x6 C/ B
        read A_picks from "data.txt" with delimiter "\n"6 q& N& ~6 E9 Q( Y# y/ i4 x5 {) }
        set load type to A_tote) F+ k. t( S: g2 e0 Y
        if A_tote="tote 1" then set A_induct to 1# m7 L8 B* n8 D" ?0 d9 |1 Z4 x
        else if A_tote="tote 2" then set A_induct to 2# P& s: [4 _0 G9 j+ ?$ U
            else set A_induct to 3    1 `2 X- _; N% a1 ]$ v5 I/ V
        set A_i to 0) R' }. Q" z( p
        clone 1 load to P_induction* L" j4 w# x' r; A
        wait for A_time sec
% }3 q" ^' I0 _- Q8 ]    end$ [, ^2 t  z  U5 A9 M& o' \# H
end$ |6 r$ C$ q, |/ R3 q& c1 \- \

' @8 c5 ^6 d+ A; a9 K8 a% K* Qbegin P_induction arriving
( M3 _# p, N5 _    if A_induct=1 then clone 1 load to P_pick1! ?5 K, ^; u# L. J. ?
    else if A_induct=2 then clone 1 load to P_pick22 a- u. H6 f' e! t! w. G
        else clone 1 load to P_pick37 b. t6 S0 w  Q1 Q- v* V- k. }
end
1 E! y3 J! |8 P3 S8 j, ~, a
% Y2 ~+ g# y) T0 p+ v2 rbegin P_pick1 arriving% [" d6 L/ ]1 u* A2 |
    set A_i to 10 V6 r" C! n6 u$ U
    move into Q_induct1- n' S8 ^0 y0 c5 E
    move into pickaisle.induct16 E! a% P0 I; ^8 L& e1 X  |
    while A_i<=30 do begin. O, q1 o9 l  W1 I* C- N
        travel to pickaisle.con(A_i)% \) Z" ~" b5 x' W$ u5 x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 x! `9 |8 I7 t3 V7 ]
        else wait for 10 sec
$ T0 t. y$ K% I, r/ [        if A_i=A_leave then send to die
  L, W8 R, S* O0 B& z" X        else inc A_i by 1+ r4 q0 K# H8 u3 l7 V0 }. u# s
    end: w7 n% o' t9 b6 B3 @6 ]% _) C
end3 ^& {) q3 a; E* x
5 R% V# \3 f# J' ]) w
begin P_pick2 arriving' B' |9 F, }' e7 ^7 k
    set A_i to 11
1 A' W, u5 v6 c; ]" E* B    move into Q_induct22 Y9 L7 c% B! y
    move into pickaisle.induct2" a2 i0 L  _% L% U; T
    while A_i<=30 do begin- k9 n" C4 C8 I0 g" Z
        travel to pickaisle.con(A_i)
* }1 f5 w+ ?: `& L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 w" z% z) \/ @* _
        else wait for 10 sec
* W  k6 N3 [0 w$ {8 R; n        if A_i=A_leave then send to die
- k, }4 o5 j" a+ J* a5 Y+ @        else inc A_i by 1
/ h  ^4 T) o, X8 ?- e3 H    end  e: s/ ]( t; i
end1 h$ z+ v2 [, @, @6 Y4 I

+ D& c4 Z# g) bbegin P_pick3 arriving
6 u% b  J( H* o4 l9 G    set A_i to 21
6 u' Y: S& X2 s& S8 C    move into Q_induct33 u  D8 d# k. D# ?5 z% J! ?4 t, n
    move into pickaisle.induct3. ~) u6 n( [+ f7 Z
    while A_i<=30 do begin, Z+ \0 [% B6 v2 P
        travel to pickaisle.con(A_i). o3 r" d# Q' p# _5 e  S5 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ k4 \* O% }1 ^1 j# O2 D  z
        else wait for 10 sec
0 D, X" a8 Z1 d. W) k        if A_i=A_leave then send to die4 k1 Y1 z/ \  f- ^8 a; B
        else inc A_i by 1
) p7 t9 y1 Z' F, A' F  ~    end: ?  |) x3 c; q. ?4 w+ H+ x
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是个什么东东?
5 {8 I5 r& x8 u, J' r, ?move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 e( c: ^: c/ y0 B, l; l% X0 K4 ?  [4 L+ ?7 I/ t# k/ R' l( O; e
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; ^4 \% x! r% v9 ]5 S; N
0 f. }" {; k2 |6 ^8 V% l; |另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* y/ r) r& Q  ~: H% S) D9 q, a1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& _5 [3 H9 Z1 L& I1 U; D2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;* Z  _6 N0 d  m$ ?
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 V% g+ i% ~: Z5 O$ o/ Xbegin P_induction arriving
5 T" h5 }8 \% C4 f    clone 1 load to P_pick(A_induct)
; s2 a" l1 y( Uend最大的系+ |# a7 b; q  A- G+ B7 L0 L/ H

7 q1 z+ F- T! O0 P. nbegin P_pick arriving
2 h8 H5 a; B' @7 E" o7 V    set A_i to procindex * 10 + 1
) q- Q1 |- e; l0 R! p' z% S    move into Q_induct(procindex)9 C  e# L/ X% X, g1 M
    move into pickaisle.induct(procindex)
3 h* _3 W2 T7 ~* i' Q9 L    /*check the type of pickaisle.induct(i), for your last problem.*/
0 N. P; D, d9 c: U* q: P5 G; t8 u: h
    while A_i<=30 do begin
* H9 C' }# L7 e7 k        travel to pickaisle.con(A_i)
/ J1 C- \5 e/ I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 Q6 I8 ?9 a- i5 a/ X+ c
        else wait for 10 sec
/ D6 l5 K4 O/ m5 Z7 n, s/ Q        if A_i=A_leave then send to die
! J7 N  m( K0 T5 \& g$ _        else inc A_i by 1) p2 A$ |* f- W( `" {7 Q
    end8 s/ U2 _0 Q0 X, v4 ?
end) G( a/ o$ K( X. Y

9 V, C3 g* H! e" R& ^其中的procindex为整形,代表当前process的序号。
3 ~0 G% @# q6 q3 Jstation和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, 2025-11-26 23:44 , Processed in 0.021897 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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