设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6263|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& ?$ J5 y( d( N$ e" C
' }/ B! s) P. n; i
我的问题是,在每个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# t7 ?+ H$ g# j- e+ P0 G# h; n# z9 J, ^
2 a4 G+ N, n! ?) H& H1 @
begin P_read arriving
6 m4 D' n" c. q7 C/ U    while 1=1 do begin0 R. e7 z% H( A7 E4 ~/ \
        read A_tote from "data.txt" with delimiter "\n"
& d) \+ z/ ]) Y% I6 u* c$ E* w        read A_time from "data.txt" with delimiter "\n"
& e1 c/ [+ {$ T% ?" k1 j        read A_leave from "data.txt" with delimiter "\n"
+ p5 j. Z, J6 w6 i; S) S: A- [        read A_picks from "data.txt" with delimiter "\n"
) V; E3 M+ v$ F8 c        set load type to A_tote7 H! f4 q# u7 U! U4 I: @. Q
        if A_tote="tote 1" then set A_induct to 1
* D  W+ V1 {2 z' r3 X! p        else if A_tote="tote 2" then set A_induct to 2
! q) ~- Y( j8 n) p0 _) H8 Y            else set A_induct to 3    - E) C% ]- Z5 S+ w3 y$ G4 k9 B6 m
        set A_i to 08 n* Z( L* G2 G( j
        clone 1 load to P_induction
" ?% `( J: t3 K- s! ^- `        wait for A_time sec2 w$ I2 F$ [9 e" l! |
    end. [5 C" d0 x! e0 G0 I! S9 l. o
end
) M- D" v. r; J  S$ J, o+ k  }; e& |) f8 H
begin P_induction arriving, K8 ]& P2 i. f$ S9 E
    if A_induct=1 then clone 1 load to P_pick1
  A/ u9 \& x. c/ B$ S9 r: y" H( W    else if A_induct=2 then clone 1 load to P_pick2  o3 v# K0 v/ Q8 _, |& [/ o
        else clone 1 load to P_pick3) E" G) {+ `1 S/ D1 d6 @
end
, V4 s( G/ U. g* e& J% l3 o. {; U' f& Q- M4 D% J
begin P_pick1 arriving
5 R, t& N( p" `* G9 h7 T) P    set A_i to 12 U* N$ l9 f. N! p4 t1 S1 h& M3 e
    move into Q_induct1; @  s5 n) f# F' M/ h. b1 ~* I
    move into pickaisle.induct12 F% t* g% C# @* Y* z! j4 ~: y: b
    while A_i<=30 do begin4 D7 V. i: }0 \/ _, \9 c
        travel to pickaisle.con(A_i)5 {8 r) _* P0 o5 n5 t4 ?# k) {3 G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) k4 @, ~& h5 I7 g4 o( W
        else wait for 10 sec$ r+ \4 q, e  ^- w7 A  g
        if A_i=A_leave then send to die
% l$ f: {5 w; u# Y, E- S- x        else inc A_i by 1
5 [/ @, e5 e' x$ X; |. g    end
, V* O7 l' W, f9 O, mend6 |% P$ n8 K) ^. \+ N4 N- i8 [) T
: Y  e, I5 [9 _8 c! U/ z& b6 L
begin P_pick2 arriving
" p) h! `  }  p    set A_i to 118 `0 s( E* _5 y: l
    move into Q_induct2) d( x. ^0 d2 \+ u2 V
    move into pickaisle.induct2
8 B; ^* R* d7 W! j    while A_i<=30 do begin7 X! U- L* J" g4 `
        travel to pickaisle.con(A_i)/ b  E. h# l5 r3 e6 ^7 w0 {7 ?) Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 Z! {5 l( e7 _- ^
        else wait for 10 sec+ B% z2 S9 G4 b% k: Y
        if A_i=A_leave then send to die( D/ m# Y9 M3 o8 f  I8 n8 P
        else inc A_i by 1
7 T8 I5 N/ |- V8 J6 Q    end
. \$ G. A) j1 @- Q% Hend
3 A6 f* ^: j+ z: A0 j, L" \- _9 ~/ @2 J2 t8 X
begin P_pick3 arriving, M- o; W, n: @* Y" N
    set A_i to 212 u; m& \: z5 b1 A9 `
    move into Q_induct39 N/ M3 |3 b/ \% w6 W
    move into pickaisle.induct3
; E" ^; n+ ^( w( P0 c* |3 Z- V    while A_i<=30 do begin- P- y4 c; q! o1 v7 o2 t" p
        travel to pickaisle.con(A_i)) C. e/ S. i( R7 `) ]* m$ }  R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 y# Z& t7 k7 }# \5 b6 i
        else wait for 10 sec7 |. L3 \" J8 L4 T' Y6 C) ?" ?
        if A_i=A_leave then send to die/ @3 \4 [. \- l
        else inc A_i by 1
, K1 e6 I2 Z* D1 V: M: z    end
: y6 _& S/ o& u1 n) j+ R6 tend

最佳答案

查看完整内容

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是个什么东东?
8 U8 n/ ?. v) _' B9 Xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 R) U$ V5 d. i$ \
: a: X8 A5 r( A# P/ `) g7 R  K
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& v% V8 b0 i6 B8 @0 v

8 p& H& W4 w: H) y# O( R另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 R3 e! f4 R$ o2 o9 ^; i
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( V1 t' J  z5 {
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: R: ^. Z9 h9 S1 b8 L. y3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; E9 m6 ~8 I; j
begin P_induction arriving$ I6 E8 q# }0 l# q1 w) d% y
    clone 1 load to P_pick(A_induct)
/ l- S" g9 b# fend最大的系
4 i+ B* s$ g( ~  R; g
. }8 w' x' j0 ]begin P_pick arriving
, x/ w  v. B3 s6 R- {) N& l    set A_i to procindex * 10 + 1. @$ u( D2 r! E/ m8 C0 ^
    move into Q_induct(procindex). r6 r: y7 C, g
    move into pickaisle.induct(procindex)  j, y2 H  g/ W
    /*check the type of pickaisle.induct(i), for your last problem.*/
, n6 @& }* ]/ j6 V! J" N, L/ y. [% X( F% D; w
    while A_i<=30 do begin
) }  ?9 P& p. v        travel to pickaisle.con(A_i)
. G7 t9 y3 {- _9 \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 t( S: e* }" M: R1 e& d
        else wait for 10 sec1 d( N$ Y& C1 |7 l; b  l
        if A_i=A_leave then send to die
/ f9 _% l: t+ b$ C% X        else inc A_i by 1
2 d& A2 k7 O5 o. x7 C+ R    end# ?$ m5 {9 H/ n) K
end
$ m( }. x  {6 \) N% m5 X; R/ F, F2 O; k4 a( p
其中的procindex为整形,代表当前process的序号。
! ?( P% `  u5 }) n6 Gstation和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, 2024-5-3 23:18 , Processed in 0.012945 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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