设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14209|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 M0 }$ A+ g  x

2 c6 h3 V8 y, M; O我的问题是,在每个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 h9 a( r5 e' ]& u9 h0 K6 A- X8 a; F
begin P_read arriving5 u% U' y2 _. S
    while 1=1 do begin
2 c  E2 y$ Y7 [% z! U        read A_tote from "data.txt" with delimiter "\n"
0 `8 z, n7 V; F; h/ n# l, N        read A_time from "data.txt" with delimiter "\n"0 ?; o1 S* c! \2 q: ?. e
        read A_leave from "data.txt" with delimiter "\n"$ p7 C; s$ l* g4 @& |
        read A_picks from "data.txt" with delimiter "\n". @9 x4 H; {5 G6 [9 y. i* D6 W5 N& z# A
        set load type to A_tote9 a8 U+ i, M! w6 O
        if A_tote="tote 1" then set A_induct to 1
4 s: _- @2 U* J8 A$ L        else if A_tote="tote 2" then set A_induct to 2
( _- S( K0 g; A  Q4 A            else set A_induct to 3    " X% M( W( i- z) w( ?$ a
        set A_i to 0. [& y3 V2 g& V# Q' k
        clone 1 load to P_induction
, q# `  J  b& k0 f* c# S+ p$ {        wait for A_time sec
8 |; N; x! K( r: e/ S( N    end
% Y) V& p) V! m, U6 m) i7 d6 u& Wend* s* k% D# h1 i6 L, U' p. @' Z

  X0 Z& r! D4 o/ ^begin P_induction arriving
- \7 U; _$ m( k& z2 }' Z( ~" ]" v$ \) J    if A_induct=1 then clone 1 load to P_pick1
* S' f, V, {% g+ Q, P7 \    else if A_induct=2 then clone 1 load to P_pick24 g6 `. x. D: ~! H  S# U' B
        else clone 1 load to P_pick3
9 T4 ?* X% \5 ]% Wend
1 d) g- b  b% O" W5 H! B* g. Q* `/ X" m
begin P_pick1 arriving
; g9 m: F$ u5 i    set A_i to 1- s& Z2 F% P. w; _9 @* W
    move into Q_induct1
" z# G3 [$ }4 ?: Z    move into pickaisle.induct1
: {! Q  h# B5 h0 l" ?7 ^    while A_i<=30 do begin
: D& ]3 K# t# \3 b% e% \2 G        travel to pickaisle.con(A_i)
/ i% U& N9 M) ]& Y( J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( U6 i" W! ?- F3 p6 S+ t        else wait for 10 sec( I  ]* x  k5 d+ h0 |7 P* @
        if A_i=A_leave then send to die
3 N3 ^3 {. C; T! b. i: j5 K( F        else inc A_i by 1- G& j' F9 P+ S* k0 `
    end) D+ F* D8 Y2 U  ]* }
end
* L8 c7 A7 l* f/ M! @# h( u. z/ c, m( [2 G
begin P_pick2 arriving0 R( N6 E; x6 G5 m
    set A_i to 11
1 e3 H6 h% P/ h: U! I9 E  ?$ I    move into Q_induct2
- W1 t- H* o- z4 J  m, `7 ]    move into pickaisle.induct2$ H% y2 D; m8 D
    while A_i<=30 do begin
% G- ]5 W$ {* Z9 Q! m        travel to pickaisle.con(A_i)
$ |5 K/ g8 s+ t- G' ~3 u0 f' n4 ^# f7 E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& g2 y$ f. v/ V6 [: j  @0 s
        else wait for 10 sec4 j$ Z) w( m6 t& E; C1 ]. f7 x
        if A_i=A_leave then send to die6 F6 w% N; ^% |3 ~: I; Z& Q
        else inc A_i by 1
1 `: M( q/ \: i; f$ `    end) a$ W' T+ E/ J: V. w$ a8 I
end# m; r+ B& d1 C4 S+ J# i, ^
1 Y8 u* I$ p- b; W: i  _) N: X6 a5 I
begin P_pick3 arriving
9 V1 F& I8 L0 Y( a& W    set A_i to 21" \7 X% ^$ D% I: `  K; I" U; q
    move into Q_induct3
: p7 b; ~& k; j# ~1 _  G    move into pickaisle.induct3- Z  E* l+ f* \0 g. B1 u
    while A_i<=30 do begin4 x* u$ u0 a# f9 ^$ L: Y! z( L9 \
        travel to pickaisle.con(A_i). B5 u4 O+ P# b" Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 ?& H! F3 [% }! k4 Y# Q5 B        else wait for 10 sec
5 J5 t6 g; s( Y8 W7 l+ J1 N        if A_i=A_leave then send to die2 J, K( H, B( J, C
        else inc A_i by 1
, A9 V! }, }& l) B5 y+ x' ]    end2 @$ k# B# q2 Q
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是个什么东东?# K+ v3 F% n% u0 w9 N- r2 _
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  s# Y& v. [+ o
/ M0 B  y* g9 z
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* z# T/ [  G+ n* a# ?3 Z& O& B0 ?5 n1 K0 [1 U( K
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 J+ r" E# u' z) p1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' B6 E7 Z. Z1 P4 H9 o2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 u, D6 o4 \% @3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' ?2 V3 ^3 Y; a! d
begin P_induction arriving2 Q* l3 B2 w  P: [8 W. U1 |
    clone 1 load to P_pick(A_induct)# f% f  d' |* n& @% }
end最大的系
+ F2 ]/ h2 M, }& |- s3 {
1 U/ L: q4 b; ~% R4 Z. ?6 Ybegin P_pick arriving1 x; l8 W& @3 G& j" ~  V
    set A_i to procindex * 10 + 1
( i5 u3 [: V0 C' j" F2 y  D    move into Q_induct(procindex)/ o' e+ C/ q4 H/ `. [) e, L2 w3 ?
    move into pickaisle.induct(procindex)' ?! a" {) {; c: v
    /*check the type of pickaisle.induct(i), for your last problem.*/! x. _7 n* r2 n( T6 z, _0 r- [" {

2 w, j! q" e' Z" D; P    while A_i<=30 do begin
" ^# H. P5 H; i2 N$ X        travel to pickaisle.con(A_i)
( c- P$ o3 h2 v  Y- Z. |* S% N* F' b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! x( }7 i1 L% l1 f3 l6 ~& w/ [2 ?; P        else wait for 10 sec' Q9 ^9 H  R) W, ?4 k: \* Z
        if A_i=A_leave then send to die5 M6 _3 \% I, ~! \% `2 z3 P
        else inc A_i by 1
. N' c5 U* X) v' L5 G    end% q1 H/ t+ H/ ]8 A
end% f& Q9 E1 W. m2 P! ~

* a  Z7 d% _! A3 \2 C: s4 S" K其中的procindex为整形,代表当前process的序号。5 Q' g& ]" _1 w- S; `
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-20 21:19 , Processed in 6.705049 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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