设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6450|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( ]5 ]6 }8 F2 B3 p# F1 B" I- p, V7 f2 O: m) N
我的问题是,在每个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 }7 _1 g7 C
# T: v$ x0 r+ @4 g& |begin P_read arriving
% ~' d1 L: E! v2 a0 L) Q    while 1=1 do begin) [% B2 T. L" {3 {& D# [- m
        read A_tote from "data.txt" with delimiter "\n", x1 R& |. Z3 _; T) Z2 j
        read A_time from "data.txt" with delimiter "\n"
( l* r% i. V5 y/ E$ A% B  o7 G        read A_leave from "data.txt" with delimiter "\n"* M  D( t0 H1 A
        read A_picks from "data.txt" with delimiter "\n"
; Y' X8 B# O7 u6 w% \0 P7 f        set load type to A_tote( s6 H5 R. j& m" h
        if A_tote="tote 1" then set A_induct to 1
" b# n8 i# ?7 u( R9 {9 ^        else if A_tote="tote 2" then set A_induct to 2
8 j$ R4 |6 t8 _# k            else set A_induct to 3    $ N; G+ G( Y9 e; r7 Z: ?) E
        set A_i to 0
) O% Q0 ?3 l9 c- A: K% J: c        clone 1 load to P_induction
2 Q8 f: M* M) A9 S! C5 N        wait for A_time sec8 W" {) _4 J; K/ X  C
    end
7 [$ L5 ]$ v8 _' _: P' gend
# V  i6 c, x/ Y$ t
  k% f4 D* n' A: q; U! Gbegin P_induction arriving
5 M5 n2 u8 l- W+ u# s    if A_induct=1 then clone 1 load to P_pick1
, K; c% G5 q5 H: Q4 V- t- L  ], a    else if A_induct=2 then clone 1 load to P_pick21 z  Q; j6 b; u; a8 n, g% o8 i
        else clone 1 load to P_pick3* @1 y, V- O$ ?) q
end
' w. {7 s% k2 Q# A3 V+ Z7 p2 K+ E- d3 O4 v6 z
begin P_pick1 arriving
/ V: R3 w! w0 x0 b7 k    set A_i to 14 \( @( o" p5 J( @. s1 B, r
    move into Q_induct15 `% W2 r) `) W
    move into pickaisle.induct1$ z% _* g! b! ^0 }! P
    while A_i<=30 do begin* t; R( e3 H. p! \1 u/ A' V
        travel to pickaisle.con(A_i)
' v1 `/ u; X2 _) |6 g/ y& o0 X: A, N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& p5 W. r1 ^. x# l5 S7 Y, c2 G0 m; Q: ^        else wait for 10 sec
- ~& ^$ V% M4 \2 g        if A_i=A_leave then send to die& _7 Z: ?2 a6 ?' y; _- P/ |
        else inc A_i by 1
! Y! ~, |& x7 p1 J3 p+ X6 Q    end
; p, r1 q$ f( m+ z- Lend
( Q5 h3 E, z/ n- u) F% c
' M  A  y8 t- D$ s4 m+ I+ E+ Zbegin P_pick2 arriving
" r6 w' O# z2 M- ~. i    set A_i to 113 q5 A. e( ]) F5 [! M3 J/ {9 k
    move into Q_induct2
2 s4 o- v  p1 _: m0 [4 c    move into pickaisle.induct2
$ j0 z. u5 c: A& X3 D    while A_i<=30 do begin. t! L9 k& |( p2 h% ^5 r2 B# P2 A; g
        travel to pickaisle.con(A_i); S. ^: Y# N5 I% r2 N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 c( w: F2 F. h
        else wait for 10 sec* z( @( j% _5 [! u, ^2 h7 k
        if A_i=A_leave then send to die
4 N% P- v/ t$ x) R' s        else inc A_i by 19 c+ ?2 w7 O0 {; x; `5 Y: ]
    end* i4 d+ C/ I, Z  A) s
end# ^$ o8 A! A5 f) n/ _
2 H9 |) y- Y( ?4 i
begin P_pick3 arriving
/ }) L" H# H' P5 i2 x    set A_i to 21
& i; E2 ]* E- ~! t0 X) w0 u3 m    move into Q_induct33 |6 Q' C' w. P2 I2 \
    move into pickaisle.induct3; P  o7 u% ~; E, v' w+ j$ g& V  z
    while A_i<=30 do begin" u' G/ a$ _5 J  I2 h
        travel to pickaisle.con(A_i)
6 B: N3 o4 i9 e+ W( |; ?4 C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 G: ?/ G, ]- y! m
        else wait for 10 sec" k$ K  E% @" d5 `* B4 T1 A
        if A_i=A_leave then send to die" S, k$ n+ x4 e$ n8 Q8 @' q$ j
        else inc A_i by 1; p2 A- S7 I+ ^: b' G
    end6 r6 Z$ B4 L' n8 v7 J8 f6 W% H! 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是个什么东东?. P9 Z" T! I3 n$ \: O
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# X5 [$ Q+ `% N9 b, h2 ^. i2 J- v. W) v7 X, G& A# q& j' [
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 `2 m5 ?2 T4 r/ q7 M" h
& J0 |: ^/ ~( v) g另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 T. X( K" z( P; e0 p6 b9 G% {0 e; }
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" i5 q3 T4 W# P( P2 j. c  w( P2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 u  ~7 F8 s/ O% y. G$ m5 o/ ]7 ^
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ ~5 u3 p$ Z  ?
begin P_induction arriving1 K3 j% n$ \6 r& T& ^1 W
    clone 1 load to P_pick(A_induct)
. D, B; L  i/ t0 Y! iend最大的系
* w! C+ w0 w# M" D, n( G
+ J5 v) e6 x! G9 r/ q4 l0 bbegin P_pick arriving: {8 ]4 y- `. T2 S/ N
    set A_i to procindex * 10 + 1  g4 r9 p: l' G: {& x. l
    move into Q_induct(procindex)+ ]+ E* h9 t3 \% J
    move into pickaisle.induct(procindex)
1 ^! w+ i5 k# M, Q! ~  T) {    /*check the type of pickaisle.induct(i), for your last problem.*/
, M3 v# e( {8 w
4 i9 b3 P- m1 c' G3 E, J# x    while A_i<=30 do begin" k+ y" ]7 c7 h# _( F8 b
        travel to pickaisle.con(A_i)# X" T2 U5 a* O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 X8 G/ `) B! m* N; v
        else wait for 10 sec
% Q0 p0 o1 V$ n  Z& s3 v9 N        if A_i=A_leave then send to die
4 R& p7 R' Q9 t# [% V        else inc A_i by 1
2 J2 U) E* y9 r; s  j! V7 R: Q    end% B( ~* N' h! P3 p' w& H
end
& j! ?1 R, _  u! e* {9 I/ g6 ~. n7 F' @8 K* q4 @
其中的procindex为整形,代表当前process的序号。& K7 }1 H; x( W0 A, R& c
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, 2024-6-9 13:22 , Processed in 0.012751 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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