设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14191|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- W! r( \: d3 H3 i9 r8 v" r5 A- r5 q, |; Q( t! A% }/ B
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, W1 s* P& ^$ H* U4 `: }& D. U# f6 i
begin P_read arriving  P) n5 p0 v+ r9 i# U) e
    while 1=1 do begin( F. V: n: }% f$ R: J
        read A_tote from "data.txt" with delimiter "\n"- @* n2 H( ], j" Y
        read A_time from "data.txt" with delimiter "\n"
# Q2 [( W8 L4 q7 S* i        read A_leave from "data.txt" with delimiter "\n"( g# j, R+ j4 z" s: f
        read A_picks from "data.txt" with delimiter "\n"
+ ~: x9 {( e8 n: x8 W& X        set load type to A_tote: S8 I5 p; U$ m/ _! W! I6 P
        if A_tote="tote 1" then set A_induct to 1' ?: J; w$ ]' W# o& d1 ~6 e0 n5 B# y
        else if A_tote="tote 2" then set A_induct to 2
  G( u9 }0 C" Q- V, V( P            else set A_induct to 3    & n) _& s: ]) P8 l2 f' @; V+ x, E
        set A_i to 04 q6 b: D. e( O& v- m6 P. t
        clone 1 load to P_induction" l5 M& @; D) |
        wait for A_time sec9 O9 @# m/ M3 Y0 K" c/ l
    end1 ^1 o9 I, W, S2 d
end' ^- a- d/ e8 }2 l6 k
2 H  n  U. h5 M8 K8 k- @
begin P_induction arriving
+ m* ?$ F/ Y" E4 g5 G. e' @    if A_induct=1 then clone 1 load to P_pick1
3 N7 u" w8 h) b: S# M9 Y0 {    else if A_induct=2 then clone 1 load to P_pick2' I3 T- {/ C. s- X+ b. D% t
        else clone 1 load to P_pick37 \8 J& T- |8 \$ u
end+ p9 s) V# T) i& H' t3 f+ o

  |0 R, Z) c0 f2 H7 W, Xbegin P_pick1 arriving: O- d/ y2 Q+ K' w
    set A_i to 1
% ?! P( a3 m/ `- N2 T+ Q    move into Q_induct13 I6 H6 m5 \: n, q& A
    move into pickaisle.induct16 u5 r+ r( ^3 q4 ^7 D
    while A_i<=30 do begin
6 E4 U2 S, H' T        travel to pickaisle.con(A_i)
" G& q+ r1 E$ z' U& N/ d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; n* u& {& \% W3 f
        else wait for 10 sec
$ r% `2 k  K: f6 [        if A_i=A_leave then send to die
, ]9 H4 X3 ?% h( U        else inc A_i by 17 _  t) k- p, W2 f* H* J+ C
    end
0 a# k' B$ ]" d) D+ t! ~end
  O4 Z3 b+ F5 ?  q$ r+ P& E
5 E6 y4 F$ f8 q, }! P; V9 C" Tbegin P_pick2 arriving
. H- v; L5 {8 D# m: m1 z    set A_i to 11
+ V% Z( V/ Q  j2 Q$ L6 c* s. A    move into Q_induct2: o/ X2 e8 b. i) Y9 y! z" D" Q
    move into pickaisle.induct2
& c4 j0 z/ V: V. F  V    while A_i<=30 do begin2 m; a8 P5 F: f+ S
        travel to pickaisle.con(A_i)5 C' |. }4 U( R2 e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 O2 Z' Q- ~0 m& I' W
        else wait for 10 sec9 v6 W; u1 f  ?- L# i' Z
        if A_i=A_leave then send to die+ w9 Y$ K3 P4 |3 k; p+ i0 O
        else inc A_i by 1
; G; G+ n  P2 _/ L1 k+ G" K    end
% K$ d: F$ v2 H& D" S  Mend7 K" p- R$ W) {5 w0 Z0 s

1 t9 K9 p+ y+ z* j) Gbegin P_pick3 arriving
' [, k5 ?5 \4 A! `% T    set A_i to 21
9 Y) f1 `/ y2 X  k" B. ^) p: e/ S    move into Q_induct3
  m/ M! x- N" I: H3 R    move into pickaisle.induct38 @: J8 s' r/ ]
    while A_i<=30 do begin
* O* B; s/ ~- Y, W* w        travel to pickaisle.con(A_i)" ]3 d* i% Z1 X# }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. [. b$ j' M! e0 R% C7 b+ w& ]        else wait for 10 sec
0 ?0 z) B1 ~7 ?( x        if A_i=A_leave then send to die
' j" O; Z7 j- _+ g7 v( E" q        else inc A_i by 1
" D) x! |; I' U    end
; B1 f' x) D6 `. T2 xend

最佳答案

查看完整内容

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是个什么东东?# l  ]4 P; y1 t
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ V: [% g5 ?8 m. ^3 B+ z) J
- z1 g# N; `# B# v6 h- {" n0 y0 F
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( w/ P' G/ v6 Y( c

9 U4 P7 ^5 m) n) j6 j/ [6 X另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' I8 p3 f8 L# v
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 ~/ z( D- M: C" V" y% h6 K
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 G: p& j8 B0 }( D- f; t$ P
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 d% e; }4 ~  \0 L& mbegin P_induction arriving
" V% h$ c6 x/ _) z  v    clone 1 load to P_pick(A_induct)7 K, [; ~9 b  h/ H: H
end最大的系
5 E/ s/ r# A- z' K0 z
3 @* @& f( q3 hbegin P_pick arriving
  ]) X0 B; E* D) t& Y8 X    set A_i to procindex * 10 + 18 w8 Q" _& t& w
    move into Q_induct(procindex)+ L: c; _( Y0 S6 O+ P3 W
    move into pickaisle.induct(procindex), ]/ i. [; G; n" t
    /*check the type of pickaisle.induct(i), for your last problem.*/
; c. v1 S7 a2 ~  `: C. @4 r5 w8 k1 q' u$ y
    while A_i<=30 do begin
1 b  `: s# P$ M        travel to pickaisle.con(A_i)
; f3 D" d8 L( v6 Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! k3 f' F, W8 A
        else wait for 10 sec
/ q$ v9 f2 r; v# S+ n& D0 p. F$ g! A        if A_i=A_leave then send to die
! Q2 ^+ n" }. |# r' p        else inc A_i by 1
( N' R2 i2 p7 O. Y" e    end
" I! Z0 _/ O% {7 D' v/ p1 aend
+ a7 n$ c3 L& g* U8 D) B: o  Z: b5 j: I; O7 U# w* K6 K9 K" j2 s
其中的procindex为整形,代表当前process的序号。& P& U5 [; g6 g: D4 ]4 W$ l" m8 M
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-6-18 19:00 , Processed in 0.013772 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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