设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12333|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 X( x6 o3 F( }: K$ t
, c7 W+ ^+ P1 [  r我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ c. a; [, ~' z2 Z
2 ]6 i+ e& Y* j2 g" ^
begin P_read arriving
6 q) I! B0 j" O5 H. D6 O4 |    while 1=1 do begin' n, U& W- k$ V8 d- Q, ]
        read A_tote from "data.txt" with delimiter "\n"
, N9 ?0 i: G" d6 R. R        read A_time from "data.txt" with delimiter "\n"5 i) @1 M  O0 L1 a; @
        read A_leave from "data.txt" with delimiter "\n"6 N: T! W3 ?1 L2 t3 q- |
        read A_picks from "data.txt" with delimiter "\n"
: m7 T8 W$ d9 g- \: h/ K0 }        set load type to A_tote
+ ?; i+ J( f$ e( O        if A_tote="tote 1" then set A_induct to 1) |' ]* D& Q0 b& h
        else if A_tote="tote 2" then set A_induct to 2
' @' D) v5 K- F1 s5 K# ]; B            else set A_induct to 3   
+ ?) C( }& o, D$ s' T4 i        set A_i to 08 L* ]9 N' Q( C7 n8 W
        clone 1 load to P_induction( g. C' d( q" D/ ~% @. j
        wait for A_time sec. \+ z6 m' W  Y8 ?
    end. t+ S. W2 q# r6 ?; Y
end
3 L& s/ g% @" M& k( J5 H& i( D- m% o' T% C- R) Q# c
begin P_induction arriving: h/ H# F1 q4 c! s8 s
    if A_induct=1 then clone 1 load to P_pick1$ A( E& \7 v3 x
    else if A_induct=2 then clone 1 load to P_pick2  C8 ^; n4 q7 V3 Q- ]7 ]
        else clone 1 load to P_pick3
3 t  K1 q) {5 I+ Z% d* \end
; I0 p$ F( B. i: H. ^" h6 d4 M$ b9 T
begin P_pick1 arriving) [$ M. O2 Y& M  ^4 c
    set A_i to 1
2 \% D4 x& V) X2 F    move into Q_induct1) D8 \7 r) h/ K
    move into pickaisle.induct1- C* {" H9 q3 |6 r  g: ?1 \
    while A_i<=30 do begin) H# t1 K8 W: ^, S
        travel to pickaisle.con(A_i)
" D, Y6 s$ _( L6 l, h3 }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  f  N; h! }3 Z7 z! d8 W% ?- w
        else wait for 10 sec
4 Y1 }* G7 Q/ |2 g        if A_i=A_leave then send to die, |0 }/ K' x& `$ X/ A/ r4 p' T
        else inc A_i by 1- |0 D2 O4 F) M* J) o7 f- O- _
    end5 U- T' c: [7 n6 ^
end
" \1 m6 G# t& X( D, X& \: h; B4 \! o' i7 v: c& Y/ [( a
begin P_pick2 arriving
- ]% [* @  ?! [    set A_i to 11( b4 S. q" d) J! o' l
    move into Q_induct2# B3 {# G1 d% ?: S
    move into pickaisle.induct2
- X. J- ], N! v' y    while A_i<=30 do begin
1 ?0 d+ J; Q% b4 q1 s  c- C0 b        travel to pickaisle.con(A_i)7 @( p0 J* T2 G- M' b3 I& {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# M) W* ?6 }8 Y# H" K        else wait for 10 sec1 O4 f5 ^, E0 n2 ]* g
        if A_i=A_leave then send to die8 D( u) G7 _6 A/ a8 ]. C4 E$ b- X
        else inc A_i by 1
3 \1 l; |. ~" s1 C8 W; v    end5 p7 }; g7 f% \; j
end7 H# {: U+ U* T
' X8 v$ v4 s- t/ h7 I
begin P_pick3 arriving
' E- h, ?% Z" B* e8 P    set A_i to 21  @$ i/ D9 f" l  p
    move into Q_induct3
6 |! ?% m2 I! _7 o1 F    move into pickaisle.induct3! T. L* K. {2 x( ?4 }
    while A_i<=30 do begin
% y: W% ?( c% s( H' L# w$ s        travel to pickaisle.con(A_i)
' W; v( @( o! V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ R* _* ~. z0 A" _        else wait for 10 sec
. D  E7 l: Y0 O, B; |! U        if A_i=A_leave then send to die
2 V% G7 @8 U; Y$ G& m: \/ \        else inc A_i by 1
6 o7 X$ E# l- q7 M0 o    end
, j8 p# k8 C2 ~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是个什么东东?3 a4 l" [2 }# o
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" a* a' v$ M' q7 U1 W! l0 m' F2 ^- \+ M6 t% E: A
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" L5 U9 ]+ T, g, ?0 s5 T+ ^
. V0 i3 ]% p2 ~. V% T
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 l  a& S  f% L; c8 T% D& L
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  f1 {! [7 H3 B! V2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) V7 H; n) K' S* P0 c, W' Y3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" f- \2 i9 R8 @3 Y3 f- P+ Zbegin P_induction arriving  l6 j5 P6 I" l. m5 k! Z
    clone 1 load to P_pick(A_induct)0 S& `1 ]& |/ F/ N8 ?
end最大的系- q, b- q' R4 }7 [# `+ \

7 D' Y# A5 u  m+ D' X# J2 Xbegin P_pick arriving) W- `5 W- X1 @/ s6 o
    set A_i to procindex * 10 + 1& b& J! E- O+ ^' `
    move into Q_induct(procindex); m% J5 u! e1 P" y* z
    move into pickaisle.induct(procindex)
: G% `4 ?0 b0 U+ K% d" |    /*check the type of pickaisle.induct(i), for your last problem.*/4 A/ w+ y. O: D. n2 w) Y
( _9 t- u: r  f. X8 e4 K
    while A_i<=30 do begin; f+ y2 X: T; D3 q. a! F
        travel to pickaisle.con(A_i)4 |. c3 J2 O8 m# z6 P" R* S( _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ w/ ^2 b* y7 ~7 H" b        else wait for 10 sec6 i" T. b! A9 U1 ?. P1 r
        if A_i=A_leave then send to die
4 J& b7 g% h( }( L: _        else inc A_i by 1) i/ F$ G2 G; T5 s% t) y- E
    end
( d; P: x3 v5 o  T- ~! iend9 k0 x" U, r9 M1 ?$ e: ^
3 f  ^) q" H/ E" L: q, E
其中的procindex为整形,代表当前process的序号。
+ z3 \2 x* q) f' s; Ostation和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-1-14 18:01 , Processed in 0.427893 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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