设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13318|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- n& T1 B, K7 L0 @8 L
6 L  N* G) }# {) O; D8 J- w- b
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 t6 J" `; P# Y7 s6 o7 X) h
$ D; r% @& Q2 p, G. G& x% ~+ mbegin P_read arriving
  s! y! ?" E6 Z+ [% ]    while 1=1 do begin, _* z. H: a3 E$ J) K+ Y! x
        read A_tote from "data.txt" with delimiter "\n"
& R& J6 T4 |( t+ P6 }        read A_time from "data.txt" with delimiter "\n"3 R4 K0 m8 l1 d8 ~- S0 `) ^6 [7 m( @
        read A_leave from "data.txt" with delimiter "\n"
# K1 b0 Z% w4 T7 [8 L; }  y7 }. e6 U- t        read A_picks from "data.txt" with delimiter "\n"
5 _# j$ d! x3 G1 z: B/ O9 P        set load type to A_tote8 [6 N7 x# b2 J  J8 P* i( i
        if A_tote="tote 1" then set A_induct to 1
' j! M1 B# z- k$ t# ~4 W        else if A_tote="tote 2" then set A_induct to 2* F8 Z0 a0 K# Q
            else set A_induct to 3    ) m' ]- [$ V1 U# H* k( `# c
        set A_i to 0
6 o% J+ m$ p$ v& S/ x) j! Y        clone 1 load to P_induction
# K, b  {8 ]7 F        wait for A_time sec
9 N9 J- l2 j& a! n( [( f    end
! q" U/ C% i5 Y9 C/ Fend3 V0 F* ~4 C! m
8 K' j, X8 \1 d. f5 M4 Q! G" V2 |
begin P_induction arriving+ ?* g' t( ?6 |6 C
    if A_induct=1 then clone 1 load to P_pick19 v0 ^; w9 i8 D
    else if A_induct=2 then clone 1 load to P_pick2
4 y" @) k. ]0 D  Q        else clone 1 load to P_pick3' g. b  B. S3 |+ Y9 c  z
end5 z& a  _8 {3 O
0 ~9 ]% L/ x$ V/ G+ j+ l" u  h6 j
begin P_pick1 arriving2 `, n# a( P0 |2 J, `6 s  R
    set A_i to 1
, _: ~2 w+ ]! q  E    move into Q_induct1" X. i. V" Q8 b+ V
    move into pickaisle.induct1; j$ k4 A1 w& M7 I* P5 s
    while A_i<=30 do begin9 q  I0 ?( c" A
        travel to pickaisle.con(A_i)
6 A2 ]4 y# d  z- ^1 }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: F4 c" n% c# e3 V2 Q- ^
        else wait for 10 sec
; r& G8 `- c$ {6 ~        if A_i=A_leave then send to die; O8 a0 @2 [5 I& T
        else inc A_i by 1
6 G& e$ m* k9 Z2 X5 ]    end& h% |3 ?9 ]6 H9 q/ N
end
7 X1 \% r1 O; E* m+ t/ x5 C
* A. z: S' @# M3 ]/ rbegin P_pick2 arriving
8 K( ?* b2 w, a6 J9 D7 o    set A_i to 11
* T* c% L0 d: a' w6 ?    move into Q_induct2+ K2 L+ J6 \/ s- @, {
    move into pickaisle.induct2
' \/ [; h! a4 h9 C6 j    while A_i<=30 do begin
6 R  G9 V7 g5 s! \# ~        travel to pickaisle.con(A_i)2 E/ n, Q1 \4 u) r8 v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 [/ x* q; b$ t9 Z/ P
        else wait for 10 sec
5 K( b- H" h; b3 s" H3 J. @: ~/ d+ D        if A_i=A_leave then send to die
/ ?9 V6 U; Q3 O        else inc A_i by 13 m( M5 E2 W; F- M
    end+ P7 x% E: @2 t& [7 k$ ?% s
end
2 }: b) X' A4 N3 @+ c& r# n1 `- n2 c3 U* k
begin P_pick3 arriving& X2 l- a* Z7 [) b+ t# t
    set A_i to 21( u0 R0 g( N! [0 ~
    move into Q_induct3% F0 ]! u# b4 Z% u5 D! k% E/ P
    move into pickaisle.induct3
3 L' X4 G/ ?! e1 a! V1 s% R6 V' w    while A_i<=30 do begin
, g7 }' W6 [  F) w* E8 z- ~! e        travel to pickaisle.con(A_i)) b( N% i9 k  Y9 P' h: R$ w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  r1 D2 b8 x1 S0 F
        else wait for 10 sec( o) G, A) P% }) c: [; H5 Z
        if A_i=A_leave then send to die
" ^* _2 j8 H4 N        else inc A_i by 16 P) k& d  x% p
    end
) H) w- e( A3 kend

最佳答案

查看完整内容

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是个什么东东?
  }; ~3 p  k+ ]( Pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  ~* `& z" |: P. r

+ ]- i8 k" R7 e5 J8 NAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* G$ ?, h8 F9 U5 @$ W  P2 k' u) a) s: s: o, Y
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' y& l( S! Q" j3 `
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
, K- R% n( E( `3 H" [# h! c% P2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 B  K6 L; }$ T3 X8 Y3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; N$ Q& ~7 P/ V! x% j7 tbegin P_induction arriving3 |/ T- Q. X  `3 T4 W' s5 D8 E
    clone 1 load to P_pick(A_induct)& J; ]* Q: W2 R0 N7 U/ H" p9 E; k
end最大的系% w0 s0 I( I; V/ \6 P" ]

+ M' S- e  U8 c9 C4 Z( d: b9 kbegin P_pick arriving) i3 }# Z/ W& y
    set A_i to procindex * 10 + 1' `4 d( C' z1 C+ ?
    move into Q_induct(procindex)
. {# E' X  f% w4 t  i; [3 y) f    move into pickaisle.induct(procindex)
6 M( |: d( F1 d9 I$ G    /*check the type of pickaisle.induct(i), for your last problem.*/
$ k/ F  ]+ i' F5 d% R/ W2 x6 [( E" r8 y3 N5 T7 F, ]
    while A_i<=30 do begin: N  c% Q) C5 }/ [- m
        travel to pickaisle.con(A_i)) x$ Z, {* S6 k; L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, x" @+ p1 f/ d! _3 h& g$ l/ h) \
        else wait for 10 sec0 S( c; K5 v9 B3 s$ r
        if A_i=A_leave then send to die
2 C/ ~, }) n, u  H' L0 F0 {5 u        else inc A_i by 1
' S5 m" A$ Y2 J% j8 B    end0 I. A- M3 B+ `. L$ U7 ?" M: {
end
: N% Q2 Z7 M3 k- Y* ]( V  g4 l' E3 N5 i/ j) U  e
其中的procindex为整形,代表当前process的序号。
+ _8 |9 X. z+ @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-4-3 20:07 , Processed in 0.019866 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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