设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14142|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ ]& ^, A8 u# g) g: H
7 l5 ]$ }. p  N4 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中的数值,不知道会不会有什么不妥。
/ A7 X+ |# [5 B, {. B0 ?; J5 Q! n6 t( @7 @0 o
begin P_read arriving( z% z4 o/ d$ S5 o5 v' ]1 m
    while 1=1 do begin% k3 b" j4 _/ s- g& R% D2 r) `
        read A_tote from "data.txt" with delimiter "\n"
" J7 g: X2 G# [        read A_time from "data.txt" with delimiter "\n"
, b5 }1 w- W6 m5 j7 d$ r; `" {. M        read A_leave from "data.txt" with delimiter "\n"& y( W. m! I: `: o
        read A_picks from "data.txt" with delimiter "\n"2 g2 J+ c) i% H6 j0 n4 l9 A
        set load type to A_tote
0 q4 N6 c0 }# b- b1 z; t  B2 y        if A_tote="tote 1" then set A_induct to 11 g9 w9 i$ P4 B1 G0 I7 n) R
        else if A_tote="tote 2" then set A_induct to 2
6 J4 Y9 B  d) B7 Q! d. R            else set A_induct to 3   
+ B2 w. T9 J. H& q* v$ s- Y* I        set A_i to 0
3 E: w2 B0 b( h  }  Y        clone 1 load to P_induction" ^" e2 _* X: N; L9 }6 i
        wait for A_time sec9 c8 o/ D/ e+ v, J) A
    end
8 ^/ j4 E3 w. w! K+ ]9 p* ]end
) r1 m) i9 c) r! A' [8 e6 s) a& O8 U/ `
begin P_induction arriving1 p) O% T1 @1 H3 s! z
    if A_induct=1 then clone 1 load to P_pick1
1 M+ @( @' N- G: {' l; a    else if A_induct=2 then clone 1 load to P_pick29 G, L$ G, W6 A- m1 Y
        else clone 1 load to P_pick3& ]0 n8 i! D8 B) `' ]
end
6 F0 |9 j5 ~: m; y8 ^' v& T5 K, ?$ V4 @
begin P_pick1 arriving; C8 S: c7 b5 ]4 S
    set A_i to 1
& `% g' E8 C, l    move into Q_induct1) p8 e; |, a* [) l
    move into pickaisle.induct1* n8 E0 A/ T% W/ H9 n! o3 X* o" y! @4 i
    while A_i<=30 do begin
4 M" W- H9 k) K3 m$ q; y( q% _5 G+ J- J$ o        travel to pickaisle.con(A_i)) t, G+ q1 m% S  f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* z! b) e+ `" ^1 f+ v        else wait for 10 sec
. Z1 d$ V6 s. j) r& `" h: n        if A_i=A_leave then send to die# [% d% x" r% }& f
        else inc A_i by 1
$ T( O4 f7 K& V! X    end
& ~% M9 f! X" q: R" I3 pend
" G# ^+ u: j+ l3 O" v
* n% }$ j: M+ cbegin P_pick2 arriving
7 D4 [7 W, [( n9 Y1 l+ D    set A_i to 11
# K2 R6 D+ |/ g% \0 E' Y    move into Q_induct2
% @! z/ ?7 E+ ^) c5 K    move into pickaisle.induct2
6 D3 R) j. [2 D( b) b1 ?    while A_i<=30 do begin
9 e" Z: g$ S# L  X" F& R2 t        travel to pickaisle.con(A_i)
7 r# Y. W* o& g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 K/ h2 C5 c2 x) T$ Q$ p. _        else wait for 10 sec
: ^. y( Y- j& p7 k        if A_i=A_leave then send to die# K/ h* x& L9 k# L% B# b5 `
        else inc A_i by 1
* R; K3 D; p* x9 c2 l    end
6 d4 I# R/ k- V6 F, j" J+ tend' H( A) X2 N- |; b( q$ U* R. P2 J) f0 d" s
+ w- m- ]2 }% c: F0 S
begin P_pick3 arriving# d8 ?' I* r/ R0 k2 e. J6 Y, L
    set A_i to 21: P& k" x# e; T! o% ]' }) R
    move into Q_induct3
( Y( i6 ]# `9 S- n# d( y( `' _8 {/ Z    move into pickaisle.induct37 r) _- ?1 p& }! N" Q
    while A_i<=30 do begin7 A/ o0 @6 k) t% F' F9 {
        travel to pickaisle.con(A_i)
4 P, J* _3 J0 a! |, i8 O- t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" S1 Z5 j# ?) ?+ R/ V( j5 f        else wait for 10 sec
% I0 {( z. k) e/ y& I! X- J        if A_i=A_leave then send to die4 Y8 w* x: }- L0 K- X% g0 `& I
        else inc A_i by 1
3 F& W- f. V+ @4 ?) m/ X    end
- }# e  k+ K& j* W# m7 ?% Z  W1 |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是个什么东东?
; [& Z/ c6 C$ Q/ ^: }move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( P9 k1 C3 I! g+ a- \$ `! i

3 ?: Y- k  h6 m2 _AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ M4 V7 L9 X- N% o( A
+ E, z& B( ]. s9 l, _) J# J/ f另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! n  P* L! V. k# b$ _* ]
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 f; M6 ~* Z' h0 k
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 {. Z9 e1 h( U- S* ]4 d' A
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: p0 w3 t6 o& g/ C( ~+ ~% v
begin P_induction arriving
2 G/ L, E. |& t- x    clone 1 load to P_pick(A_induct)+ ]! r% F( l6 [2 B  d
end最大的系
! L& e3 ]  s, w: Z# B6 g0 r9 C4 H% n! u, w4 ]; ^/ N1 c% D6 B( C
begin P_pick arriving
1 V+ Q2 [: F1 J4 U" m( v. M    set A_i to procindex * 10 + 16 T% z( I4 b% |$ B, E
    move into Q_induct(procindex)  w/ u; A4 ?3 I) Z/ e
    move into pickaisle.induct(procindex)6 G8 E4 @5 ]5 V! D/ K
    /*check the type of pickaisle.induct(i), for your last problem.*/, r& {4 ~" M9 G3 [2 z
6 A0 _5 W3 G) C0 K
    while A_i<=30 do begin
8 ]% K8 W( w0 ]) N/ Q        travel to pickaisle.con(A_i)9 ]0 \2 s) O) d3 U* ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* F% r$ p3 A7 `  }        else wait for 10 sec( ~- M) T, n9 Y: ]
        if A_i=A_leave then send to die
2 `- U7 n& s- B# E* M6 [$ T- V7 N5 r6 w        else inc A_i by 1
4 \, U5 J$ }) g  c( H/ ~, _- J  a. X* u    end
: }7 v% k* O5 m! h5 ~end
( U0 h$ }5 n/ b+ k* g- ~* A2 Y( I
其中的procindex为整形,代表当前process的序号。0 [6 L+ ]- ?7 M. V  S# }( i
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-6-13 18:17 , Processed in 0.015196 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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