设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12439|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 P; U( D0 m5 t; b! O$ _) |: |$ i: ^; R: n3 i
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ e8 l; R# p. q7 w( }/ T. s) T  n- T. P: K2 C7 c: j
begin P_read arriving" t, {" V/ Z4 d3 T) }
    while 1=1 do begin! Z5 C7 R8 ~% t& D8 Q9 {9 u
        read A_tote from "data.txt" with delimiter "\n"
( P  D3 R; e9 r+ O        read A_time from "data.txt" with delimiter "\n"7 ?7 X/ x/ q7 a% u& w% }
        read A_leave from "data.txt" with delimiter "\n"
- j( c2 r) J# d* ]* t2 W9 p, f        read A_picks from "data.txt" with delimiter "\n"+ W4 l( n: l# w! i
        set load type to A_tote6 \6 k: z9 C. Z& u8 j
        if A_tote="tote 1" then set A_induct to 1" O- E, v1 L. w5 Z
        else if A_tote="tote 2" then set A_induct to 24 @% l7 `$ x+ Y1 `
            else set A_induct to 3    * s/ j! j2 c  x2 \+ F
        set A_i to 0; o3 w5 B2 m0 x! H$ g7 P$ k& f
        clone 1 load to P_induction
0 \, O  p# Q: k! x& B! X( k) D        wait for A_time sec
& Z* Y  M% l0 C+ e    end
( b# u. Y- q4 ?/ rend
0 L5 k0 F' t( P) z* [/ F) B; W8 l) j% S
begin P_induction arriving
6 G: h: m. V; n    if A_induct=1 then clone 1 load to P_pick1
7 T' k$ i: g0 g  t; x    else if A_induct=2 then clone 1 load to P_pick26 o! t" G$ @" f/ K5 I
        else clone 1 load to P_pick3
# t0 ]9 i: f, B; n0 L% wend' o8 a: [9 a4 U

: J6 b' z9 g0 h9 s" l* Y0 |4 {+ Lbegin P_pick1 arriving
1 S6 K" k) ?3 q+ s) C( }' A( j    set A_i to 1$ `8 A+ P! G! \& W5 j/ x
    move into Q_induct1
0 a* B: M. u1 k4 ~4 n" W4 K9 M    move into pickaisle.induct1) i+ t; f: C# v
    while A_i<=30 do begin: d, b" o: |! _" J$ u  X5 s8 R' J
        travel to pickaisle.con(A_i)
% {: W- c. R+ x- c( Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 }* B2 B9 P2 _8 M7 g3 `+ o
        else wait for 10 sec
6 S1 h; Y. }8 c1 h        if A_i=A_leave then send to die
- t8 \" ~" t! k( n4 s7 j6 x: K7 @        else inc A_i by 1) y; a/ h% z5 I) ~6 v# v, H; W/ j' T
    end
& T& r) \' B9 b3 y) Gend
" d: @7 W$ T' G7 T' G8 {+ n2 o" ?; ^3 x/ h6 {' w- p
begin P_pick2 arriving' b9 f7 l6 A$ T" w
    set A_i to 11) X- _, I2 z. t
    move into Q_induct22 J5 G+ \, U' K& F' D
    move into pickaisle.induct2
# d( M6 ?  H9 |    while A_i<=30 do begin
' r  i8 }' j& Y        travel to pickaisle.con(A_i)
* u' V! [8 G9 ~& W6 K9 O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 q  S$ R( ?" ^& ?0 ~        else wait for 10 sec4 ~0 l' \8 I7 N/ D$ E; T
        if A_i=A_leave then send to die
+ N2 t, L3 p* r+ Z        else inc A_i by 1
2 S- T7 q0 G0 P) s# ~# L- b    end
0 U5 K$ t: T% {5 k. [0 Tend7 E8 [. ^2 y& R) _3 O5 z
- p1 E6 A9 Z+ a! U/ }( _
begin P_pick3 arriving
* u0 k+ ?+ e) O/ f# E# y    set A_i to 21; k. [  |/ \, @: t( A* l# X* p
    move into Q_induct3: n2 o* j9 V; d* z) n% K& H, S
    move into pickaisle.induct3
( Z8 [2 G& W7 t% _  L- J5 [" p    while A_i<=30 do begin
2 h$ {1 T+ W+ p1 m/ b        travel to pickaisle.con(A_i)& C7 y! U, y! P6 l# S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ Y- n" N# R: F
        else wait for 10 sec. `! d" V/ M) {: y% W5 f
        if A_i=A_leave then send to die6 ^) o' R; s1 V: m
        else inc A_i by 1
  @$ @5 H- C. d, E/ l. k. H    end
- n$ K, V) e/ K( j7 a1 Dend

最佳答案

查看完整内容

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是个什么东东?
- g& Q% V3 y% ^. B# Qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  t  Q5 n* W% ]! x3 k1 s! R1 |
/ \" Y3 [/ N2 D
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- ]3 ]- I9 f6 E9 v3 o3 ^3 Y6 f
1 l- w4 ^  I5 ]6 ]' s! k; K8 g+ f. }
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  m" J4 i# i4 k( O1 G4 @5 q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% t6 Z! @- P( q/ \2 [( i8 c1 U
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ p& p  F2 K1 m- ?# H8 V+ [
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 Q; Z7 b9 z. X2 Obegin P_induction arriving% \1 n" I" g' O* E1 g( M5 t
    clone 1 load to P_pick(A_induct)
- g* [- a' j. F5 ?) o! r( rend最大的系
. n) Q& ^& U9 N
4 W: @! }: k$ f" w$ m$ ^begin P_pick arriving! ]3 k7 |  @" |# i5 `& C" C  g! T
    set A_i to procindex * 10 + 1
+ @+ ~" f' |4 Z" [/ d( Y    move into Q_induct(procindex)4 R5 S0 K: d( M; B4 T) T  \& s
    move into pickaisle.induct(procindex)9 x4 p5 k: G! ^* D2 V7 _. S
    /*check the type of pickaisle.induct(i), for your last problem.*/# ~+ v  l( u+ {/ F$ y' }$ Q

  R: Y' l2 _5 u$ g3 ]0 w  z& y    while A_i<=30 do begin
3 ~( f/ ~- g; g4 @        travel to pickaisle.con(A_i), I! |3 S" ]! F8 M8 o( d, T3 m  Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; ?" O: o" B9 \5 G+ B  B        else wait for 10 sec
$ O3 y, ?8 k9 s" n, a- L        if A_i=A_leave then send to die
( V. Z" D1 {' J' g" W, V: q  o' E        else inc A_i by 12 L3 s  {  x# ~9 E- D" e' u
    end5 Q+ I6 _* l( x; o5 j2 e
end4 d' p, @7 \  q( L1 P9 o) f* O2 Y
# e8 u: g1 F  z+ j
其中的procindex为整形,代表当前process的序号。
9 }, C8 ]# {- Y: M' Zstation和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-23 17:23 , Processed in 0.021277 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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