设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13926|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ R! a! |: `2 x" @* K
; l9 X% ]0 Z7 d6 a! E  C6 q4 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中的数值,不知道会不会有什么不妥。( A+ E# p2 S: B1 n0 n

1 J/ D0 m) }% Ebegin P_read arriving: O& V1 b: t4 [$ Y, g
    while 1=1 do begin) h# ?. \$ N7 d
        read A_tote from "data.txt" with delimiter "\n"4 E/ \: v7 C. n+ F3 O" r; ?
        read A_time from "data.txt" with delimiter "\n"! d0 f- X* r$ c* u! Y
        read A_leave from "data.txt" with delimiter "\n"
& Z- U& M* @* i9 t% b3 i        read A_picks from "data.txt" with delimiter "\n"; G- K4 m0 I# H* E
        set load type to A_tote
' U9 M  k3 E6 {! `! t3 e0 |4 H        if A_tote="tote 1" then set A_induct to 1
% D. _0 H( y% b9 E2 w5 W/ w2 b        else if A_tote="tote 2" then set A_induct to 2
( L4 l7 x  s- U            else set A_induct to 3   
1 o( b3 F3 ^7 k& D5 o        set A_i to 0
, ?0 ^6 I5 Q8 c        clone 1 load to P_induction8 h# S' v5 L  P5 p* \0 W
        wait for A_time sec
: }  t& v+ ]8 R    end3 ^7 j' x: ^$ X; y) J' i
end& Y7 O( D* Q7 T6 P7 q

5 `: o; s/ s8 Z- J# _begin P_induction arriving( l! D2 W" H7 |; q3 I
    if A_induct=1 then clone 1 load to P_pick1
4 q3 ^+ R; y, W* D- d3 D& I" }8 R    else if A_induct=2 then clone 1 load to P_pick2  z* E# N$ E" s/ H& p2 F
        else clone 1 load to P_pick32 [: e5 b3 U7 e8 W% Z
end
5 G4 y5 H* @& I) h4 N6 Z5 S1 R: G5 \, R- z7 U3 n
begin P_pick1 arriving
0 Y9 C5 [# F. d- v" O# o' u    set A_i to 13 @7 R5 ~& b5 J1 H3 [0 Z, r
    move into Q_induct1
- R2 S: |/ |' O7 D( O% o- q9 w    move into pickaisle.induct13 D; A9 m* U6 O  D% K8 a* B9 [
    while A_i<=30 do begin! D6 E2 m4 o5 R0 R# y3 j( P
        travel to pickaisle.con(A_i)7 w( |5 u9 T) Y" {$ c/ A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, p) W  i7 b, g; [8 K# w, r        else wait for 10 sec
5 m4 S' z! Y; S: B! h9 R        if A_i=A_leave then send to die
4 x4 f: ~+ |# @5 U" |4 X        else inc A_i by 1* c1 g  u" i! f
    end
/ E8 N1 Y8 E0 h5 send7 V0 o! d2 b. M3 T
2 y: O2 R4 p; e- u( w2 J, f
begin P_pick2 arriving1 }- c/ A( l7 ~4 N6 n) w
    set A_i to 11
' d, D" a; B% V. s2 k    move into Q_induct2$ R- r$ E8 ^; i" K3 o4 H
    move into pickaisle.induct2
8 l  d, x/ b' p8 J. j" s" V& _    while A_i<=30 do begin! I( a5 [1 [4 w* K  Q
        travel to pickaisle.con(A_i)8 S/ q1 O8 Q3 T& z* L0 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 w. O" y( v2 @$ ~& h+ U- [# D        else wait for 10 sec8 T3 ~. Z8 a0 J- l
        if A_i=A_leave then send to die2 I0 G: D. \6 x8 w2 }
        else inc A_i by 1
* @! \1 l/ h0 X" _  B& P3 D    end
$ m3 Q8 L# x- G! x* N+ Y- o6 X: fend2 j) ^  M7 o0 u# B+ |. x. Y( [* G
5 ~: J. V6 c4 b7 j
begin P_pick3 arriving9 j* d  _1 J( N5 K  S7 Q
    set A_i to 21
  l. k" X' v* l0 {    move into Q_induct3
+ ]6 H+ G( P5 K4 c    move into pickaisle.induct3
5 I7 L% X  U! |6 o    while A_i<=30 do begin
" T( W- e4 b2 S) u( W" {        travel to pickaisle.con(A_i)+ C3 p! N* c7 q( e: y8 i) Z/ C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; z* h  C2 ?3 w        else wait for 10 sec
9 y2 Z" P( z0 [4 h7 C/ E+ O- e6 o# s        if A_i=A_leave then send to die
+ Y6 S  |$ B# W2 J        else inc A_i by 1
( W' a4 I2 {  ^. @/ s" J4 Q6 k    end
) R# q% P5 J* h- aend

最佳答案

查看完整内容

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是个什么东东?
  f, ?7 e. o& ]/ ~! I8 Mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 f3 t  g  V2 E0 y8 H* ^) y$ `4 j* P( n7 ?; e. i
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. s2 P; V+ m; Q. v, D, z( `4 M- a5 B
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:; M# T# [. ]" P5 Q/ t- i
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& h4 f2 F  j5 o$ v8 \. I4 V7 h2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# l9 p6 J8 z2 f: a8 G3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ p0 T4 x! @2 O4 U2 p( m3 J
begin P_induction arriving
4 Y6 @6 H" o, Z    clone 1 load to P_pick(A_induct)+ i3 Y/ W2 }. A* B4 Z8 v& e
end最大的系& \2 h. G; J' @  [6 b* X
; @# H) Z0 j( C
begin P_pick arriving' j% L$ `. M. e. h4 [* L8 a
    set A_i to procindex * 10 + 1) s& |& W. @. }; N7 |( C8 s
    move into Q_induct(procindex)) G  H; ~! R$ _, r8 A
    move into pickaisle.induct(procindex)% p6 N, |$ X% C: `
    /*check the type of pickaisle.induct(i), for your last problem.*// {0 \& x3 I# x, r
$ i1 S; h, p  J+ `
    while A_i<=30 do begin
2 C8 b8 w* ]2 ^, B. f+ W" c- s+ B        travel to pickaisle.con(A_i)( G9 r1 I. d" K8 H& \$ V- R8 }- [# ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) f. t, X/ e6 W4 j' b! @        else wait for 10 sec  k  _/ ~+ H6 v" l2 s& X
        if A_i=A_leave then send to die
1 }) W) g# ]) ?3 \        else inc A_i by 1
( o  a- A; w. N) O    end1 s9 ]) y1 p! x, h" Z2 |. o
end6 j. R$ J9 j$ m5 N. B
1 `9 r4 l% W* l' Z
其中的procindex为整形,代表当前process的序号。& B  j; V- z7 }2 n
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-5-19 20:01 , Processed in 0.018424 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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