设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6343|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. u$ `* y% D) Z
- |+ T. c( Z" \% D0 e我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 ^% j. B1 x* y, |; V

' x/ p/ O: @) T& Mbegin P_read arriving
; ^/ k' q2 Y9 N+ N5 K- B    while 1=1 do begin
- q5 X; l& d! a5 |        read A_tote from "data.txt" with delimiter "\n"- i0 E$ e1 l* k" ~
        read A_time from "data.txt" with delimiter "\n"+ P8 u: j" Y- E. j$ G
        read A_leave from "data.txt" with delimiter "\n"
4 Q; X3 p& l1 n' _- l+ @4 G) Q        read A_picks from "data.txt" with delimiter "\n"4 h5 O) h, S& ^6 ?- d& c" i; Y
        set load type to A_tote
- G" T) Q: r( b- B        if A_tote="tote 1" then set A_induct to 1
/ K, [! ?* d* v4 O        else if A_tote="tote 2" then set A_induct to 2
9 r- @1 b/ ?" w1 [1 k& z            else set A_induct to 3    ) r- z4 K( d- z) |8 d
        set A_i to 07 i- e" _" j. W1 c
        clone 1 load to P_induction
- ~& S8 o- l" m$ `        wait for A_time sec! a0 X7 F; t$ X, E: e% `4 z
    end
6 `% o8 U4 x# [0 d( t- pend7 b7 `& K, v+ E' d! m1 ?

4 {; z% \2 o- Z! z; l' X" E6 gbegin P_induction arriving; U* g* g& W7 b! \) R! D8 d) q& G
    if A_induct=1 then clone 1 load to P_pick1& i2 h$ Q; q$ E' W, Z: I8 `
    else if A_induct=2 then clone 1 load to P_pick2) C: D/ t* R2 t4 d, K
        else clone 1 load to P_pick3! |& V" v  {8 k
end
( S) H- t6 N  A- x) `% v
2 ^" R# o9 L8 I% a+ I  Z8 }0 ubegin P_pick1 arriving
; P. N; q& K0 l, D1 C2 E- |  ~6 b4 |* d    set A_i to 1
* s4 _- M& c8 C- B    move into Q_induct1
  `: N8 [% F& Z. m    move into pickaisle.induct1$ o9 k) l% c  L# s, i
    while A_i<=30 do begin# }' K: R* y. q4 g
        travel to pickaisle.con(A_i)
8 t/ b4 }. d: u* o( w/ ^: D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# F7 M0 ?3 c7 W  Z' W( E3 D
        else wait for 10 sec
; s) S5 H- ^7 R' H1 h        if A_i=A_leave then send to die
- I# ~3 u  k: t; U8 F1 L        else inc A_i by 1
: t" s+ C8 Q; }7 |/ X- U8 {5 x$ G    end
0 Y6 x2 G7 O+ k, X2 _3 oend5 V, f. ?# f$ m9 S2 e

0 y4 T" F/ O5 R( L( M% L0 [begin P_pick2 arriving
8 x/ ~9 f  S% q6 G& a; y    set A_i to 11
. i) X4 g  q! u  M    move into Q_induct2
4 y4 ^, O8 E" R( B; B$ Q( D# `    move into pickaisle.induct2' J2 J9 H+ N% U  d5 ^1 ~9 V4 C3 d! [
    while A_i<=30 do begin
7 D" A1 Q, D& K" `/ x, G  |" ~- {        travel to pickaisle.con(A_i)4 {% \6 r" V. H- S3 v% w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) O5 V. l" F4 m3 n3 U8 O        else wait for 10 sec
$ A2 W  }* M* N+ G3 |        if A_i=A_leave then send to die
7 B# ~# o8 Z+ R( d* e6 U3 F9 ^; o        else inc A_i by 15 p* `$ Q" p2 b2 j+ Q& x& U
    end. z, |6 w" s! }9 r3 _* j+ a# \% h
end
1 v0 K8 J* n- w6 `' d  p2 y& e6 x7 N9 ?2 \$ N4 p) G3 S
begin P_pick3 arriving7 ^4 _: D& E* n9 I2 ^
    set A_i to 21; f% n/ A0 u. E6 ~, s
    move into Q_induct35 R# z) G( v  ^& b$ s
    move into pickaisle.induct30 n3 O* I, D! W% }
    while A_i<=30 do begin
7 R+ U1 {, z* t        travel to pickaisle.con(A_i)* [2 N+ B6 A* @; M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 R& N. |+ @- u8 L        else wait for 10 sec
! H5 B" U' x2 ^) }, K        if A_i=A_leave then send to die
5 ]4 S" b4 a5 F6 M+ y6 ~% e        else inc A_i by 11 P2 g9 _7 c9 e! h9 J% y
    end  z& l; R1 h6 u' b
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是个什么东东?
. B' j& Q- A: A+ l3 ^' X4 N1 t& pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! u: G: Q: I  s5 c# q5 w* k
$ U; g  F  X' b, l/ R2 f" C1 kAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* M+ C5 l5 w+ l; W' x+ a8 w
, M6 C- X& [4 w% Q/ c1 i另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:( ?8 K2 X3 W1 Y9 a; U3 m- ?
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! n* M" ~, }' u; j# z: s2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 |9 T6 m5 T" V  B# A/ G) B
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  m; M6 `9 {: T9 sbegin P_induction arriving
/ A% [7 f: s. f8 V    clone 1 load to P_pick(A_induct)5 r+ c# ~# n2 M; ~0 m
end最大的系
4 D2 x$ p, r  s0 t  p( E$ ~; V! I$ M/ t, [3 N5 C4 q
begin P_pick arriving
+ {; O$ n, S# q2 d    set A_i to procindex * 10 + 1
+ B; I' E0 z( Z+ t- N. A    move into Q_induct(procindex)
2 x4 T/ X* ^  ]9 R  v    move into pickaisle.induct(procindex)
5 L- f/ ?5 ]/ b2 R+ o% I' Z' _    /*check the type of pickaisle.induct(i), for your last problem.*/
9 D9 x+ f8 }5 ~- B- |8 B+ A) @/ u
    while A_i<=30 do begin
  W: e/ J5 D' J( O* v        travel to pickaisle.con(A_i)
2 Y$ Y  I8 O$ a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) u* E( R& W/ o* h& k5 u1 A* q1 P        else wait for 10 sec
% d# Z& X2 x: t% }3 v1 U  ]        if A_i=A_leave then send to die# Z/ ]) |7 h2 _+ E8 ~9 i2 a
        else inc A_i by 1* R9 C& Z; e9 W7 `- {' U, p
    end
( Y: K. ?% [& ^# o4 V) @) Y$ rend' t0 E+ W, T1 t- C4 K' t
) h" y! S, |8 p0 \. i' u
其中的procindex为整形,代表当前process的序号。
" r& h1 T; k+ `+ g" s9 C2 Y4 |# tstation和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, 2024-5-12 15:51 , Processed in 0.012252 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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