设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12341|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) v4 [3 r0 I2 k/ p" Z" m8 g4 t
& m1 E" E; c. N. V# z, y我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! t) K5 u* l- v) Q6 f( k8 @
2 z7 ?& Q9 D( j6 _3 fbegin P_read arriving
! y* q: r8 q* u' ^  N- _7 q; U    while 1=1 do begin
$ W' b& ]. O- Z0 j2 Y" l# q        read A_tote from "data.txt" with delimiter "\n". s" N4 q8 \2 e8 d
        read A_time from "data.txt" with delimiter "\n"
' c+ ^6 x0 `' A# B        read A_leave from "data.txt" with delimiter "\n"  e" ~5 b4 e* m( ^( H3 E: h
        read A_picks from "data.txt" with delimiter "\n"/ \+ H+ v' z. O" @7 q
        set load type to A_tote
% @0 V2 r1 W3 u5 J4 L  ?7 d: O% Q        if A_tote="tote 1" then set A_induct to 15 g5 f, X! u: L
        else if A_tote="tote 2" then set A_induct to 2
  L, ]: |5 Z9 F' ^6 @- X# B            else set A_induct to 3   
4 P: I7 M5 i3 A1 L: r2 ?  O- p& q        set A_i to 0
' e- ]. Q4 n" N4 |( p% Z        clone 1 load to P_induction! P8 T- }. i9 ~0 @
        wait for A_time sec
( \) l9 [0 J3 q, s+ I! Y    end
& W1 B: k) w4 w0 eend" g- B) ~9 w4 [0 \% F! P; B

( z9 t1 @5 r2 mbegin P_induction arriving# B' E2 E8 R% f1 n
    if A_induct=1 then clone 1 load to P_pick1# h) K- Z, i) p" N- _
    else if A_induct=2 then clone 1 load to P_pick2. C8 R0 c3 {* \6 w
        else clone 1 load to P_pick3* l& l7 l, R4 w, \
end% {4 x5 i( [* t

3 y5 A7 j* u$ r* u. L, zbegin P_pick1 arriving
8 h/ i1 x0 t% C" n8 b( J+ J    set A_i to 11 ~" m6 m& C" l5 }
    move into Q_induct1
5 s& o' l; R/ X. s    move into pickaisle.induct16 r  ^% e. `% s0 o
    while A_i<=30 do begin  ?1 F# O. O( G' q4 b3 W: m+ u  H, d
        travel to pickaisle.con(A_i)
' {$ f- W" E5 ^& S! U& j! G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: h( Z0 E9 @# d  L) n
        else wait for 10 sec! n1 q6 s, t9 e2 G9 B! g8 K
        if A_i=A_leave then send to die
4 F6 c: \" \! N- o$ N" d        else inc A_i by 1* k1 r: r, X, z% k7 e5 u( z+ e
    end* }) X" g) H% i
end
% {  s+ M3 [  _. b. }
+ f. }$ }, I* m- O4 Rbegin P_pick2 arriving
- Y  _5 q" `" D- [    set A_i to 11# m$ [) _9 V, o( F2 B( _& M
    move into Q_induct2
$ q1 W" C2 K# U7 h    move into pickaisle.induct26 p4 h0 P; {1 A- _+ G% {
    while A_i<=30 do begin
+ r+ `# a2 G% V6 x1 o        travel to pickaisle.con(A_i)
2 x- D1 G0 R2 ~( I5 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 u! m  p! q! S! j  I: H1 y0 C
        else wait for 10 sec
3 \' Q& f* p/ e+ s+ w        if A_i=A_leave then send to die# U! _; e7 Y' D* @
        else inc A_i by 1  J/ b4 u4 Q; g! ~3 x
    end
& Y$ c. l; w! G2 Z3 U# m/ rend
2 T, V4 p, K' f
2 b6 K! [$ L. v4 M; E# u# zbegin P_pick3 arriving
  Y2 K7 K* z7 ^/ F    set A_i to 21
6 d8 o- X+ C. }& r$ I% I7 l6 P    move into Q_induct3
& d# b4 R& U$ v5 [% d' D& b- F& a    move into pickaisle.induct31 {- T9 b- g' F8 K: E. Q+ }
    while A_i<=30 do begin
1 m3 `' s# R3 f. e        travel to pickaisle.con(A_i)- D6 q' \* T1 z6 s% Q9 o* a' e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; ?2 P# d: p. o8 b% E5 i# h        else wait for 10 sec9 T& x. [* K* a! V6 F9 C, @$ |
        if A_i=A_leave then send to die
0 d, p; Z+ Q7 m6 R* ~        else inc A_i by 1) [+ @4 f8 Q) {2 C  {
    end4 ?. N& S* z6 Z) V1 a! S2 t2 D1 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是个什么东东?
; b5 |9 b) R$ i: zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  u( ^: H( p2 a: ~

( Y' ~" g9 C! X0 P  wAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ L# q& |0 z7 W. v$ _6 D* W: i# k+ r& |
* o7 |3 X  b  O' [3 }另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, z: x  s# Q, }& d$ ^6 O
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 Q/ h% j  x. F  j. q1 L2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 @6 t- W9 B' Y! b* ~
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 v0 a0 t8 P7 f2 g5 |" d! Q' ^: n6 Z
begin P_induction arriving; V1 g( W3 |- p4 Y- k# E- t
    clone 1 load to P_pick(A_induct)
7 v, H+ w5 C1 Aend最大的系
7 |5 e+ q7 q7 d# t  x* N9 w9 s7 d, d& V6 g
begin P_pick arriving1 c# J) ^: K. q  b# k
    set A_i to procindex * 10 + 1
3 ^7 v8 N: o' f6 o1 A9 Q    move into Q_induct(procindex)) b6 N" l2 ?" F  c
    move into pickaisle.induct(procindex)
- A1 \  p. D( P9 R' f    /*check the type of pickaisle.induct(i), for your last problem.*/
& `1 a$ Z+ \5 p- d) T7 Q9 _
: V) B5 M# R2 {1 L  k    while A_i<=30 do begin2 F- o* K' d: w$ @# N2 `( x6 [, [
        travel to pickaisle.con(A_i)6 r0 `4 ?0 U- ]( I3 L# q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 {9 a; X1 u5 c2 G! [: Q  X        else wait for 10 sec
- W  q" G, o, M5 o5 v        if A_i=A_leave then send to die
. ?. D1 u2 z( f. h/ p! m9 ~        else inc A_i by 1
- V8 Y) ^; w7 g; B/ k    end- l6 s5 s, |" P9 ~2 E  \4 L1 u( a
end% g+ b! W6 [. Y0 G1 i

/ [2 X; q0 D7 X4 R% j- S: k" d& A3 ~其中的procindex为整形,代表当前process的序号。$ |4 Z0 D; ^! a4 K9 ?# ]  F: A
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-1-16 04:20 , Processed in 0.020267 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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