设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12806|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 W. N5 f! N2 J- j" v" x
- i7 j( W7 V! P+ Q我的问题是,在每个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中的数值,不知道会不会有什么不妥。
0 [8 f% r; b0 O' |
3 J0 i% _0 q. E( s" D/ O0 t+ Nbegin P_read arriving/ b7 v7 {0 J" Z0 y0 Q- Q9 J  P
    while 1=1 do begin& G, ?/ i6 N! Y- l% @9 X
        read A_tote from "data.txt" with delimiter "\n"
9 l( r: q9 L& f6 S        read A_time from "data.txt" with delimiter "\n"
1 `, t2 |# u( g) d- O+ o        read A_leave from "data.txt" with delimiter "\n"
" N( ^: Z7 X% O/ f: |        read A_picks from "data.txt" with delimiter "\n"' ~2 z8 ~. u, j
        set load type to A_tote
- ^, E) }4 G+ Z* R' @3 t        if A_tote="tote 1" then set A_induct to 1; R. W% ]2 b, ~& N+ O' X' P
        else if A_tote="tote 2" then set A_induct to 2
  c; b) U4 r! j9 \* _( \0 m* o% q            else set A_induct to 3   
3 u# c) p4 U' ^        set A_i to 01 m0 R: B" u7 x+ B9 ]# V9 r7 ]
        clone 1 load to P_induction- H$ r  Y" a. y8 q1 `& X1 Y
        wait for A_time sec0 }5 f% ~; N0 O! q6 G1 K6 A, I
    end% B  J7 e: \1 ^2 r$ R
end
- T1 l  f# k8 t- m$ K( s. N
6 M4 ]( R3 @& A- J7 s) Mbegin P_induction arriving1 v- }# H) a8 Q; x
    if A_induct=1 then clone 1 load to P_pick1, W' ^" N8 W; t+ O3 l
    else if A_induct=2 then clone 1 load to P_pick2
5 ~( t. I! p9 ^: m        else clone 1 load to P_pick38 I" q  F+ s/ {* r
end
7 M$ R, R6 [: N! {1 V& c4 L$ O
# q. R9 o( o% p2 t: Bbegin P_pick1 arriving2 t4 i* l+ ?8 e0 f: ]! }" c$ a
    set A_i to 1  I* f* d7 G( o8 X2 r4 Q1 K
    move into Q_induct1
3 E8 Q( F5 s9 e6 u; f    move into pickaisle.induct1
% q1 S; H. u% ]$ n    while A_i<=30 do begin
5 t5 |) [. u( {4 T        travel to pickaisle.con(A_i)
/ W; q, A5 m! L3 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 b+ B& B! N" f$ {7 r- `
        else wait for 10 sec7 G) P' q6 e/ U, {
        if A_i=A_leave then send to die
; c; U  N+ E# E0 C6 Z$ s8 q9 G        else inc A_i by 1
0 e; d- C8 \, j  H+ T6 C    end
- U( C0 W. ^/ u0 Y* tend4 F+ C2 Z& {4 s9 g. `2 j8 _

+ C/ ?- I) p- Bbegin P_pick2 arriving) k0 i; L4 s% [3 O# H1 _
    set A_i to 116 y" G) k6 \$ T8 s1 `. X
    move into Q_induct2
! A% D. g( M! y: t    move into pickaisle.induct29 v( K& k4 l. j- l; H5 j. K  Y- Y6 W
    while A_i<=30 do begin5 _. t# s6 W5 m3 `
        travel to pickaisle.con(A_i)
8 s# N" U3 S+ E# v" u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& n+ O( M* ~& e% |& T7 U        else wait for 10 sec3 B& X& U0 b* Z0 i
        if A_i=A_leave then send to die/ [, E* h% i! @0 t$ ^4 b/ l# j1 U8 o
        else inc A_i by 1' d$ \% A0 y6 j2 c8 G
    end
3 H* E/ i8 g& q0 J& A1 D/ F  O& pend
4 K6 `3 x* U6 `# |+ h
% p, a" `5 {6 O% n6 ~/ wbegin P_pick3 arriving
. k0 i) g' T+ f    set A_i to 21$ o3 `5 r: g2 {! n* `4 x) K2 u
    move into Q_induct3: E* D, V' r4 F- L7 Y
    move into pickaisle.induct3
; N; B; i. Z5 P    while A_i<=30 do begin- ?) d) _0 b& Y, S6 D, G2 [
        travel to pickaisle.con(A_i)
5 X: b* R! c/ ~3 D: A" d2 m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ x' W, c3 `' O, ?, k# k        else wait for 10 sec
( n+ R6 Z4 q: L9 M' s" Y        if A_i=A_leave then send to die: w# I8 J2 c. g7 C# E: Q$ `
        else inc A_i by 1# m' Q( [& v0 M5 o2 O' X
    end4 r6 N9 r  Q0 L. a1 @
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是个什么东东?9 j# n/ ~( `' i9 F
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& o" ~( N6 m% o' W
) k7 a8 @  M- M) K$ f# u; rAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 P0 S7 |& J; }7 @: p/ v
6 q5 d8 c! O* A9 J8 y8 s3 e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' {4 j) ?6 Y# T8 s# l, g, v9 m" O
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 c% g0 f  K' o2 \5 W( L/ o2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 z( i9 j% j5 w/ Z9 O3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:* V, l4 T% P2 `# t* S9 Y
begin P_induction arriving% m1 d& V- N  x' }+ G( j
    clone 1 load to P_pick(A_induct)
" t, m9 l1 e  u% x: x( yend最大的系& R, \/ w1 ~3 E( e, z. E8 h- S8 ]8 Q3 {
: \  x) t) y; y, V, I0 a6 {
begin P_pick arriving/ M8 S& n" K; U2 K
    set A_i to procindex * 10 + 1* R( e1 q  M+ T5 U
    move into Q_induct(procindex)
4 O/ m1 D8 V8 }3 y* z" q    move into pickaisle.induct(procindex)
" R- P7 ]6 N! F. \, O$ }' D    /*check the type of pickaisle.induct(i), for your last problem.*// R# x- r, Y) J. H1 `7 A3 u! I# N1 ~

2 O: l2 ~- x# G    while A_i<=30 do begin
/ W  V2 [: F+ X        travel to pickaisle.con(A_i)1 U+ E7 m9 m9 I* G# t5 }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 i% n5 S  Q* a  i        else wait for 10 sec9 n4 M, W, r# |0 p/ n8 E- V7 w
        if A_i=A_leave then send to die
0 f( m. F5 s5 e& A; m8 p        else inc A_i by 1
+ y& l1 x7 ~; a2 C' V$ y' ?6 B    end
2 [' a% N) [$ {; E: Jend2 H- S0 A- [+ o+ e1 x( f+ p1 @( {
- a; y* E* F- \. i8 q
其中的procindex为整形,代表当前process的序号。
; Z5 [3 m: l0 N4 c8 c: U) @7 Gstation和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-2-22 01:58 , Processed in 0.018499 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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