设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15014|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ U1 ]" A& \) v8 C/ [

! R0 F7 R1 d- Q0 ]1 S( e5 R我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% f( p4 \, j  E3 k" w, P) d. G
7 |( f: q/ S3 C7 G8 Wbegin P_read arriving
2 m7 ]+ F+ Q* T9 G$ Q    while 1=1 do begin7 f& A' G) j) l* c7 X( k9 y
        read A_tote from "data.txt" with delimiter "\n"% Y8 U: L8 _  W. t1 F- \- P. p
        read A_time from "data.txt" with delimiter "\n"
8 M' b# w0 x1 ^& p        read A_leave from "data.txt" with delimiter "\n"
8 |6 k1 B$ B( D' `, r9 s        read A_picks from "data.txt" with delimiter "\n"
3 R0 s" Q0 d8 X$ M; v        set load type to A_tote; I( M+ k, [( Y
        if A_tote="tote 1" then set A_induct to 14 d% t" Q; I1 ^
        else if A_tote="tote 2" then set A_induct to 2$ K9 e% a8 T& p1 c: Y& ]3 ~
            else set A_induct to 3   
3 [3 w& y* }4 K  y/ ^5 A        set A_i to 0& Q+ o; Q0 A1 g5 n$ w7 L
        clone 1 load to P_induction
, G- F) v# m( H8 e% q        wait for A_time sec; ?) j" `- a8 B; z: C" m( ^
    end' a. I/ p  y: V6 d5 S; w! h' D
end
$ f4 T7 }! q4 W) y6 E0 ^
3 b) ~( \0 c0 U6 G; G( h) P3 _begin P_induction arriving: w. _. Y( W0 o& s
    if A_induct=1 then clone 1 load to P_pick1
' N2 O2 h) v% u* g% d% t) p) Z    else if A_induct=2 then clone 1 load to P_pick2
  H; v/ L# r; p6 X! Y) C; w# ^. X        else clone 1 load to P_pick33 D2 c' s; B8 N$ }3 y2 v
end. J6 _; M2 f, h! y% T/ N7 J0 |
. s: V  V7 Z2 \8 W/ H% {' h
begin P_pick1 arriving
' m9 `. T0 X8 e0 |1 _& \! N    set A_i to 1' S% n) ~( l) l4 {( V
    move into Q_induct14 }' q( O8 P! Z0 n& U" c- k- I! ?
    move into pickaisle.induct1+ [9 Y& }! Y* p6 g
    while A_i<=30 do begin4 [4 N1 A" @" V0 e; {7 \
        travel to pickaisle.con(A_i)
! T! A( w" @6 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% F6 l8 m) B/ m
        else wait for 10 sec7 I9 t9 W) K0 n% E
        if A_i=A_leave then send to die
& x5 A- T) {4 Q/ m  a        else inc A_i by 1
2 f4 T& K. ^. x% ~4 {' I# j/ k    end% {% p2 Y) O% R
end
, N3 i3 f. g3 z) }6 |; e; f+ u2 j, L! I7 l/ k) q
begin P_pick2 arriving
# D: D9 e0 a; U% ]% S' f    set A_i to 11
3 h% |% g# S7 ]% D- O; g    move into Q_induct2
! Y2 `4 g9 N' g9 @) n3 P/ F    move into pickaisle.induct2/ f' x7 K9 c- A% \1 @$ L  R
    while A_i<=30 do begin9 V) N; Z: j/ u7 e) F" G
        travel to pickaisle.con(A_i): a, W% G2 {  B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 n& m5 F% m. c( L$ B3 y) Y& F
        else wait for 10 sec: [. q0 [* C$ d: K+ B
        if A_i=A_leave then send to die! \# U# G7 k. F6 [" s% b
        else inc A_i by 1) R: `, p1 \& O  k* y
    end0 |1 A" Q- L2 t; r1 @
end
: m5 F' c/ h; ?( s7 ]" i  b0 i: C7 \4 `
begin P_pick3 arriving
! k5 L4 k" _# \5 \! o    set A_i to 21- t  r' G9 {4 n/ k4 {: z
    move into Q_induct3: `( L. P* i- K# x- I/ N
    move into pickaisle.induct3
6 d/ C" C' p; `) `- Q; ?    while A_i<=30 do begin( \0 v8 ^! h  P& `
        travel to pickaisle.con(A_i)8 Q* e6 ^3 w0 R' w/ h5 N& r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% D, _- S6 X: M        else wait for 10 sec
6 K. q3 N: M: a1 B        if A_i=A_leave then send to die, p$ {9 A6 S. b! ~
        else inc A_i by 1
5 A8 I" ?! N1 g    end$ q3 n6 p4 U  u# y" r7 t- m2 @& E, b
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是个什么东东?
* \5 w+ N$ m# l. t7 [move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 l+ m# m8 k6 o6 k1 F& h; L( W! h: }
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
5 K9 `2 I4 S( \0 _: s! F, ?7 j! d0 [; N7 e
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. V! X5 p( g9 q. Z
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( `; T$ j5 l; Q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 p$ M; d  C% f' n. x0 _1 B3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. Y3 d: H7 ]! T: @; lbegin P_induction arriving
2 a2 x. V6 j( N! n    clone 1 load to P_pick(A_induct)
! U- u. J# {: A" t& W( v% kend最大的系0 [" c) d) {4 I9 j" v% q8 Y

1 }; a4 h. c2 Fbegin P_pick arriving3 `* a6 f  y8 j4 X4 X( U
    set A_i to procindex * 10 + 1
6 @% J" i! u* c. @- X) J    move into Q_induct(procindex)
0 w9 e( e6 {9 e. n1 i8 a    move into pickaisle.induct(procindex)
* m9 \& \, ]) j( _    /*check the type of pickaisle.induct(i), for your last problem.*/- |1 t0 r; P( c2 L; b
! q4 U! o" \6 X' v8 _8 C( }) j: P
    while A_i<=30 do begin
& o! R$ g% C0 q  H4 Y  @        travel to pickaisle.con(A_i)& ]- D$ B: \0 j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 L% [9 ]% B; _; c1 J9 D: }( Y        else wait for 10 sec
& C, `: p; a' u! Y        if A_i=A_leave then send to die
2 s! Y& K9 A2 f# O" G) S        else inc A_i by 1
" o/ K. w$ b8 V6 N    end
: Y5 a6 m# b/ {3 b# ~end  ?/ a7 q  x/ d
- y; J  [9 P6 U" ?
其中的procindex为整形,代表当前process的序号。
0 f6 O# r: q9 ?3 h  q0 astation和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-8-4 09:36 , Processed in 0.020498 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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