设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14412|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# A% W2 Y, R( D, O
2 p' X! O  O. v$ S/ ?9 r) M我的问题是,在每个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中的数值,不知道会不会有什么不妥。# H' V& i) ~5 Q- N' ~

4 h. m6 O7 i3 e5 z# Wbegin P_read arriving
9 }$ r8 J* V$ v* P' K$ L! I    while 1=1 do begin8 t) q) C' v" n9 m# ]
        read A_tote from "data.txt" with delimiter "\n"7 i, D5 p* f# x9 y3 A: W5 U
        read A_time from "data.txt" with delimiter "\n"; m9 f* |$ e" q
        read A_leave from "data.txt" with delimiter "\n"$ j# s" ]4 Y9 Z' f) t
        read A_picks from "data.txt" with delimiter "\n"$ i2 ?* X* M: S. |
        set load type to A_tote
7 {% s  {1 C+ l: |        if A_tote="tote 1" then set A_induct to 1
9 H3 o0 }/ P6 }- m+ P) B        else if A_tote="tote 2" then set A_induct to 2$ `; n5 |/ m) c, ~
            else set A_induct to 3    + v7 A% b) z8 R4 A6 n3 m
        set A_i to 0
, T5 q8 G" }4 m! ?3 @# x# m        clone 1 load to P_induction! }( n2 R& ]6 s4 i0 b! O7 ]
        wait for A_time sec
' k0 @) h; ~* Z    end3 u. i  a+ ?# Q( m8 e* v( X1 q9 E/ f
end
( P# U" w- E  B/ i' B
* i: w. R  \0 ^+ P) b: h6 k7 Hbegin P_induction arriving
' B; k7 h1 S2 L8 Y( `. z/ z    if A_induct=1 then clone 1 load to P_pick1) ^) e0 t) D1 C, I; Y0 d
    else if A_induct=2 then clone 1 load to P_pick2, j6 `/ g  }) W* q% C* t& o
        else clone 1 load to P_pick3
& J3 ]  H* x# ^! zend
1 d9 F+ {2 W' V, r- P' o. b
  e5 O3 V+ j( s' G) Mbegin P_pick1 arriving
: J" o; I2 Y) W/ g+ E- w- f! \. b  L. s5 l    set A_i to 1
0 i0 a. A3 |+ v) D6 [" T/ O- h* ~    move into Q_induct15 L+ E: h- N1 |+ d( P3 M+ Q6 n
    move into pickaisle.induct1
) X' |7 E1 P9 [/ t+ |    while A_i<=30 do begin% y' F  H& u0 u( i' O/ }
        travel to pickaisle.con(A_i)" V  a6 {% v4 m) }8 C: @4 S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% s' E8 _: W8 E4 b0 V) m8 \        else wait for 10 sec
& A: e3 A! O, }% x2 U        if A_i=A_leave then send to die
- P, R+ S0 }% f' x" B        else inc A_i by 1) [: n/ m, Q: `' F
    end
  `3 x% w2 q; q! D3 U# ]$ F0 Send
  A$ M# i$ ^- V/ l7 A
6 w8 l: s4 V/ i& Y- Hbegin P_pick2 arriving, J, t# M4 P/ ]9 D1 u* O
    set A_i to 11
& V  j( v1 C& ?    move into Q_induct2
1 ~2 }& J1 @! E' b+ u1 I3 l9 k    move into pickaisle.induct2
$ N: u( N% e: Y. ]8 ~    while A_i<=30 do begin( w6 U* y6 B6 A/ A4 H  k
        travel to pickaisle.con(A_i)
/ c  g2 A  z+ r3 `/ N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# p3 `3 f# E6 I* A% y$ u9 k& |/ {        else wait for 10 sec3 G: n/ v7 L) U7 w5 X, W" y! f5 \$ f
        if A_i=A_leave then send to die
$ V) R  y- x6 _3 H* D5 W3 B        else inc A_i by 18 j4 ^( ^2 s! J: U0 U
    end
: X5 b$ d0 b! K5 P" kend& X6 G# M: ]2 h3 k7 d" D

1 _7 b3 l# M3 w5 mbegin P_pick3 arriving
9 n4 F- u" |2 s    set A_i to 21
8 Y6 R) B4 y3 ]$ Z& ]% M    move into Q_induct33 E1 l) N8 g* i! o3 f: {
    move into pickaisle.induct3& z2 l' a9 l8 [$ Q. K( u, f
    while A_i<=30 do begin- x/ P$ U$ P- `$ q, R7 g+ y% P
        travel to pickaisle.con(A_i)
: M! w  n- [+ A* b5 N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  i# ?6 \9 n7 s# ?9 Q: Z
        else wait for 10 sec
/ a' N8 g1 H* x; l& ~        if A_i=A_leave then send to die3 {' d8 N% I* O, |9 _
        else inc A_i by 19 @# W. x6 \/ k! K" Z, D
    end. A3 x1 L2 j9 l
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是个什么东东?, a# T* g7 f+ S
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ s1 Q3 ^6 `- o: G; h1 Z. h0 v% l9 }) w5 H. f6 Z# V
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。4 A% u" T3 v8 p
7 p% j, H7 h! T0 o, |2 s8 R* e
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 |" n8 D: e# ?- d
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 r  I7 }* [8 J/ L2 i* `& w2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
; r8 g% R% R, @& p, a) K+ L3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ D& Y; \: {. W; G1 M0 j% }' ibegin P_induction arriving
5 o9 F! X% f7 `    clone 1 load to P_pick(A_induct)- E) d# l/ Q6 w! w' t0 {/ P6 T
end最大的系
5 n( [4 x" V7 P; e* Y
7 s; K: p1 c' s& c$ qbegin P_pick arriving' E! S1 ?% ^5 `4 U* J1 r; w
    set A_i to procindex * 10 + 1" ~( I: C( H1 k, t9 h4 @; i
    move into Q_induct(procindex)
6 P1 E6 G/ x& \; |2 N5 G' _    move into pickaisle.induct(procindex)5 d  ~  ^% `" h+ d# G
    /*check the type of pickaisle.induct(i), for your last problem.*/
9 X% a. T4 e+ {( J4 b3 S% F7 F7 ^
( r9 F3 w% k, X. G    while A_i<=30 do begin
1 g1 i' [. l5 V2 V8 R6 t9 x! q        travel to pickaisle.con(A_i)
9 {- U; Q( V' ^$ T4 h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* y8 s6 _& J7 U& m% W
        else wait for 10 sec- g1 K5 D7 H9 q9 _' ?6 a+ r* f
        if A_i=A_leave then send to die4 z; q6 ]" o9 @. D+ `2 T$ k& O6 r  y
        else inc A_i by 1
- c! ~9 g9 f3 ?3 \& D, E: W    end
3 U0 X: a4 w5 P9 uend4 x# K' D* G6 I& E

8 n. E7 C7 o/ ]: S# x其中的procindex为整形,代表当前process的序号。
; p! Y3 X% k+ M3 t% w% [3 j  {: ~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-7-10 09:00 , Processed in 0.028803 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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