设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13669|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! @; j" z6 ^2 {3 |) B! q0 ~' X8 n& D* j0 p: f
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 _* T8 b: n( b, H5 R. f" Q- h% X/ H6 ~6 T) v3 M0 b6 Q
begin P_read arriving
2 r' n4 Z% s/ Z    while 1=1 do begin$ L; e1 J- [  \! ~
        read A_tote from "data.txt" with delimiter "\n"
9 n+ U  g7 j) K( M2 n, B        read A_time from "data.txt" with delimiter "\n"3 H6 m' _6 [5 V* Q
        read A_leave from "data.txt" with delimiter "\n"" z6 Y9 ~' ]( [' N& w% l
        read A_picks from "data.txt" with delimiter "\n"
4 _5 F7 b- o$ f        set load type to A_tote* _$ b' b" p4 P4 G
        if A_tote="tote 1" then set A_induct to 1
$ G! X+ _3 x- w, m' {7 g9 z  \        else if A_tote="tote 2" then set A_induct to 27 V! o. m5 \* L) R7 l  ?
            else set A_induct to 3    & v8 r  g3 Y8 v5 \- i% C7 o& a4 n
        set A_i to 0
  x9 N& {7 O+ k* c3 Q2 a        clone 1 load to P_induction% M" ~6 j  t2 a  H5 S$ p
        wait for A_time sec
6 ~' H$ P' e  _; O' e/ G+ `8 }    end
( ^/ V, I- O) Y, Gend( P6 q% R+ h& ?+ _
0 x' n5 I/ z* e5 q
begin P_induction arriving
6 R0 @  _3 v3 ?9 C) ]# z+ E9 Y    if A_induct=1 then clone 1 load to P_pick1( U4 t5 ?, @; [' y
    else if A_induct=2 then clone 1 load to P_pick21 A9 W/ a6 Z+ l  y
        else clone 1 load to P_pick3
- g$ s" A- O% U! V& m0 k7 Kend( |! H7 s) O# l, g. [4 _
: R& I$ h6 G# u- ~9 c/ Y
begin P_pick1 arriving* o. d  a8 B8 N8 B: h4 H1 a
    set A_i to 1
- Z" j& m/ p1 y' q    move into Q_induct1( X! N0 N$ A( |% a
    move into pickaisle.induct1
6 s$ B2 e0 p2 n% l' I6 r+ t    while A_i<=30 do begin' s. l# l' M1 e9 e/ Z
        travel to pickaisle.con(A_i)
3 B# l) M. F* Q2 h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" S5 m' W- P' V9 Y( _! x( ?
        else wait for 10 sec, a" O0 F: g! o* b. o/ o4 ?* y% R
        if A_i=A_leave then send to die1 O6 s0 |7 T3 r* b6 C2 I
        else inc A_i by 18 T& L- q( H4 f: f4 g# w
    end
) l0 B) j: v: F, b8 n3 k* cend/ g' U' G. h3 y
7 i% u6 a# u, M9 t  [! `
begin P_pick2 arriving
8 c( W4 p5 D' x: d0 I) G( U    set A_i to 117 \; P  a- |( P' s/ c
    move into Q_induct2; u4 ?* O4 F0 X" _% i, H
    move into pickaisle.induct2  V" W: P( d9 |  n$ M& j
    while A_i<=30 do begin8 w' q, R& U1 G. W, R6 n
        travel to pickaisle.con(A_i)+ E, ^& s! a2 Y- i4 O0 K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 t3 O9 f: {& s, Y, e7 ?        else wait for 10 sec) y& q1 \- ~1 l2 {% u0 o
        if A_i=A_leave then send to die
  L. d) u, ]2 ]8 ]' H* k& s        else inc A_i by 1
! C9 k* e, v- V) t8 i8 h1 a    end
# P  N: ?4 K/ o+ f9 v' d( V+ |end
( H- Y( A  f9 m* W" t
7 G/ [* {" u4 I- a, tbegin P_pick3 arriving
/ `/ Y$ }+ S$ K' o. z    set A_i to 210 [7 s  ~0 U5 H$ x
    move into Q_induct3
* U/ t. A+ P( U( b( ?( n- ~7 T    move into pickaisle.induct3
) R$ i' d) z' G/ i    while A_i<=30 do begin
3 m$ ^' T7 Y1 G  r% u        travel to pickaisle.con(A_i). j1 `7 d2 h' I; x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 U) T7 ?1 n1 u# i  R' O/ t, B8 P6 ?
        else wait for 10 sec( T' u, ?0 w' [/ ?/ J* s9 J' X
        if A_i=A_leave then send to die( b+ D1 r) y4 C! `4 x4 [+ L5 p
        else inc A_i by 1
' V# J$ ^* X& T$ E. V    end6 r+ s# z) h( g, Y: \- c
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是个什么东东?; U9 u( l# i. w4 h0 T/ d
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?8 y& Q1 w0 {) B& c; F" O. C/ `) L

6 {( ?8 A0 P, U: {$ P/ L% {# kAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 J  C5 k$ `. _* E9 t% i
8 S- g8 ?4 O0 z4 G) f* W另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ P& I! [# b( q/ ?3 U' i' Y) `1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 R6 n9 U- X7 z" z/ H2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 ^+ \+ g. N; }+ Q" `/ }$ K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ P' o* ?- T- d5 d1 X
begin P_induction arriving9 F; H1 f( [: t* U
    clone 1 load to P_pick(A_induct)
- P, Y! i) J% E# n( c$ w8 iend最大的系; D! N9 C$ {1 y! ^- m0 N3 |

* h) v9 D9 @/ {+ \$ a  I9 dbegin P_pick arriving
; ]7 j. ]0 m5 I% b' ?    set A_i to procindex * 10 + 1# Y7 ~" {0 S1 z6 l* X
    move into Q_induct(procindex)- Z6 B+ t, F( u% r
    move into pickaisle.induct(procindex). }" h9 |) J/ h( g
    /*check the type of pickaisle.induct(i), for your last problem.*/4 @: t+ V& R& R" g. u
! W! E+ z- r) o" ~" t& v+ y
    while A_i<=30 do begin
- j" [  f7 f9 p7 o% }% C: R0 f        travel to pickaisle.con(A_i)9 B9 u- i+ U1 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. Q5 c  i1 J3 o6 B        else wait for 10 sec
9 A8 |- b4 b6 |3 ]. @' j' y8 ?        if A_i=A_leave then send to die4 r: W; A8 {0 t! P8 B' I0 C
        else inc A_i by 1, l0 \9 W/ }. x) B
    end4 I- Z2 e* Z  d
end
2 T" ^# p# Y$ f8 Q0 B3 Q6 o- S, w9 ~% [9 J
其中的procindex为整形,代表当前process的序号。
, w  P/ t: `' {/ w6 S& B4 [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-4-27 20:17 , Processed in 0.015371 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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