设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11861|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 Q8 V; s: w, h' G5 J3 E8 ~
, O& |' o4 e; @( c) G/ P
我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 @4 A- G7 w" u) c  ~! u; y1 _

0 ~2 z! V  x, C. X* ^begin P_read arriving
( C$ l( _+ n! j: x& w7 C* v; K3 U    while 1=1 do begin
- i1 Z0 p$ y4 ]# ]7 [        read A_tote from "data.txt" with delimiter "\n". {* M- N; A" B+ @3 F+ c: N2 D# {
        read A_time from "data.txt" with delimiter "\n"0 }0 d, r) @& a8 i( f; Z' k
        read A_leave from "data.txt" with delimiter "\n"
1 A2 D  w7 d7 y6 k( w        read A_picks from "data.txt" with delimiter "\n"
; \2 d1 f4 ?( U2 {9 X8 j        set load type to A_tote2 E# H' l2 m4 z3 u4 |( Y5 |6 k
        if A_tote="tote 1" then set A_induct to 1
& l8 r& o- y. b/ O        else if A_tote="tote 2" then set A_induct to 28 e. J  q6 O( [
            else set A_induct to 3    9 j0 _- M) Q4 J0 \: K
        set A_i to 0* g( h; M$ d* H- T. y' O( o/ X2 u$ C
        clone 1 load to P_induction3 z: _( Y% M% E
        wait for A_time sec
8 v4 q. B# k- e8 J5 |    end1 M$ j/ j0 Z/ d' }0 r% c
end" P# i: D/ K  z; }/ `7 M

, i) I" a7 C6 ]9 K: ?) Ebegin P_induction arriving
2 f1 `& l$ A1 Q    if A_induct=1 then clone 1 load to P_pick1
9 F0 ]! o( t% t( C: f    else if A_induct=2 then clone 1 load to P_pick2
0 |. |% ^! D4 q: _0 |" ^        else clone 1 load to P_pick3
/ F- p5 h$ `) E- Y9 rend
' h& V' ~. b) u; a8 c7 D
0 i# _" O# ]1 o# q! Abegin P_pick1 arriving3 L- F# Y; S5 l& c. |
    set A_i to 1" q7 O* h! W8 Z1 @: _6 g3 n
    move into Q_induct19 d. ~) {" }$ O/ X$ D' T  [- Y
    move into pickaisle.induct1% N' S& O# ?6 T2 L! S) o
    while A_i<=30 do begin
7 ~) ?4 G  x3 S# h( v        travel to pickaisle.con(A_i)  S# Y6 p, w. J* q9 s% x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ E) P  N$ i% ?9 P1 F" o        else wait for 10 sec
" Q( P8 l: u9 j% j$ U        if A_i=A_leave then send to die
- N% h( K/ y& g0 `; D        else inc A_i by 1) _- }, @1 F5 x" J" \
    end
6 b3 s0 w  ?) G; \. G/ R8 ^  v1 ?: ^; Gend
' T, K. B* }; s: k+ t: O" H1 w$ n
begin P_pick2 arriving
) y! X2 R( p: |1 E* I7 Y6 Y9 E    set A_i to 11  t% D! j1 B/ t  x
    move into Q_induct2
- P6 K: Y. H. ^+ E    move into pickaisle.induct2
+ K/ k9 i/ V9 ]0 d+ b, W    while A_i<=30 do begin- \) p% X! U2 p
        travel to pickaisle.con(A_i)* ^& [8 Y% P; K- I' h7 l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# P; f# y  ]$ \" j
        else wait for 10 sec
2 g8 ]$ R- n& W1 C        if A_i=A_leave then send to die9 [* d) K( f/ i! E( q! s
        else inc A_i by 1& e2 l) u# [: F- q7 Y9 V
    end
# k& R$ \% i4 F8 E  X2 t- uend
" f" F0 G) y6 p$ B4 t' K7 r  ]5 V, C; ]0 T9 {& O0 a
begin P_pick3 arriving, i4 K' Q% Z7 x; c( N  Y- C
    set A_i to 21
3 j! Z6 W! a+ X0 b7 @% _) J    move into Q_induct3
6 H/ v. j, z2 Q; j& j    move into pickaisle.induct3- m' d! W8 ^" i& w9 n2 q
    while A_i<=30 do begin
( ~7 X3 f3 Q  a# i& E        travel to pickaisle.con(A_i)8 c' ~6 c& A9 T" @3 z) S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 V, u( h6 N, H9 x: i
        else wait for 10 sec  R, ]" \6 q- M% u8 X
        if A_i=A_leave then send to die
' |2 h) V7 H; ~& J+ V! L$ h. S+ Z        else inc A_i by 1% T& o( o6 H( R' }5 v0 e- ^
    end
+ B$ U$ `& O: Z( b% t5 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是个什么东东?# K  r, e: j6 Y* ]: v* C
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 W. p9 z, y0 z& I6 j
: X. I9 ~" i5 g- {  |7 [AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 s+ P% ?' `8 }' `  ^' X6 y3 y+ U7 r1 [  K# s2 S& @
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 H" K; j- Y+ S& Z4 }$ E
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 h/ ]; Y& q) A/ v- Q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;- L: F5 C7 K3 w+ w# ~, t; U
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' y+ K! Z" B7 }+ \( }6 q
begin P_induction arriving
& `4 ?+ I' O2 O  H: `: r, p    clone 1 load to P_pick(A_induct)
' W8 V( J  S2 S  s- Q# [  @; zend最大的系
' I+ f( q. r& }1 r8 u9 J, k: G4 V7 u3 O0 _$ s* |' J  `
begin P_pick arriving
7 Q# F' q; Z/ ~+ z, V2 H$ q, ^6 Q    set A_i to procindex * 10 + 11 A8 i% W. c; G* ~3 C
    move into Q_induct(procindex)
/ k7 H- V4 G- y$ x# D- X0 m    move into pickaisle.induct(procindex)" w: |( H: ?9 O2 _
    /*check the type of pickaisle.induct(i), for your last problem.*/- `7 t- m8 o- ~- L- O

7 z% Q, N& h% s0 I! A3 x. w    while A_i<=30 do begin
" o* l7 J- @* T- |        travel to pickaisle.con(A_i)
; P6 }& O7 B1 E7 o( y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 l! I* @% T& V- D( ?- Q' e
        else wait for 10 sec; D& R5 w8 m9 j0 j- v
        if A_i=A_leave then send to die, ]  B$ s+ z. n8 `$ \3 j) B) F
        else inc A_i by 1
- Y7 F9 D' M# z& A" S7 S    end
$ p+ ~0 W! H3 d9 p& H9 fend! G  I$ u- |7 V7 k+ Z/ J$ E
. R* ?0 u' d6 z; N' H8 U
其中的procindex为整形,代表当前process的序号。
' L6 e* F4 ?2 x% w! \6 z4 }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, 2025-12-11 07:37 , Processed in 0.018370 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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