设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15564|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) N; E/ _1 b( Q! ^9 N, K
* C4 s$ l/ a) {8 {2 O% U# k
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 I0 j5 s. ?) r; ]! Y; c, l* S" g& X  ]( F
begin P_read arriving
' H0 h6 j1 c! o0 |/ w7 X    while 1=1 do begin$ w# p% M, c# d; m' i
        read A_tote from "data.txt" with delimiter "\n", ^) V4 r& ]: P  ^+ t5 ?
        read A_time from "data.txt" with delimiter "\n"- H2 D, w1 }  {! K( f9 M; S
        read A_leave from "data.txt" with delimiter "\n"
! X+ s* \/ m  q: N' k7 U- `        read A_picks from "data.txt" with delimiter "\n"& Z6 b! a4 a+ ]- Y& h, V0 b) d
        set load type to A_tote
& T9 m' r* I# I* @        if A_tote="tote 1" then set A_induct to 1$ U( Y7 l- [  u# P
        else if A_tote="tote 2" then set A_induct to 2( j; n$ w" R  C$ A2 N5 _
            else set A_induct to 3    0 e/ @( K+ s5 A! r+ s: Q
        set A_i to 0
) \) X. y8 x% B- Y1 L        clone 1 load to P_induction
- m3 N, G% W8 A- T* e- {        wait for A_time sec( X' H" R1 W' o& r3 w6 }
    end7 _& }4 c, I/ C/ k% Y
end. u1 W+ u; P2 u# I$ m/ H

! E( ~7 @. ]6 m+ k9 K1 l6 Tbegin P_induction arriving
# Y4 _. ~* G8 T) q0 V( b    if A_induct=1 then clone 1 load to P_pick19 g* Y) C; s% s& e7 `' q
    else if A_induct=2 then clone 1 load to P_pick25 F+ \2 h  _1 U* ]
        else clone 1 load to P_pick3
6 |) K  S/ _7 D5 ]end6 ?4 I& D) J# U! f* i- Q

" w' O* ^; `. H* U7 }- ^begin P_pick1 arriving% G! w" I  ^8 X! `/ {
    set A_i to 13 M) [+ Q6 b, X+ z
    move into Q_induct1
3 ]& r! t8 l& n; T2 Z/ g) R    move into pickaisle.induct10 f: o8 I3 [) Y% A- w8 I
    while A_i<=30 do begin1 V3 [/ I; ^2 G
        travel to pickaisle.con(A_i)
/ e3 ]  }( P  s/ M* J5 Z0 _- k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  ~; D3 w+ L3 d& B        else wait for 10 sec6 r7 ^3 G$ [8 f6 Y8 b# x; m
        if A_i=A_leave then send to die
/ n- g6 ~7 h+ W( K; c1 y, \3 a        else inc A_i by 1
3 S& [0 B: E6 ]% Y; H* }7 |    end
: `" l7 A! {; a: ]7 a( rend
: ?& k: p+ ^9 y. P" E) N, ]" N1 z' j8 c& p9 V" f" |  L7 s
begin P_pick2 arriving
3 B0 p( D) n( m/ n) M( ^6 j0 y    set A_i to 11
1 h% r* X- l* E( y6 Y    move into Q_induct2# G0 w2 Z# ]" X, c
    move into pickaisle.induct2
4 a5 k: p  v0 i* H4 Y/ W+ L) J4 H& ^    while A_i<=30 do begin' l4 x+ V' z# ]' t8 d
        travel to pickaisle.con(A_i)
! R3 u& r, T4 A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ Q9 l' {. L! T, _8 t( L        else wait for 10 sec
1 F, F$ X9 J/ f5 a) D        if A_i=A_leave then send to die+ _$ x6 A! C  h7 Z* e( q, C
        else inc A_i by 10 u3 M% {5 z/ A% l& s; U
    end; }+ h' o. e. u6 ~3 e
end3 T( I- _" N2 }6 w
  A& s& D: M% L. v
begin P_pick3 arriving
. f( X/ g. v- k    set A_i to 21
5 ~/ Z9 S" S# t% C) r    move into Q_induct39 j) D- `3 }6 j& ~
    move into pickaisle.induct3
+ q: c2 }8 d0 Z& @+ d    while A_i<=30 do begin
9 T% T: A+ J; N9 S8 B. W6 T        travel to pickaisle.con(A_i)* t1 k) r: A7 x* x; C* D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' l: {$ i+ `; E1 R7 i/ T        else wait for 10 sec
2 T( F/ ]& I  p! U4 h  ~        if A_i=A_leave then send to die
3 f8 [4 x6 z! ~3 y6 x# v- p: T        else inc A_i by 1
% }! R) l; d* ?7 s5 D    end  M/ p( C- s; @  }5 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是个什么东东?
- L9 O; Y4 A7 \# T3 u  vmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  z( K* H' E, B

5 Q( t: l  _' H# e3 H7 kAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 X; r6 I2 ~7 s+ a0 m$ Z- [. @5 o$ y
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 @+ Z! [' S5 v1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 [: q4 L4 u7 {; W- w2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ W# e: r9 r2 H9 ~
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 b7 \% u' X4 k; c4 @
begin P_induction arriving
' b7 t" H6 n) y6 I5 i    clone 1 load to P_pick(A_induct)
0 S4 W2 R2 ]  Eend最大的系; ~! W/ p  d# X4 {+ H" b+ \2 S9 x
0 F0 }9 g  Q6 y' ~- B( U6 r
begin P_pick arriving6 S& ]$ c9 o+ M5 K( W
    set A_i to procindex * 10 + 1! M1 @+ p/ S# I0 n2 m, F
    move into Q_induct(procindex), J0 _& ^3 z1 r3 E- Z5 D- [+ v
    move into pickaisle.induct(procindex)
2 k! e# X* l. a/ L1 z- T; M    /*check the type of pickaisle.induct(i), for your last problem.*/3 i& f) b3 h6 x/ U% U

9 m) n7 `/ X  W# B4 A+ m& `    while A_i<=30 do begin; [2 W+ }7 w$ h- ?% C& W. [% H5 ~
        travel to pickaisle.con(A_i)
+ Q  l) D" q8 Q- g; ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, ^/ o$ {7 R& \8 m/ q
        else wait for 10 sec
8 t' g9 U' s1 @8 A+ o        if A_i=A_leave then send to die/ w' h- P( A% B  T5 H$ `
        else inc A_i by 1
" V$ g3 W8 Y9 W- Y% d% D    end
% ~1 c  @( M9 I7 N) wend6 Y- n/ u% _: @0 J5 `

8 B/ L. A2 a/ `  X6 ^% [  e其中的procindex为整形,代表当前process的序号。
  p3 d' X+ n! Hstation和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-9-20 11:00 , Processed in 0.017763 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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