设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15293|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ P2 ^' A8 D; f% B2 W5 ~

3 }! {: P0 N) ~3 C1 N3 F我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 x; E$ v3 M5 v. R- \% M$ g2 j' i
( c1 k5 U1 r! M2 P" k( D. e* V
begin P_read arriving
. C, D, j( g7 R+ D( L5 A    while 1=1 do begin2 w. t1 k+ D8 R9 E. ?6 P( Q3 }/ ?
        read A_tote from "data.txt" with delimiter "\n"2 d# o2 W/ b4 E) r
        read A_time from "data.txt" with delimiter "\n"
" j) Y( J/ R8 A; E- A! Z        read A_leave from "data.txt" with delimiter "\n"
, w% `* u& _+ e) c1 T        read A_picks from "data.txt" with delimiter "\n"
' d7 b0 e* |8 R& m% ^        set load type to A_tote
0 C, c' ~# J- m        if A_tote="tote 1" then set A_induct to 1$ ]" q7 _5 _* b- p1 d+ Z! B, g
        else if A_tote="tote 2" then set A_induct to 24 o* c. p9 N, k* K" T7 a+ t
            else set A_induct to 3    + W, e% D! [8 x7 ?  p7 {) D8 s2 U% o
        set A_i to 0, }8 V# b# p, j
        clone 1 load to P_induction5 g0 V: |# d( u
        wait for A_time sec3 `6 Y7 ]" A4 p% X5 i& h  p
    end
6 ~% Q, g4 o9 s, o" c9 R, E, Oend9 ~1 _3 e1 M" U% h5 c
: @9 q) O4 D/ Z* U, h3 K6 t
begin P_induction arriving& P# d9 s+ q9 j2 _
    if A_induct=1 then clone 1 load to P_pick1( h0 K; H$ q5 H2 l4 Q
    else if A_induct=2 then clone 1 load to P_pick2
* t' L3 P7 {  f( |        else clone 1 load to P_pick3" ?! V: r! H! b0 _
end
+ Y# b7 ~( j* {5 D. p
& E6 y- S- T% d( I( {4 O. L- r6 ?! }begin P_pick1 arriving
$ {6 z; O& E  r    set A_i to 1
+ j$ X+ F% u& E1 ?    move into Q_induct1
( I$ G* e4 y6 E* i9 I: I    move into pickaisle.induct1
6 [0 |7 ^' n; _( r/ s6 i8 ?* z    while A_i<=30 do begin0 X& S- n$ e" I# E$ Z
        travel to pickaisle.con(A_i)
9 C/ G2 [: U& g6 F- `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( T, Q8 ~8 M! t# I7 @0 o
        else wait for 10 sec
/ K4 {" [- J6 |( S& T5 F        if A_i=A_leave then send to die9 ^; E0 |$ [* c; _  k6 z  E
        else inc A_i by 1
" `' P0 F, I4 t( ]) F* L* Y    end
" |4 }; ?. a8 K7 Oend/ f; J5 Q6 |$ z: N. v. X# H
" p; Y* a6 ~6 f
begin P_pick2 arriving' V% E$ E: q: B6 i1 ^+ E
    set A_i to 11+ W5 H2 \# E/ ]; x) q3 }! j
    move into Q_induct2
; y2 p% y" v8 W) W8 W9 o" U) w    move into pickaisle.induct2" s- r2 r$ T$ A6 @( ?1 a4 t
    while A_i<=30 do begin
& i! q5 l: T! Z. X        travel to pickaisle.con(A_i)( h6 W! M$ O" I( j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 I- m7 r% n% d. }        else wait for 10 sec
0 X/ @- g6 `% }7 \! {        if A_i=A_leave then send to die
( P+ v7 O: z' ^( M7 X  ~9 U$ ~        else inc A_i by 1
) m6 e# B9 q  w4 [, o% M" ?/ W6 _    end
) u' ?: c7 h7 jend; n: ]% Y8 O5 M

3 ]" I/ D, b8 X& F6 s' |begin P_pick3 arriving
$ y& m9 H1 u" \    set A_i to 21
  q0 R; }! D: ^3 K; c$ L    move into Q_induct3
; a! A, M6 J' U  n. K    move into pickaisle.induct3
3 |7 r/ V" U( N    while A_i<=30 do begin
& A0 {5 F5 _# J2 d# [: H% l& A        travel to pickaisle.con(A_i)- B5 Q( v; j, `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# t& T2 k* f& I8 b1 [2 a# Z
        else wait for 10 sec# |( q1 W+ C9 D' b- b1 g2 ?
        if A_i=A_leave then send to die% X6 t; f" I8 j% p7 y& x& z# `( Y
        else inc A_i by 16 n. b1 O4 W, ]- D$ F
    end
' B0 H& L$ E4 n& ?" u: Fend

最佳答案

查看完整内容

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 A# d# J5 e# u, Y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 [- D6 A: J6 l- E5 V- y% k3 s
) Y( f. d# z9 P7 hAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ Q7 {; N! U* |5 |) P5 c" b

' _( E) j9 S( K; L1 S另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ L4 k' J, w2 Z! n0 G3 W1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ L0 d- y0 R/ u, p, m+ B
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 {3 t, H  c; ^: D. u# |3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ i6 O: n0 q( x" B2 S
begin P_induction arriving8 F2 B) J, {( m$ R$ _* v4 S
    clone 1 load to P_pick(A_induct)0 W9 ^5 `5 ?- e7 H
end最大的系3 c- M; Q: r" i* L: Q8 _6 a

) Z2 i- y4 s& i* A! A- Lbegin P_pick arriving
1 t( P! y1 k6 {    set A_i to procindex * 10 + 1' P0 s5 K$ ]+ Y1 H; _* G, x& {- x
    move into Q_induct(procindex)4 q/ s/ W5 a" s+ B1 [5 k2 Y# x
    move into pickaisle.induct(procindex)7 G) U% D% |0 c! Q' t! t; r& f
    /*check the type of pickaisle.induct(i), for your last problem.*/# m4 M8 I/ ]; u
, p' v7 X" _/ f+ x
    while A_i<=30 do begin
9 ?6 y) V7 t, J# W4 Q        travel to pickaisle.con(A_i)
, j+ p, o7 ~/ S9 {7 A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! u& d4 C1 v2 N& v7 L6 w        else wait for 10 sec: V1 H! L. ?6 g6 w
        if A_i=A_leave then send to die
3 C* N* P* D( G        else inc A_i by 1, S, i8 {/ u$ N' s2 Y/ z2 B; n6 M
    end
7 ^# [/ }* h4 [' }end( g! w0 k5 s8 p: a6 m
) b5 J+ ?% Q$ B
其中的procindex为整形,代表当前process的序号。- X3 _0 i5 @5 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, 2026-8-31 06:24 , Processed in 0.017137 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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