设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13100|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- \. K5 `' ^2 h! V$ K0 X
7 ~, W8 e# x5 l+ q" X% _4 R$ U我的问题是,在每个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中的数值,不知道会不会有什么不妥。. o% Y3 Z4 P1 m! e9 a3 b" H
8 e9 V$ s" c% \, d
begin P_read arriving
% q/ a% J% e' I& o  O! J    while 1=1 do begin
5 t& j+ I' S' M' d  u        read A_tote from "data.txt" with delimiter "\n"2 T( p7 ]! M. K9 H/ g
        read A_time from "data.txt" with delimiter "\n"3 T# K% ~/ K* N3 ^) @( P
        read A_leave from "data.txt" with delimiter "\n"
  o& p+ I. ^( F$ N        read A_picks from "data.txt" with delimiter "\n"
& ?, d0 i! @2 R( U9 e. T% g        set load type to A_tote, p. E6 N4 u5 U4 I8 ~5 b
        if A_tote="tote 1" then set A_induct to 1
& i" v; F  t6 J1 z: d3 P        else if A_tote="tote 2" then set A_induct to 24 ^. V/ p1 |$ l# @( Z  o/ I1 i4 a
            else set A_induct to 3    # B- a% f# ]9 u6 T2 j
        set A_i to 0
. s  `( G# e$ d  m* Z0 l3 [  ^* |        clone 1 load to P_induction8 S, s) {9 p6 L" v& E$ X5 u, e
        wait for A_time sec
7 d7 |2 {. A& T% L    end# B9 T- N9 g% _- G! s
end
, W( Y# q1 ^: q# o( D% |
! z, ^/ V! x1 [7 N- k- a) K( R( Ybegin P_induction arriving0 q: D4 y& e' V/ h4 u( \% q( U
    if A_induct=1 then clone 1 load to P_pick1+ T( x7 P* ]* N, b& g( V
    else if A_induct=2 then clone 1 load to P_pick2
# k) t" D' ~, d1 K4 s: N) T5 K        else clone 1 load to P_pick3
. W9 h% L2 I/ I8 |* m9 Gend) L, R2 W' I: W, \5 {
  a! M2 {$ q/ `
begin P_pick1 arriving
+ h2 N/ Z4 O8 Q$ K6 z+ K) K* ~    set A_i to 1% o  a+ h, A% J+ Y: k
    move into Q_induct1
8 ?/ Y" h. Z  j: C0 a    move into pickaisle.induct17 Z1 k. v4 G0 _, N" s8 L9 ]4 C$ P% {
    while A_i<=30 do begin
2 z3 l2 R- C+ D        travel to pickaisle.con(A_i)
  D% j; s! w  i* a. `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- G" t* F8 ]- `' U6 j8 \( `) ?; D2 U
        else wait for 10 sec4 }% R4 D" n" V2 n2 f' V* u" f
        if A_i=A_leave then send to die: i1 @8 d" k( m$ u! x2 n
        else inc A_i by 1
0 i" z$ H. P5 k# Z" g2 [! o    end6 c/ d8 `! }- m' h5 G
end
( ^: D/ W% s' S4 i. p9 G# K. n* [4 \& |% p& v% X2 |
begin P_pick2 arriving7 w5 B: [3 f5 m6 M; [5 x  P
    set A_i to 11
0 s* c* p" ?( Y. ]    move into Q_induct2
2 J- p7 O6 S- K  R. ^$ W9 z    move into pickaisle.induct2
% g' _. \  f# o8 B" h1 c; E; Q    while A_i<=30 do begin& G4 {- K9 {& G9 q! S( W
        travel to pickaisle.con(A_i)- v: s1 k7 m* |, m, m* i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, K6 H% M# o5 ~+ L2 q2 h
        else wait for 10 sec" C- |  k' _+ s
        if A_i=A_leave then send to die. v' q7 Z6 H7 n( v7 w
        else inc A_i by 19 z- C1 n  z4 f0 [# Z7 Z) y" P; K
    end7 {8 H2 R! o, b$ s/ [  C2 u
end  H4 q+ y$ \; [2 J6 {( L+ I
4 n0 Z8 C4 H! |- h4 [& ^4 F
begin P_pick3 arriving( Q' D& W6 Y8 w" w2 c
    set A_i to 21& B# g: I& {# X+ X' W$ t' S
    move into Q_induct30 k* a8 A. m0 z
    move into pickaisle.induct3- t& S5 m$ ~$ z  X6 x" _- u( U
    while A_i<=30 do begin
! F/ |6 M/ W$ Z0 |) L- `( p% Z        travel to pickaisle.con(A_i)0 m4 i; v4 ], W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ i$ H7 P8 v- i' Y" P, ]( s
        else wait for 10 sec
0 i1 c/ p0 I, D. |- c, m- i        if A_i=A_leave then send to die- p! l# o8 A1 ~7 Q) N* |$ ~
        else inc A_i by 16 ]; J- p1 s; ~- z" z
    end
1 ^# [* Y6 J5 h% A( G% ?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是个什么东东?* o9 u8 Z6 f4 O, X
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! J- ?4 T5 {# ?% c, t! t* s+ U& c. I
; o; r) B. w1 g  G- v
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" R2 {& ]% V) q0 m# }  A# d8 v  h" c; g5 j  R5 F; o. Z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 R1 w2 F! q3 v. h1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- h# P# o8 h* B+ ]+ q  N
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' B3 J2 V$ l+ Z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% r  u+ I. x. O6 U( L6 I0 o/ b
begin P_induction arriving4 {: V  T& M4 e8 I
    clone 1 load to P_pick(A_induct)
- V* `! ~& Z7 \& R& M* {end最大的系7 q  G1 k8 e  ^$ z
7 b; ^6 b: K8 }% f$ o( S1 G* B
begin P_pick arriving
2 i! E' H) F' z( X& T    set A_i to procindex * 10 + 1) c' v/ a. t% W( }  @
    move into Q_induct(procindex)
( P; b( g. {$ h7 G+ E$ i! v    move into pickaisle.induct(procindex)
8 h- e  Z, @4 u    /*check the type of pickaisle.induct(i), for your last problem.*/# c6 `) |& y# K5 t  I7 ~# [
1 P' W6 f  b! L* I- C2 k
    while A_i<=30 do begin
" E& t* s+ ?6 a0 d        travel to pickaisle.con(A_i)( ]% f$ Y- y) Z9 d! [$ {' m. f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" C' `+ T' ^5 `! W& J2 D2 k
        else wait for 10 sec
9 l* v! s* K* `+ P! t9 U        if A_i=A_leave then send to die. ?$ ^: v# L/ g
        else inc A_i by 1
# a! u+ S1 @, H/ s    end
+ c: P" e* i6 w" C" O/ hend
: q" T, n* r" f3 a$ Y' Z5 L: o1 u3 u6 ~; n% x" U
其中的procindex为整形,代表当前process的序号。
# ?2 g3 e' H% J4 |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-18 16:57 , Processed in 0.016580 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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