设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14070|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 ?* S9 ]( X$ I, C
( x& r& C' ]) J0 q我的问题是,在每个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中的数值,不知道会不会有什么不妥。. ]8 o( F, `- @" M2 l

. A/ T* A( o; _0 X0 v' \8 \begin P_read arriving
- b( l6 i0 O  i( O% b! l. ]- W    while 1=1 do begin* J8 H6 P6 K5 ~: i* Y( i
        read A_tote from "data.txt" with delimiter "\n"7 g" @+ V- l. C  [* b6 P- X' ^) i
        read A_time from "data.txt" with delimiter "\n"
) a' c+ u2 G1 V) J1 W        read A_leave from "data.txt" with delimiter "\n"
/ J: {) X$ `! S4 \- f        read A_picks from "data.txt" with delimiter "\n"# {. t: d% ~$ D& b+ r# |
        set load type to A_tote; d/ V" T& q/ _* y3 F5 l$ r
        if A_tote="tote 1" then set A_induct to 1
# y2 p6 k9 H% v2 z3 V- N+ Q! S        else if A_tote="tote 2" then set A_induct to 2
( S) ?6 G' p/ i7 V. G# f            else set A_induct to 3    5 i$ t1 b: J, |3 A  `/ I
        set A_i to 0
( F/ [9 n3 y# x5 @9 i+ O7 \        clone 1 load to P_induction0 Y9 O/ t& a5 S1 g1 I' T5 C( J7 B
        wait for A_time sec
; @- m- l2 Q! Z" b" {    end% a* m" x5 O' b: U. {$ L7 G8 _0 c2 A
end# c9 k: S9 X. x  }/ D
) J7 ?6 C$ |& v( o1 {( |: a
begin P_induction arriving& U9 X+ Q1 ~' w; N( m! a
    if A_induct=1 then clone 1 load to P_pick1
4 i  y. @7 y' c$ @' G    else if A_induct=2 then clone 1 load to P_pick2
9 ]5 F+ }4 s+ R  _1 ^: m+ C0 j3 t        else clone 1 load to P_pick3: v# Y/ B' b4 h0 Z
end
# S0 Q1 ~- A7 o8 p
' X. @4 F! U- a+ E4 w, y3 X, Z. a( q9 M8 mbegin P_pick1 arriving3 \4 ~: h" l, a- [4 u5 j# [( l( ^
    set A_i to 1
3 M% p# v" x  b3 ~8 ^    move into Q_induct11 {7 {( B  F1 d$ T7 [9 O
    move into pickaisle.induct1
1 T' }  z2 A7 f, M    while A_i<=30 do begin
6 L5 }* E- \9 u        travel to pickaisle.con(A_i)
: c- ]# }" G- P( J7 `9 z* a1 t' I2 I4 {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! ~. Q+ D2 V, k: t+ Q2 R$ @" {3 B8 @, [        else wait for 10 sec
7 u: y; v5 ^7 j) N  Q7 T3 `; k  _        if A_i=A_leave then send to die* ]; |$ W" y+ s; B8 C. ^: r+ ^
        else inc A_i by 1; H( ~$ V7 O& |2 n( {6 I5 N; R8 |
    end; C$ _# F* }( n
end
7 z' t9 i* z3 o+ H4 c8 G, ]! l7 t+ ]& O# S6 x
begin P_pick2 arriving' i7 O3 A: o$ n+ S
    set A_i to 11' _' b7 f( b; I6 T
    move into Q_induct2# T' t$ Y+ e8 e* t
    move into pickaisle.induct2
! r6 O1 b1 F- V. p4 ^' h3 s* i    while A_i<=30 do begin1 g( {  }, n5 h2 r- _! A
        travel to pickaisle.con(A_i)
4 k  H; K- x/ `. y1 }5 n# w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; N9 V, O( \2 L' e
        else wait for 10 sec- d: A' C7 f  Q& a" M
        if A_i=A_leave then send to die
7 q% H$ U' H, m* d6 J/ V! M: k; f        else inc A_i by 1* C$ r$ i- g, w& T" N3 C5 s& U
    end
! r! W; l1 E; K! d& k& z5 |end, W8 }4 q' A, \3 {

$ L8 Q' @- i6 R& G! ~begin P_pick3 arriving- k+ ?. H# i3 @
    set A_i to 21; }7 Q3 [9 A6 Z4 [% U8 v- y+ y* X  v
    move into Q_induct3
! W, y* Y* w# _/ E, ]: A    move into pickaisle.induct3* z; D7 z* G- {& A8 ~: V
    while A_i<=30 do begin
  d1 t- m2 t+ A  g        travel to pickaisle.con(A_i)
* g" }7 k& B4 ~$ u) M. S6 }( V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 |% Q& ^; H# S  T+ S
        else wait for 10 sec% P! D- t# ?4 Q- F
        if A_i=A_leave then send to die, P! o' p" l4 f$ u( z' f% d
        else inc A_i by 18 s: ?3 H. p! O* d6 ^! J% I
    end, e* G& Q/ k0 F& B/ D
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是个什么东东?
1 X5 E1 D8 f3 s7 [move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' F% \4 a4 u$ s! I  ?" \

( D5 M3 P+ ?6 z& Q9 ]1 `  ~AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 J% Q/ j( W' }6 K0 Q. w- g  K! i
# e1 h- M2 r" i; ^9 G8 |+ X1 {, I5 Z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, C- h$ u# Q+ u1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 w) [+ _6 A- @" Z2 L
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3 T3 ?& s1 |/ ^" x3 [3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ `8 v) f4 W+ ~. }; {2 |3 @# |- `
begin P_induction arriving% R8 S/ V9 y; }: c& @( |
    clone 1 load to P_pick(A_induct)
; `- B5 K+ s) w9 e& \0 cend最大的系
4 J7 n+ [) r! J" h$ U3 u
) v- A* z+ x2 [0 b) ubegin P_pick arriving
% |! u0 T5 a; f* u3 G+ p2 Q# n    set A_i to procindex * 10 + 1
& k7 z; x8 u$ k+ Z* C$ S: q    move into Q_induct(procindex)
$ K. P' k) \1 z6 K5 w    move into pickaisle.induct(procindex)& X6 u4 ^5 a; a8 Z2 K
    /*check the type of pickaisle.induct(i), for your last problem.*/
1 a4 n: Z3 V- M& c1 r* I7 k  }/ U3 p2 E6 c5 W1 K
    while A_i<=30 do begin; g) J8 l( K* w0 l5 a: l
        travel to pickaisle.con(A_i)
1 F7 m$ Y! Y& e" U& m' p( A) ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ L8 j1 {: V. n- I0 e# O& L2 D& q
        else wait for 10 sec' G6 L  t5 g" [6 |2 v
        if A_i=A_leave then send to die. G9 [1 A6 m( q
        else inc A_i by 11 m( B$ D. o' L$ Y8 \
    end
* L2 F7 ]9 ~8 I1 A2 lend
+ N$ K7 `. T$ b# E
# E( k) ]4 D0 A3 o0 V* C9 R其中的procindex为整形,代表当前process的序号。6 m% f( X4 b, o* m
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-6-5 15:09 , Processed in 0.015449 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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