设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13528|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# X; G: x- D3 k, s! c, b0 H4 U- x# T3 Y: o, I/ p
我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 _6 v  N% b  w

. H; C1 m4 c! c; L, d  N2 Obegin P_read arriving3 m8 d: c9 K* U8 j) y2 ~
    while 1=1 do begin& |4 }; g+ U6 f, p8 D
        read A_tote from "data.txt" with delimiter "\n"! h" `- C5 ^/ K. R- r+ Z9 }7 ]
        read A_time from "data.txt" with delimiter "\n"
0 v6 U7 X3 x; h& y' ?  O        read A_leave from "data.txt" with delimiter "\n"
' }* u. o) ~3 d) g        read A_picks from "data.txt" with delimiter "\n"
* o3 n3 A% \% m        set load type to A_tote
. B0 `' Z& v4 K% U3 c4 v        if A_tote="tote 1" then set A_induct to 11 t9 c& E% w; e- s0 Y+ q1 {+ Q
        else if A_tote="tote 2" then set A_induct to 2
2 h9 e7 D) C1 |- s            else set A_induct to 3    3 s: ~4 W4 v% d2 l) l4 o6 `# H
        set A_i to 08 F; |: r' V# v0 S/ v1 m$ U
        clone 1 load to P_induction( T$ ]) n+ K, E( K9 E9 V; m7 M  r; g1 q
        wait for A_time sec
4 u$ Y% g! G& ~/ P5 E$ J) E) c2 Y    end0 B5 a& N" {/ E/ f: |; j9 Q
end
; Q7 K% @' g9 ?3 Z. h5 S0 c( b2 L8 B3 J! w4 g
begin P_induction arriving
# b; a' L% ?& v4 G7 Q    if A_induct=1 then clone 1 load to P_pick1  e. L( x* K/ k7 W: |8 q8 k
    else if A_induct=2 then clone 1 load to P_pick2
5 @" O2 O5 {4 l3 i4 _/ L/ U0 O        else clone 1 load to P_pick3
' ~  V, n7 V3 E9 p& S, L! jend
& @; T: e" l' ^& \1 R; s0 n6 _8 _7 Z9 v8 N/ e0 Q$ m$ }9 {. b
begin P_pick1 arriving
. g* Y+ G6 T2 r' s5 l6 [: b    set A_i to 16 T2 B' J9 E9 t0 X/ G! F* w0 H4 e
    move into Q_induct1/ U" c2 Z* ]9 r
    move into pickaisle.induct1
4 j9 P. B3 X0 e4 d/ {    while A_i<=30 do begin" V9 V% V7 L' s/ |  P! t% ]
        travel to pickaisle.con(A_i), i4 J9 B7 @5 n) I2 R5 b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, r7 G" D3 m$ y8 O3 q0 s
        else wait for 10 sec
; }) c3 D3 l6 ?1 l, @1 R- m        if A_i=A_leave then send to die
; @4 ^- M! V# k) V# l9 X( C        else inc A_i by 1
9 c+ S) _) {7 V7 ^1 P0 f    end" q1 ?% w8 _0 K5 @; ~( H
end
' Y8 a5 y/ \6 s: v- {8 P8 Y
' Z* t0 P+ A0 H  dbegin P_pick2 arriving
- e6 x0 B. O! r/ p' n    set A_i to 119 `$ B3 W+ y+ `
    move into Q_induct2- j. B; H) {2 |0 B
    move into pickaisle.induct27 }% c9 O5 @) |) x
    while A_i<=30 do begin
& \. a% K# h+ Z; d! u        travel to pickaisle.con(A_i)
) Y/ y3 t0 F4 e5 {& V8 t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' Z5 {. Z1 c: y0 o4 q1 @) I        else wait for 10 sec- H4 A2 |0 d$ ]/ ~: t
        if A_i=A_leave then send to die0 |& t+ O* a7 Y$ _! a
        else inc A_i by 1
- N- L' c. I+ |! b+ O/ G  f, D    end5 l2 H  [% m  Z3 O8 l$ R
end
6 j) H& s$ G8 K/ u8 ]( z
  d9 E! d3 O9 A' R( r& m6 Ebegin P_pick3 arriving$ e8 `5 `4 O/ r1 w2 r3 n
    set A_i to 21! o. e2 ]* {9 R) s# S" V; ~
    move into Q_induct3# m5 r, G5 b& i1 ?' B: J
    move into pickaisle.induct34 l! _8 t; B1 [* M/ T
    while A_i<=30 do begin
& p/ N( Q4 \4 d7 X4 m: x" ^7 \        travel to pickaisle.con(A_i)
  E2 C+ |+ W$ f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 t! k8 `% r1 Y6 K/ F4 z8 {
        else wait for 10 sec, z; y' b- B. i! W2 h
        if A_i=A_leave then send to die
9 o# s: p6 w% ?0 J0 S, B9 R& o        else inc A_i by 1
8 g. ~& B6 k, V/ @7 ]& R# B    end( e3 J: @/ n( _
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是个什么东东?
0 t. X8 v/ d: a2 H+ z# y/ Kmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( L) C" n5 A; b; Z( ]2 b
* |+ d, [2 D; D% D# L
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 D& M) Y% d, [# }, B

! k7 x6 e5 i, |! }; g另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ E1 E# A0 W( y- f( E# E
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
0 ]3 x) E. S; Q/ p$ |2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 a9 \& y. s8 W/ X1 ]$ b3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" d3 @1 e1 {4 P- ~
begin P_induction arriving
/ B2 R6 o) V' X    clone 1 load to P_pick(A_induct)7 X2 G- e+ b; l
end最大的系. c: o. h, a8 k. r2 F3 |; E7 r
/ O* T0 I9 q& `. Q. W7 T" p5 o2 s! u1 M
begin P_pick arriving% l; y& t- U5 ~. @: p2 d& l
    set A_i to procindex * 10 + 1
0 U. N+ x$ A$ S3 P* o% C    move into Q_induct(procindex)
* Q4 d( |6 S3 D1 [1 m, m! O" h    move into pickaisle.induct(procindex)
6 m8 k  \. f" W( H5 ~' ?# Y( Z+ _    /*check the type of pickaisle.induct(i), for your last problem.*/
* l7 e; f* ~6 V3 Z( G$ J  ]9 e& _7 H! a6 i2 s$ P
    while A_i<=30 do begin
' G; K% ^2 G; b! x        travel to pickaisle.con(A_i)3 R/ u& w/ [4 H0 z) k. P  A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 ?( y& {8 }5 J# ]
        else wait for 10 sec
! T  F/ ~7 i% g        if A_i=A_leave then send to die% S& b2 I! w2 I! d/ F/ z( M
        else inc A_i by 1( L( d+ H8 |6 F3 t6 G
    end/ t3 Q' j% O4 f$ ]
end. j7 W( a/ g' L% l( E; X6 _0 d/ w. J
- B& R4 E! s7 H6 N* J
其中的procindex为整形,代表当前process的序号。- \: ~( _9 h0 \
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-4-19 21:01 , Processed in 0.020767 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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