设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12306|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 w2 ^1 s% F9 u. n7 ~- o! E  R
; ]0 x! H) O1 j! J) f3 u% Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; Y' ?' V* Y: `" W
- F& T" x5 j$ xbegin P_read arriving* ]' W- C8 [2 C) b/ K' j. y4 o
    while 1=1 do begin
! x0 Z' a6 T" F9 F. L' s" A7 k        read A_tote from "data.txt" with delimiter "\n"1 _$ w) ?; `( v8 [' E1 z
        read A_time from "data.txt" with delimiter "\n"
, ?! g$ t  T2 }" c, r        read A_leave from "data.txt" with delimiter "\n"& R. d! W4 g0 y* K
        read A_picks from "data.txt" with delimiter "\n"; e+ A: c2 P2 {9 ]- @$ C$ `; X- W' v
        set load type to A_tote1 [* S& d; j4 x$ Y
        if A_tote="tote 1" then set A_induct to 1
4 B4 v- n2 L0 y) A, m        else if A_tote="tote 2" then set A_induct to 2! ~& I: @$ p, r- z( i6 a" q
            else set A_induct to 3    ! v6 f0 x& x, }3 G7 {7 e8 m
        set A_i to 0
! ?4 Q- B1 Y* w3 q9 \' E2 s* t        clone 1 load to P_induction' g$ r* b* ?2 t7 W% ~* F+ j" w
        wait for A_time sec$ G1 {' A" h7 W! C
    end2 A5 i' Z1 |# P! E. H; [) u4 Z
end
; m9 D5 C! O$ g* M2 ?* E4 S6 e& q8 W" G
begin P_induction arriving" g# }  ^# z- \# I" [' O2 l
    if A_induct=1 then clone 1 load to P_pick1
; y* {$ v5 h9 O9 [) P6 o    else if A_induct=2 then clone 1 load to P_pick2
; w! p9 \: j9 V1 C, e        else clone 1 load to P_pick3  S) W3 O0 `0 y  p# K" y7 {/ \
end
" r/ ^4 }5 [0 x; P! p# @% y' E! I
begin P_pick1 arriving
# h' J0 w" D2 Z    set A_i to 1
5 }$ ]2 r1 w  `* p2 c- h) {    move into Q_induct1* @7 y* [) _7 {: [. n- c7 F
    move into pickaisle.induct12 R% v. C7 k; N$ |
    while A_i<=30 do begin& O+ R- Y$ \1 y8 j
        travel to pickaisle.con(A_i)
! u3 Y# h3 E* U6 ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 m3 S: g! q. e$ Q" \  C        else wait for 10 sec
' l6 g+ ]. Q$ [        if A_i=A_leave then send to die
# N; {( N5 s" K3 ?7 G& `1 v$ \" \        else inc A_i by 1
9 K: a8 G) k5 m$ `# q; L% U    end7 a( a0 ^; ~9 i+ `5 b- [
end
0 Q0 k5 l. D; P# U3 e
  z% Y$ q" |! hbegin P_pick2 arriving, W) K! D  s) R
    set A_i to 113 `6 P; J" e, B- a$ m! C
    move into Q_induct2( f1 t7 H5 L6 `
    move into pickaisle.induct24 P. U4 q5 X( S4 t
    while A_i<=30 do begin
6 s8 A+ N6 ~5 d2 b        travel to pickaisle.con(A_i)5 W: x* f+ V' w4 K$ S; q; W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 e0 q3 v8 W* J# l  {" O/ L        else wait for 10 sec
; J- |4 T; Z0 j/ T! Y6 t/ m        if A_i=A_leave then send to die
; F9 v- q9 z& \& J1 s        else inc A_i by 1
* f9 ^  a$ u4 q, v    end" Q) t, J# K, W1 E. L# O8 n
end
) K2 ~# |  y" W$ N2 @. N7 ]) O2 o) v1 `* k9 w, }1 o
begin P_pick3 arriving
# P. R4 b; J5 ], j  y    set A_i to 21' d$ O' f$ u! W" ?% O
    move into Q_induct3
4 O" G, x9 A! u' s5 `  `  B    move into pickaisle.induct3, S( N: ]$ G5 W' C, [4 [3 R( h
    while A_i<=30 do begin
1 [: g% {" x7 Z" T& w! m        travel to pickaisle.con(A_i)2 ?8 w( [/ l" j: l. x5 P6 s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( m8 C$ y" o+ `6 G4 A
        else wait for 10 sec
1 G4 w% |  ?2 w1 v6 y        if A_i=A_leave then send to die) |3 d  h3 |& H+ G9 I/ W! `* m
        else inc A_i by 1# ^6 t6 Q; B/ }3 A9 s
    end
) O+ k# k9 x/ m7 t3 send

最佳答案

查看完整内容

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是个什么东东?
, w, C/ ~- z+ ?% q5 x7 Smove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?8 S9 k! P, W, ]5 I/ P$ b
! b5 V# a0 V" X5 b6 V0 `5 Z7 X
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' P. \- I$ O+ G0 {, m2 h0 r# V7 J4 k/ H- j( `$ `+ I
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- W: i, _9 E& V7 R: S8 @1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;  n$ _) a9 T* S: t+ _: a9 B
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 C6 T7 @: F) `) c9 Y3 X* t+ x6 K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 s0 D# J9 w2 ?begin P_induction arriving
: I5 y2 i( j! F6 }8 X9 e    clone 1 load to P_pick(A_induct)
9 L  I' ~+ `" J+ Gend最大的系7 j/ y/ s4 t( S6 L) n2 U3 B

' D; `& b: R% ~% I  s  ubegin P_pick arriving
5 ]9 e8 i. q! ~' Y$ c5 `* b3 N    set A_i to procindex * 10 + 1( G. Z, ^1 Z1 b: r' e; T
    move into Q_induct(procindex)
* w. u3 F! B  H% `5 ]# _; l3 G) Q    move into pickaisle.induct(procindex)& r) W2 Z1 E( \" f
    /*check the type of pickaisle.induct(i), for your last problem.*/% _7 y0 b' J8 x. ?8 P

4 s! f: f. j" j3 [- A    while A_i<=30 do begin
0 L9 x" G/ Y+ s; @7 B! Y5 x3 Y  @/ J        travel to pickaisle.con(A_i)  V, f" F/ |# i, n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 g$ }3 e4 R* `
        else wait for 10 sec( n9 f: Q4 S3 V( x! J
        if A_i=A_leave then send to die! [: h* f- k7 Z2 K* p1 A( c
        else inc A_i by 1% w0 Q( u9 `& Y  q& [6 t9 s
    end  t2 E; A! V7 Z* S) c6 X# ?
end
5 J: L3 d4 K% N: d8 l4 O
) B7 Y; h. F+ s. K  z+ d* o3 V9 M其中的procindex为整形,代表当前process的序号。# O( F- S  @) p9 S, H, ^
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-1-12 08:46 , Processed in 0.020086 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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