设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13999|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- m" v4 e  u+ o4 j5 O6 d- z$ J0 [4 `6 X. b0 h% V' s
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ i$ q/ ~* S7 y, Y% {% _! N" q
6 o3 K1 }: o, h! T1 A/ }
begin P_read arriving
- R' e6 N( B6 H; _$ a1 i6 h    while 1=1 do begin
5 e  ]5 @. ]: q2 x2 r. n+ z        read A_tote from "data.txt" with delimiter "\n"
# \# r+ [% w) L8 C7 F        read A_time from "data.txt" with delimiter "\n"
/ {, i/ h7 @' e; c. r& V% T/ \        read A_leave from "data.txt" with delimiter "\n"% V- U" S# I: a( k' @3 @* P; ~
        read A_picks from "data.txt" with delimiter "\n"2 T- p) B$ t* I5 y, e. p
        set load type to A_tote1 M0 t; Z) W$ s8 E
        if A_tote="tote 1" then set A_induct to 1$ o) R4 s$ ]4 I
        else if A_tote="tote 2" then set A_induct to 2
4 c$ u1 q% ~9 c" l: v9 D- H            else set A_induct to 3    0 r" U+ S) P! B9 l0 v& v
        set A_i to 02 P% {  a# u" Z- w! {. \6 V0 _; J
        clone 1 load to P_induction
' c' A0 [. {  l  W. D        wait for A_time sec
# n' i7 P/ k8 H    end
9 \2 A$ J. t& Iend
" u, A0 }8 C0 W' ]0 j7 m: j5 e( U( S$ t' ?
begin P_induction arriving
4 M; X1 e/ `6 i, Z. V( e. L    if A_induct=1 then clone 1 load to P_pick17 D6 k1 R5 C2 [. D5 K, S
    else if A_induct=2 then clone 1 load to P_pick2
/ T  w- m7 f+ ~        else clone 1 load to P_pick3" a) ]' w, a& D- \) m
end
4 ]9 H0 c& y( r( A% E
/ }; i- n/ R7 \begin P_pick1 arriving# ?( E) j; Q# g
    set A_i to 1( r2 A+ y( F. X
    move into Q_induct1$ R, L7 x) |# o+ @  _
    move into pickaisle.induct10 h( v( U3 ?( m' W6 N
    while A_i<=30 do begin
8 v6 h$ D' v5 D' m. P7 \1 {: S        travel to pickaisle.con(A_i)7 d' c2 v; y7 k2 u6 h  K0 Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 T; B( R1 c  ^  Y: z0 H        else wait for 10 sec
* h% s: q! m: l        if A_i=A_leave then send to die
$ [6 H* v9 o& X0 ^' G* k        else inc A_i by 1
( R% J1 M6 \# i0 \9 i2 x    end+ V4 j/ r" I  \. J* E# A
end3 ?& P$ T3 g& R& ^" k
! p# T( e/ r* O3 m: X2 ?0 u+ V
begin P_pick2 arriving
) }1 X4 C7 Y& h    set A_i to 11
( D% T0 J* Z, z- c, ~4 _    move into Q_induct2
- j7 n0 A! T. c0 |; C4 F    move into pickaisle.induct2
8 U# w" P( [: T( T+ H    while A_i<=30 do begin9 R0 E  L0 o) Q8 k8 o# ]
        travel to pickaisle.con(A_i), D7 i" o0 B) F9 [# J% a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" }( J# w  h* j
        else wait for 10 sec" K$ ^: ]4 ?) o9 G- q( E6 q; w
        if A_i=A_leave then send to die
! {& o4 a1 S; d3 e  ?        else inc A_i by 1
- i7 G8 c( M0 N1 M2 Z: \    end
- u' l+ F2 J# g. S' tend
) q) `' M: ?( p8 F, M# ^8 Y1 ]% ^4 D: ~" z1 U
begin P_pick3 arriving# s# |) y$ {6 v9 W
    set A_i to 21! K, ~' K5 G  @" \: u
    move into Q_induct3  E( O& _6 w* T( R/ ]3 j
    move into pickaisle.induct3
+ f( e4 ?0 b$ v( ^6 M4 ^9 K    while A_i<=30 do begin
+ y) u4 f! B2 I. g0 F        travel to pickaisle.con(A_i)+ x' c9 a* y2 ?3 _' G3 c; @9 R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% L9 u& m! a9 }' O& U
        else wait for 10 sec
6 x& `8 C8 h0 }4 ]% _( F        if A_i=A_leave then send to die
$ D, ]6 k! g2 V5 s. N$ F- J        else inc A_i by 1
; f6 R7 @) P6 r6 Z    end
; x. o( _# |- L; Eend

最佳答案

查看完整内容

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 o0 k, j2 V) ?move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 `- D$ \- v- ~
" K, T1 U' R; C2 yAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: y( o; |& t# Z1 u, }: G( O
0 A7 W; \4 ]# a另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* w% p" G3 o* Q; @( a" m( L
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 a1 e7 ?& [& Y* |/ g, I- s" ]7 w2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ J3 R9 A7 `! S2 d- O
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! B7 V; W( `1 B" z! m
begin P_induction arriving: z* s6 j3 O2 t& D
    clone 1 load to P_pick(A_induct)
2 g" N& v! U2 r& N/ A2 O% ~+ jend最大的系
* w) z. f( q* K% q' p# M
) p- P4 L) n% }. @begin P_pick arriving0 O3 ]6 l2 ?+ h8 R+ Z, y+ P
    set A_i to procindex * 10 + 1
% ?7 U$ g2 H" d+ z    move into Q_induct(procindex)) t! J& K: W9 L; W
    move into pickaisle.induct(procindex)' P2 v% H# }0 m4 L4 n
    /*check the type of pickaisle.induct(i), for your last problem.*/
: S' r7 m) R0 T- v+ L0 e5 f+ m- M* K- T) Z7 _
    while A_i<=30 do begin/ u9 P5 ]! b$ v! J" v9 Q9 V/ h
        travel to pickaisle.con(A_i)
8 h6 m9 S) c) u  u' U; ?/ A2 @! v, O, {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ \  z: a) ]2 J# o        else wait for 10 sec1 o; F/ [. ~* s; j" U) y7 o! J0 Z# V
        if A_i=A_leave then send to die
6 R6 c$ b9 [) M4 h' O0 c- Y, y        else inc A_i by 1
4 Y& e6 `- a5 q# T) M) p) I$ Q. t% Y    end
. q0 |. U' w4 y: ]end' I& D1 s0 r* S. A) n9 R

) G/ d4 }- W7 Q其中的procindex为整形,代表当前process的序号。
5 t# X; z1 O$ \6 C$ Mstation和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-28 22:12 , Processed in 0.020992 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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