设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15142|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 g4 r& e5 r5 a3 H) z" |* A  n: b; ^- t* X$ V& ~7 o
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: z3 c. w: z* {+ _( w9 ]/ t# k& A4 v( P
begin P_read arriving
) V' ~; ?1 r' ?    while 1=1 do begin2 S3 {7 u# b( @! ^5 ^  t* {
        read A_tote from "data.txt" with delimiter "\n"
; j# s( G' f# B$ _        read A_time from "data.txt" with delimiter "\n"3 c- a( v2 N1 K
        read A_leave from "data.txt" with delimiter "\n") Z# l1 @+ ]  |, N2 f, `
        read A_picks from "data.txt" with delimiter "\n": _+ R: X& P, b' A' a2 t3 ^
        set load type to A_tote  }& {1 w" y0 L" p. p- d
        if A_tote="tote 1" then set A_induct to 1! L, C% J0 }2 @4 z
        else if A_tote="tote 2" then set A_induct to 28 a# L- d! I& |" I  V3 Z
            else set A_induct to 3    ; b; G1 e, C. p5 c- x  k
        set A_i to 0" y6 [' z1 V( Z6 j
        clone 1 load to P_induction! P' h8 |0 V! Q- o7 ]5 O* ~
        wait for A_time sec
, @) J( ]/ i  M2 |( n    end
1 z2 }& |" f  G) z3 c, u+ {9 \3 _; kend
5 |9 a" A1 }7 K1 @6 l  u  g* G+ _2 D, o" J2 m  T+ L9 w
begin P_induction arriving
$ \. v. e& H2 v' L. F    if A_induct=1 then clone 1 load to P_pick1& n$ f3 {8 b. }. ?  V# R& d
    else if A_induct=2 then clone 1 load to P_pick2
4 v& K7 _8 Y4 ~- O$ a        else clone 1 load to P_pick3
/ }2 C5 c$ R+ o+ ]3 |; r- Xend
- w) H2 G6 L& Z) \
& ^8 s- E# H9 F( [; ^begin P_pick1 arriving  I1 T9 f8 k6 q# e& S7 w9 |
    set A_i to 1; l: R/ A8 ~$ I# n4 F- D
    move into Q_induct14 n" W3 k5 C9 k
    move into pickaisle.induct1  ~  b) ]8 Y% W. j* W2 ^2 p9 y( C5 V# h
    while A_i<=30 do begin
5 R8 ~; f0 e) e" `        travel to pickaisle.con(A_i)
  ~* B" Q- T* m- g3 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: H1 x+ C3 m+ {+ S9 K. Z' ^. Q        else wait for 10 sec
  t6 _* M4 e$ x3 Y1 m! ]        if A_i=A_leave then send to die% ]1 l% }3 E$ ]8 d% @2 x6 u' T
        else inc A_i by 1
' V% A' \3 ?& ~4 r( x    end
; O5 ]9 _2 N0 p: gend
: x+ y) i0 G0 s# N
% q9 N0 _/ o8 e/ A  l$ S0 Abegin P_pick2 arriving1 @0 u% T9 d& y; n/ I
    set A_i to 11* ^: n2 u: u& ~5 F2 U* N$ {
    move into Q_induct2
! L. C# l' ^1 P- @% G6 P" U! r    move into pickaisle.induct2
: Z$ {7 [# u" g( N2 ]  G) l/ q    while A_i<=30 do begin* \) M# o& B* {
        travel to pickaisle.con(A_i)( r2 q7 ~) b' S9 V+ y: O! K$ W, D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ e% w6 r9 V& e. ?( e, P        else wait for 10 sec
6 q! D  c  {6 R/ P3 f& f        if A_i=A_leave then send to die2 z5 K9 a( Z+ W! _
        else inc A_i by 15 n. y5 w) {& Q+ q" V$ V
    end
, y" a$ x# W4 Q) _. Tend) @7 Z7 k4 W2 F* c$ W9 t8 u/ b/ R
1 E$ \( ?/ s# `9 |0 L& R! G
begin P_pick3 arriving
; G8 B/ h! x3 m, x; i* z    set A_i to 21: e$ \, L3 d! f- O
    move into Q_induct3
0 H0 q% `* w$ k1 i! C% l5 T    move into pickaisle.induct3
7 a2 a% Y, d/ O2 x    while A_i<=30 do begin
& B7 D  k7 J& q3 y* I" X        travel to pickaisle.con(A_i)
2 h% u7 B' r, h7 a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& u% b- K( ~) c2 L. A' t* r5 ?
        else wait for 10 sec
) w, ?! _- R1 B% Q# g        if A_i=A_leave then send to die
' g2 u) U7 d$ u9 j$ n3 I        else inc A_i by 1( _' f- x9 C# U9 }
    end
- E+ C: R, w4 ]5 U4 v* o' }* D* \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) G2 t5 O- n9 X0 n' c1 D- v
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 `+ x! I! u  m: w1 ]) R. V

, N% ~8 X; a9 w! x* hAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; F; \* {8 r- W6 W/ R& Y- H
. V9 d( L% @0 H; L  @7 K. h另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 \3 W$ x4 V1 ~8 ^! X% X1 ^
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 i+ z, K# T; K3 B" D! y1 p2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' Q0 v3 d" ]0 Z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" D# Y& Q" N2 P: a. ebegin P_induction arriving
( n  q* I6 I: Y/ l+ l    clone 1 load to P_pick(A_induct)3 f9 C/ F7 V/ [+ h6 W7 C' L4 q
end最大的系
* w- a" i8 r  D8 d( B* O- z  Y! W4 ]6 D( C2 [8 U8 S0 x7 N8 w
begin P_pick arriving
" w$ p- `' f# _8 P4 ]    set A_i to procindex * 10 + 1
% Y" e4 _6 W! h  T, B* u* Y    move into Q_induct(procindex)
2 k$ {- o4 O* S    move into pickaisle.induct(procindex)4 f& Z" c' G8 \6 I" M
    /*check the type of pickaisle.induct(i), for your last problem.*/# P' @/ M2 n+ R+ }% @

6 ?  w( h8 g. q8 A" h: d$ C    while A_i<=30 do begin
/ C5 }, j0 H; s+ x9 {; |        travel to pickaisle.con(A_i): {/ C; U4 p8 h: ?' a; [$ A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( b! {( X2 m  l% y( i' P        else wait for 10 sec2 T+ O" D6 e# n* A
        if A_i=A_leave then send to die
2 ]% S; G3 m, S3 e1 u        else inc A_i by 1
' M2 W, x2 f3 s4 d    end' Q% X/ ?0 t& N
end$ G# j. Y' M! C5 m4 t
6 U/ T4 c( @4 \5 q& u- d* G
其中的procindex为整形,代表当前process的序号。
* G  {+ M8 }; t0 P3 |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-8-14 16:56 , Processed in 0.016566 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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