设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13171|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ W: Z4 U, X/ J7 t; W& @  i$ A& `% N% |/ @7 M9 o: D, [
我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ V6 L+ S  }! S& P0 S2 B

) v7 m5 c5 z$ i2 u9 L9 n. Ibegin P_read arriving
* w" C3 h* ^' u$ W1 V. g    while 1=1 do begin
. \2 M+ q6 t% Q( A% i" l5 e        read A_tote from "data.txt" with delimiter "\n"
: I$ h) w" M- L5 k        read A_time from "data.txt" with delimiter "\n"
: N6 Y& T. ^# B        read A_leave from "data.txt" with delimiter "\n"" {! K8 O; T/ i
        read A_picks from "data.txt" with delimiter "\n"
5 h% C/ K# u# ?0 c4 X! q        set load type to A_tote
# y2 M  T) v5 w- z        if A_tote="tote 1" then set A_induct to 1
& v/ w3 q& \+ m# k5 s7 [& ?  o9 ~+ e        else if A_tote="tote 2" then set A_induct to 2
" @' v) F" h: K# t, q( d+ ]' q            else set A_induct to 3    % ]4 v1 i7 H" i9 D7 w$ M4 _
        set A_i to 06 z3 }: Q. Q/ D7 }& v
        clone 1 load to P_induction
4 \  n; h- B$ z+ x: M% X2 ?! u. N        wait for A_time sec. E6 t4 K* }0 \0 S! _- r
    end! }" ?% U$ s  w
end
0 t- S& ]- e; W  p0 \
+ G# h; Z7 Q/ w# x9 wbegin P_induction arriving5 R0 F  C/ ]( H4 x, N5 w7 s" ~; A) }
    if A_induct=1 then clone 1 load to P_pick1* X0 z3 l% b/ \
    else if A_induct=2 then clone 1 load to P_pick29 `# Q( x. w2 A5 S
        else clone 1 load to P_pick3
' }, z7 Y6 G7 J# O: w/ s! X3 Kend3 K; [% _4 b2 k/ m
& d4 H- f: W" Y( c) }: ^
begin P_pick1 arriving
3 ]! h5 p6 v# H5 b    set A_i to 1
3 p; ^' j& C6 ^# k. e; b    move into Q_induct1
" g) R" Z2 w8 k: t    move into pickaisle.induct1  W7 w5 P4 K4 q% v* u: t# J
    while A_i<=30 do begin
! H# {8 M2 R7 N2 M  t        travel to pickaisle.con(A_i)
* ~" t  f  J: w9 c1 y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 {$ c) w* C6 R' f1 ]' [2 D0 t# q        else wait for 10 sec
0 ^/ M! x' ]$ G, B        if A_i=A_leave then send to die( T& P' \$ n& |( D
        else inc A_i by 1% F; i$ B& }% y- D$ [1 Q8 i
    end
' \/ _$ t, |2 ?6 p! f6 }end: p+ y0 N1 a" A/ i5 j
7 o- m+ Z5 l% w
begin P_pick2 arriving
4 y* h0 K8 d) r6 T+ |    set A_i to 11
2 l$ U' H6 J6 @$ u    move into Q_induct2# J& ?4 @1 R5 C: m8 m2 `2 L
    move into pickaisle.induct2
* F8 a6 W2 y0 ^- E- ^$ a( B    while A_i<=30 do begin4 u2 m0 y. P# [' P6 D2 ?
        travel to pickaisle.con(A_i)" |# j  Z  L) S6 V9 o/ A- }5 z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 @! {8 T4 G7 P5 y
        else wait for 10 sec
* _) }5 f+ ?! K3 v8 e7 l) D        if A_i=A_leave then send to die1 Y. x, ?; k' y3 P2 O
        else inc A_i by 1
' \1 k5 V4 P8 R6 }7 z: i+ ^    end9 v3 ]; j5 z0 @
end9 x9 @) _+ z9 V) ]5 t$ ^" C' W/ {
' t4 n, m( c5 }4 P0 ?8 g; l  P
begin P_pick3 arriving
" q, t6 x: r; X* K# ^: v    set A_i to 21
0 S4 S4 Y; Z& A! z    move into Q_induct3' E) F5 k* Y( x/ E
    move into pickaisle.induct3
' a3 A5 r7 i' {* C( I0 g    while A_i<=30 do begin) R% h/ Q/ R4 x* O$ o' {  f
        travel to pickaisle.con(A_i)6 F& ?% z& A: y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' w7 }+ }  B4 _
        else wait for 10 sec" S. V% X$ T+ s9 ]
        if A_i=A_leave then send to die
' P! P& y5 S& V        else inc A_i by 1. @* }/ B5 [  h. L5 @: ]  d3 x
    end
$ w: f( d6 g$ s# v0 lend

最佳答案

查看完整内容

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是个什么东东?/ N+ ?- s9 ~. j: ]! ^
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 \) x5 y; Y% Y& z% w# `% k
9 s$ O: u7 Z( Z& b6 \
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& B# t! P- o1 \

, ^! \& L) r' c6 K另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" j3 E, S- f5 M
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. w' V9 }3 p2 Z1 v' _- h; x
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 M% z) s6 J; b3 b& m6 d% p! z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. k/ |# R1 T  A& Ybegin P_induction arriving) ?9 L$ Y* j  x' n% e8 Q' W- E" `
    clone 1 load to P_pick(A_induct)) B& |4 D. V$ E6 ~0 A) F9 w# n3 N
end最大的系+ s% a' \9 X9 Q& Q- d
& Z( }2 k, L8 Z5 K7 Q0 I( [
begin P_pick arriving
" o& `3 E: K  |4 {) |    set A_i to procindex * 10 + 1( U+ V4 R  b: J9 [/ U
    move into Q_induct(procindex)
4 ~# k6 D; p0 n+ D! K  d    move into pickaisle.induct(procindex)' F/ M# j9 `- R  o7 g
    /*check the type of pickaisle.induct(i), for your last problem.*/; S8 s; }4 b. m. ~
( l6 M6 ?' R0 C! o$ E& i; x/ K3 Y
    while A_i<=30 do begin
* ^' J' g4 H  G+ S' _$ Z+ o        travel to pickaisle.con(A_i)
  G: `1 s* t; q/ m# T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, W0 d  n7 b1 j        else wait for 10 sec0 ~4 E) _, u/ p- @. ^% u
        if A_i=A_leave then send to die
/ y5 c- B% a7 w7 [$ ^        else inc A_i by 1
) f# O8 r& ?0 _5 K9 ?& p    end
; N# C, L" i1 m4 O: ]5 Hend% t" O; `( G# e# q

3 ^/ a$ \; f3 N0 h3 Q5 F其中的procindex为整形,代表当前process的序号。+ m- r/ l1 @5 [2 j! q( t
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-3-23 23:36 , Processed in 0.018147 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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