设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6262|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- e8 W7 Z( F5 U2 A: s! X8 H- Y4 c3 @9 \' 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中的数值,不知道会不会有什么不妥。5 }3 e0 p8 k$ S% {& w

; K+ ^3 K- Y. J9 G- |% e2 ]begin P_read arriving
# s1 P! h- q! |1 b1 u    while 1=1 do begin
- d) O& u6 M! `$ T$ m" \* R3 u        read A_tote from "data.txt" with delimiter "\n"
2 e( w. d5 D7 B0 e' y8 R0 R        read A_time from "data.txt" with delimiter "\n"
+ I5 k; H. j7 B/ z# D, o# h! v        read A_leave from "data.txt" with delimiter "\n"
! o+ c$ @: ], H        read A_picks from "data.txt" with delimiter "\n"; ?/ Y# N) E8 l8 ?1 g
        set load type to A_tote
  C0 c! n( L  T; g( ~        if A_tote="tote 1" then set A_induct to 1
$ q- l5 f- r+ J( d, t* P2 W$ d        else if A_tote="tote 2" then set A_induct to 2; o3 L& G% l- v9 ^- I! K8 E
            else set A_induct to 3   
; B5 h3 f5 J' r# m0 e        set A_i to 07 \9 B! N. @! ]: V; |
        clone 1 load to P_induction
3 d  m) g% U% R/ i% ~        wait for A_time sec
, C7 `/ _) N; f% ~: d' }    end9 v5 b! a4 W8 t+ R. ?
end
7 B- \4 k; m1 R- D, @8 E$ {
( C: D& q% ]8 w0 E( mbegin P_induction arriving8 v+ C! c* e9 K3 h# Y
    if A_induct=1 then clone 1 load to P_pick1
$ C/ t, v4 J) ~3 F, h5 ^* t' H    else if A_induct=2 then clone 1 load to P_pick2% F7 s  J' e. p+ }
        else clone 1 load to P_pick3) U0 }& W" k  i) Y6 _* C6 G, A9 E
end; ^! e' e2 A, T4 a

. e3 J9 R4 Q  u6 Nbegin P_pick1 arriving5 k7 ~+ n& D& i6 h/ q. o. n
    set A_i to 1
8 k0 e' L% R6 P/ r    move into Q_induct1
0 v2 r0 p) n: J6 a- g( R    move into pickaisle.induct1
1 k+ u+ B; n9 I6 f: w4 u6 _; I    while A_i<=30 do begin
/ p; L; A7 Y! d* F2 s. ~        travel to pickaisle.con(A_i)& D9 |; y9 K+ P" }. o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) }" {6 e5 s5 w4 P$ i        else wait for 10 sec
+ q# {; Y0 d: x1 q5 r8 g, u        if A_i=A_leave then send to die
6 z( A  A" Z9 N4 v        else inc A_i by 1
) ]# ?/ w& p' c    end
/ M1 Z7 T* d- I' P: S+ k) yend
$ W6 g' s9 O, ~+ I/ `! }3 G
2 o) p) K. V/ @  sbegin P_pick2 arriving( y0 @) S8 G6 t  |7 w4 w+ i6 T9 P
    set A_i to 118 p$ O1 h( ?0 G8 ^
    move into Q_induct27 u- S5 ?0 e& C* ?+ d/ O
    move into pickaisle.induct26 @! E) @( y! `$ ~: X
    while A_i<=30 do begin  o. q9 J) P; B! v; w9 E2 p- J
        travel to pickaisle.con(A_i)5 K( W( F5 A3 [# x! J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' p2 J* K' l- S% Y) ~' Q        else wait for 10 sec
. }& Z( g+ e* i        if A_i=A_leave then send to die
2 r) \8 N" J) D( U/ z/ n        else inc A_i by 1
) Y! p& ^* K+ B! [) k- B, k0 c0 ~    end
3 u3 m& ~8 o' |8 e% ?end3 C) M8 A* n3 t" _* j

/ W. w7 l" @6 ~& F" lbegin P_pick3 arriving& A6 g7 Q* L( k7 l1 s
    set A_i to 21
6 a; v4 _1 }2 O. l' K" J" I3 b    move into Q_induct38 g) J, {5 I$ V! z$ O
    move into pickaisle.induct3' H7 S( ~0 R( `0 j& z! _3 x$ V
    while A_i<=30 do begin
% |) {+ M4 v" J# Y8 z        travel to pickaisle.con(A_i)1 x  \; W  ^. Q' ?! H3 Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ y( ^8 G. c$ r4 b4 l        else wait for 10 sec, Z: @! [7 q$ @1 h% L
        if A_i=A_leave then send to die
: c/ ?) r0 T5 }6 [        else inc A_i by 1
& `/ d/ H2 y3 t) @- R# R: F. F  M$ q- V) U    end
* @0 P1 I/ p6 J- Y5 v4 }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是个什么东东?, o/ b$ P0 u' N
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
* E2 w& Q9 v% [' p! I0 y
2 @. b$ e, K! _, O% X5 L) W8 Q; UAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 D. G7 o& m+ o' g2 g* m* N$ G8 j( P( P" s# l
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- W6 q; ^* B$ {4 R
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 n# C. \3 k" z) l2 _2 s5 N- {
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! G8 v5 b+ Y' U' M+ J6 P, l
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 w# u( |2 L7 j* }) Z; t! o/ x
begin P_induction arriving
4 [' h6 k6 _# I" k2 d: |5 T9 V% y    clone 1 load to P_pick(A_induct)
4 B' C- @1 d6 f8 Y. W4 Dend最大的系
8 F, Q8 z" }0 c# b3 I* o; F4 z9 ]& ]$ O6 w
begin P_pick arriving
+ d8 K/ p' k9 s0 r5 X1 h) I    set A_i to procindex * 10 + 1. k- \# s  }" S( |' C! P6 \4 F
    move into Q_induct(procindex)) x1 y& s' p# \% V& e' i: ?7 j9 [
    move into pickaisle.induct(procindex)4 `4 P$ D  m4 k- [
    /*check the type of pickaisle.induct(i), for your last problem.*/
6 u6 m, N1 o& S$ {. L7 J+ [$ G( O$ L+ O) B& `, J1 \5 E8 o( h
    while A_i<=30 do begin
+ J: O6 p. k3 ^' G        travel to pickaisle.con(A_i)
2 R8 ~+ M+ Z4 ?' ]0 Z* t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# ^4 F+ U5 q- V+ E! o        else wait for 10 sec
" f- S1 K. J3 d+ v        if A_i=A_leave then send to die
8 s( _; S' ~$ [        else inc A_i by 1
9 V) p, W! h. w: a) T( L: f    end
9 o8 a" {, v, o: T' [end
( W$ B( o( B( \" @8 X- u, [" ^4 b2 H8 k6 g. e5 y
其中的procindex为整形,代表当前process的序号。
8 t' g6 V! c* M6 ]( Cstation和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:02 , Processed in 0.014209 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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