设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12925|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( W/ f6 I/ A" j. a# A: c' o1 s
- r" D2 D) `0 |6 D. X9 h我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 `7 ^1 ]2 O# ~: l8 _# H' N

/ x6 P: N# R9 M* Ybegin P_read arriving
+ A8 s: l9 E' [  W    while 1=1 do begin6 z& e! ]! w) X+ x1 }+ v
        read A_tote from "data.txt" with delimiter "\n"# Z/ {: P( H7 J! x& s
        read A_time from "data.txt" with delimiter "\n"
8 {' w) H4 m- a! {. j- G        read A_leave from "data.txt" with delimiter "\n"' }* j. r4 _# D! R3 e7 d
        read A_picks from "data.txt" with delimiter "\n". Q0 ?$ {6 N) y, r- f
        set load type to A_tote6 z# Q) C  K( \; L9 ]+ J
        if A_tote="tote 1" then set A_induct to 1( u+ w# {3 `6 }2 X% ]% n9 Y
        else if A_tote="tote 2" then set A_induct to 28 V% P3 w2 ?: ], ^+ h0 }0 r
            else set A_induct to 3    + U+ F& \; ?; B" E4 U
        set A_i to 05 y$ D: c1 O. C0 N: Y9 J9 P, Z
        clone 1 load to P_induction
, T( f) ^' @0 f        wait for A_time sec
( J# C  X* C3 A( r7 D  _    end
1 p: q, F) A, M5 F) l1 @end' A. T, d+ f; d; ]# t

' Z2 W9 U; P+ ]$ G9 x; ibegin P_induction arriving+ x, D* r& g4 o6 C' n# A. b* [( z. l
    if A_induct=1 then clone 1 load to P_pick14 w6 ?! e) _$ y! L
    else if A_induct=2 then clone 1 load to P_pick2
+ H/ K- u  \) N1 x7 A        else clone 1 load to P_pick35 L5 n7 ~9 a/ B- u* P
end+ c1 B" S9 Y0 C; q* @
' U* j3 k7 J5 H0 h6 M; A
begin P_pick1 arriving
% @! [1 X: I5 T/ ~    set A_i to 1+ M6 j" _' v4 [
    move into Q_induct1
2 C( ~# l& J% N* O! w/ d    move into pickaisle.induct1
. C. N3 O% J/ v) [# i  c% e( `    while A_i<=30 do begin
+ v- T# }) q: k' Y7 H0 F        travel to pickaisle.con(A_i)
  }  Y6 ~# M' c, J- N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! y9 }6 h% |9 F: C6 d! v' ^$ ]& D        else wait for 10 sec
4 r8 _4 g7 @! a7 _        if A_i=A_leave then send to die
# \8 W" O2 a3 y3 N        else inc A_i by 1
7 B$ K- f% ^% V4 T! }    end
+ J/ o3 _6 ~, _! q! D3 t4 o8 Cend* z! @( Y# [% N6 g3 N+ g' S/ _5 W
4 w7 \% Y- G& D) r: B. Y/ i$ f, y
begin P_pick2 arriving
0 F2 `# o$ E8 e9 L; f1 t    set A_i to 11# s: G2 X6 }0 t
    move into Q_induct2. W$ i5 A- }$ t3 [% ?1 R, I
    move into pickaisle.induct2
+ R) G2 ~2 }2 T8 m) }' d& f7 u    while A_i<=30 do begin
; u6 W% h- F9 C5 u: z) P. I* B        travel to pickaisle.con(A_i)) G9 W4 ~& I: g) u. I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 L$ r! }: J; a        else wait for 10 sec
* b$ j' I9 v* }. i* t        if A_i=A_leave then send to die% V( G+ a  h1 E  J5 e
        else inc A_i by 1
8 [0 I9 H0 p6 |" z) W0 n$ K    end" s6 }+ Q' A3 W- Z% ?1 N  z, z
end6 }7 r1 {! ]+ Q0 S5 `+ c# w
' Z7 g2 Z1 P2 l; r5 f% [
begin P_pick3 arriving
2 S1 f9 K+ e% _2 t3 B    set A_i to 218 A: ]4 q' s2 k  U8 Z
    move into Q_induct3
- h9 Q* b1 J5 Z( D    move into pickaisle.induct3
5 i6 H" ~4 r/ y  f: O" w    while A_i<=30 do begin$ k) k5 l0 w3 ]- e2 h: |
        travel to pickaisle.con(A_i)$ N0 z5 ~: e& i, l( c$ N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# C3 a* Z7 s# Z. O- d* O( X        else wait for 10 sec) B4 [, V& e' i: T2 H: z( h
        if A_i=A_leave then send to die
( r$ _9 g+ s  U, G5 x  H1 `( L        else inc A_i by 1" i/ a7 f+ z& X" ]+ ~; G
    end
7 }& Y" v6 t: }: ?) h( f" Q9 C0 \( V) Lend

最佳答案

查看完整内容

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是个什么东东?
' e8 ~" o: z. Z1 ]% @( V; |% w" ^8 m! rmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. D) I4 ?8 w$ z. x# [! I7 _# {
$ w, k# W$ w6 I7 z+ J' h* Z1 w4 WAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。4 r- l2 ~6 J! g) }
& S  h# r$ \; S; L$ x- F; |
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 d, J" ?" [0 `! q. Q. S& Z
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 {6 m% w% \% Q5 C% F9 v2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;- x* g$ \' g9 H  C+ v
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' j6 V: O# V5 ?: t- C( U( r' {begin P_induction arriving
+ r8 [8 g& n, ]& K    clone 1 load to P_pick(A_induct)- x: w3 Z' m0 N# \9 I2 p1 s+ R
end最大的系/ {9 ]7 o; ?( o9 f" A& t# b- Z' v
9 z: f/ D4 [& d2 i* g' }8 P
begin P_pick arriving
8 K/ Z- X; c/ v1 f& T' h    set A_i to procindex * 10 + 1
/ Z3 s. x. \2 x: c    move into Q_induct(procindex)
2 Q# d! S* W' U9 w1 D2 D2 s: b: m    move into pickaisle.induct(procindex)
! f7 S5 @6 M+ J5 J    /*check the type of pickaisle.induct(i), for your last problem.*/
4 b( K) m6 Q( T+ H- c% s
( S& |5 P0 i1 N6 [* H    while A_i<=30 do begin- |% F1 Y( t3 |" W5 i* G+ [- O* L7 ?
        travel to pickaisle.con(A_i)2 \2 K( |2 x7 l* |# K4 d- u9 K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 I/ B7 r2 }0 ^& ~" k# N        else wait for 10 sec( m# C7 ^- Y. _- E7 ]  l7 m
        if A_i=A_leave then send to die# |8 @+ H: h% @7 \3 U- w
        else inc A_i by 1
) O. J# y$ @; V  V2 t4 h# f    end
7 x3 d! \4 o/ a& Q: send( |0 V* U7 k5 U% [
+ J4 g1 T; L7 f+ _% u4 r
其中的procindex为整形,代表当前process的序号。
( U* T* P! }5 H+ \1 b4 nstation和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-3-3 03:29 , Processed in 0.016903 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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