设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13901|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& Q; K; E1 o, X2 J4 L! C" t* a% l! |; X) D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, M* T' A# K$ Z7 i; C+ n. m) K+ `5 \
begin P_read arriving
! x7 Y+ [+ a2 x4 }  X! Z    while 1=1 do begin
5 z0 [5 E! D. e9 D* b0 ]        read A_tote from "data.txt" with delimiter "\n"# b/ }: K6 y2 a
        read A_time from "data.txt" with delimiter "\n"/ i5 Q5 O9 \) s* ^. L) _& O: ^
        read A_leave from "data.txt" with delimiter "\n"
( z0 J5 l" `  J* K        read A_picks from "data.txt" with delimiter "\n"
  U5 i7 `3 `5 U! j1 _0 J        set load type to A_tote/ u* Z) X9 r/ y! ~  ^
        if A_tote="tote 1" then set A_induct to 1
6 ~9 O- k' M& Z' ~- W/ M( y        else if A_tote="tote 2" then set A_induct to 2
9 R4 L+ S. U. s# g$ l! }            else set A_induct to 3   
8 Y1 [5 T- A. S; {  Y        set A_i to 0
- e6 P* K. ~/ D        clone 1 load to P_induction
8 F' f" Y- y1 ]2 G" K        wait for A_time sec9 x0 }/ s3 \3 r$ h+ y! P) E( }* x" o
    end" l7 i* A% i! b2 ~1 f
end0 F) f& y+ z1 X) a
' T, \4 Z/ m8 R& ?, q, ]. p/ f
begin P_induction arriving
- ^3 x9 m0 O0 k4 b0 U9 \    if A_induct=1 then clone 1 load to P_pick1
3 ~" w) A- u) q7 f    else if A_induct=2 then clone 1 load to P_pick2
7 w! t0 n* f1 \/ D/ A3 U; |        else clone 1 load to P_pick3: }0 M# W/ V& B2 j, u; @7 K0 e" ^) U
end
2 B$ \* z1 Y2 l3 P; T3 u- X3 i) @% N3 B) y: p- V
begin P_pick1 arriving
! q4 Z5 b% z: X  _    set A_i to 1
6 x. D. Z, y9 U    move into Q_induct1$ D: b5 b8 o+ y( ^+ M
    move into pickaisle.induct1/ B* Z! p: t/ k
    while A_i<=30 do begin
" v, }; I; m* M        travel to pickaisle.con(A_i)
5 g4 h. k; D' f3 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 q2 z8 h7 `7 e! x1 i
        else wait for 10 sec
: c. ^9 t' r' L3 R8 U        if A_i=A_leave then send to die! O7 {4 H' o' {  A% a4 m1 ^
        else inc A_i by 14 r( N( T1 r# X7 a% m  w2 y
    end" Z5 R% e( N. T, b5 P
end' c0 _/ q, N, L" V' ^% E, j3 ?
/ k- V. i3 o8 [/ z
begin P_pick2 arriving+ C. [. U. W5 _: r- }
    set A_i to 11% q; @# `8 ?) F) V: U6 Z  Q
    move into Q_induct2: q' U" w/ S, |8 k% w4 F9 W+ F
    move into pickaisle.induct23 W# q. H  m5 r' h
    while A_i<=30 do begin* X, t/ o+ T" y4 r
        travel to pickaisle.con(A_i)$ k3 f! Y9 T1 M' {+ K+ q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; ?& t/ Z: D' Z* j/ q) q1 }$ o
        else wait for 10 sec' Z6 E! Z* C0 d6 a6 ^& B- [0 z, j4 I; q( c
        if A_i=A_leave then send to die
) B$ O& G( u7 H7 w, J        else inc A_i by 1+ b8 f1 k2 t# u: j. E
    end% H2 b; _/ A+ \
end% r+ V6 D. h( S) P7 K7 ~6 u

  y9 h) B) I, R1 I4 i4 @begin P_pick3 arriving$ N$ k# W) V) N" u: S
    set A_i to 21; f$ Q( r! N$ X+ E. @. q/ C, @4 l7 H
    move into Q_induct3
! s' d3 e: x0 K1 a    move into pickaisle.induct3
# b$ a7 V5 W' A$ k    while A_i<=30 do begin% x% p, h0 d& x1 H3 j
        travel to pickaisle.con(A_i)8 V) N% e: P6 p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% P4 s7 N( \9 n; X: G. D2 Q0 I
        else wait for 10 sec
; b/ S/ c2 U0 f# j- X        if A_i=A_leave then send to die
9 `1 _0 h9 V' E) X% l        else inc A_i by 1
5 }2 A4 w0 A: W5 {1 \. W6 q    end1 _6 k$ D; L5 }/ r/ u) @1 O  w
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是个什么东东?5 \* s6 x8 n, T" i8 K% \
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# F- _+ h, {  L0 C3 L! T
, k$ y6 W/ I: {) kAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* [: r& x9 f3 G; U# B4 G8 |
$ f. X  }5 A" `/ i另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:& Y$ j, g8 q! n/ G' ^. H8 D. T4 |
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 t) W9 H( V( H! ?* J* Y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, Q0 q, t: u' l/ F$ F
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 q1 j) d% G: k6 |, _begin P_induction arriving; K* U. y! G! S
    clone 1 load to P_pick(A_induct)
0 j3 [- Z( z" b. I3 send最大的系
9 b! }7 e$ ]5 I( @
: R* L: J6 i% H; Wbegin P_pick arriving
% R7 c9 L( E. x; u2 t    set A_i to procindex * 10 + 11 l) b4 Y0 _' g! y  M
    move into Q_induct(procindex)9 m3 d: n! k9 l, }+ g+ r
    move into pickaisle.induct(procindex)
/ Y' o! d6 s, N    /*check the type of pickaisle.induct(i), for your last problem.*/
- u2 E- U4 `( C0 ?' C/ u2 n' D. g" f# |; T3 }7 e0 |9 U
    while A_i<=30 do begin
: F: i% z- S0 }        travel to pickaisle.con(A_i)
  P. g0 h: W8 b! U! d% a1 \) R- A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: S1 {2 h! B  K0 g6 t; J        else wait for 10 sec
: L. i2 i( |. O- q        if A_i=A_leave then send to die5 H( [0 I( @0 G, u0 i
        else inc A_i by 1
" e5 B( E# t0 b+ Y: w$ R- \6 A    end
7 n+ E! l( k- U& {, v0 S: E$ mend* I: Y! T$ u+ _. }/ `$ K2 G

9 D8 l- u' E7 W6 X; A/ e其中的procindex为整形,代表当前process的序号。6 T9 A& u+ C0 g$ B2 d$ }: `) s
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-5-17 00:29 , Processed in 0.027709 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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