设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14154|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" v, c8 c. O$ T( e5 n% {* f( f
5 H% n& E8 m# P$ L我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% Y- @: z* o6 `5 i9 H* G- S* a. ]: y% u6 S( k. @" w$ \1 r
begin P_read arriving, z$ Q5 [$ Z6 G2 l3 ~9 H1 }
    while 1=1 do begin
8 ^$ h" h+ ^3 K2 k7 N        read A_tote from "data.txt" with delimiter "\n"
0 E, Q( I4 E* o4 |        read A_time from "data.txt" with delimiter "\n"7 i9 E7 @" v0 M3 ]1 Z" b0 L9 c
        read A_leave from "data.txt" with delimiter "\n"; _( j! d2 ~# |- S
        read A_picks from "data.txt" with delimiter "\n"6 t2 U5 U5 l4 n: J4 W+ o2 E- ~
        set load type to A_tote  Y) K! l; O; x! H; {& |$ @
        if A_tote="tote 1" then set A_induct to 1' d; x& H6 v6 ^/ L* w
        else if A_tote="tote 2" then set A_induct to 2
, x" l, c3 }3 M% G" s            else set A_induct to 3    1 l8 ]# w( P( v4 S+ j
        set A_i to 0
* W" E8 |! t: R! ]; C5 X2 ~' o* m        clone 1 load to P_induction, _4 K) o) w' ?
        wait for A_time sec
- c; \/ A4 u  J. H; u* `1 y6 X+ c    end0 o- I& z6 `3 [6 ?3 [
end) c% A" t% ?- z& _) Q( m

, o* p/ ?9 y# c3 `% h' t+ ibegin P_induction arriving
4 o6 I- [; M+ B) I0 `    if A_induct=1 then clone 1 load to P_pick1
0 ]6 r* h) t; V% B- p3 x, L    else if A_induct=2 then clone 1 load to P_pick2
. V. X8 H1 P( \* m: o6 W! S7 m        else clone 1 load to P_pick31 ^' B1 P- g6 b% H
end6 ]7 M1 f; P8 p$ b
) F6 B5 D$ K$ @2 }3 ?
begin P_pick1 arriving
6 h* L6 W+ V8 c  l5 i7 B7 {    set A_i to 12 N# W! Q: d) [" X
    move into Q_induct1) }/ N* X' c2 Q8 K; i4 n
    move into pickaisle.induct1% W$ h$ i% b/ I% M+ }) d
    while A_i<=30 do begin
' E0 s5 y1 Q4 S! m5 e  t! o        travel to pickaisle.con(A_i)
5 O$ D# l& K: s# ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 V0 c  k: S4 L% Q) a& ]% Z        else wait for 10 sec+ l7 y' M5 L  k0 F$ ~4 @% u
        if A_i=A_leave then send to die
: p* Z6 W6 S+ {! S& w        else inc A_i by 1
' h+ J0 @9 u3 Z+ P! W9 X! W$ w    end/ a# P6 N% ^+ R. F2 o' x
end
$ q0 {8 s( V5 d2 E0 J" H. a. @, Z$ N& v. F/ k. p! w3 O- i: f# p
begin P_pick2 arriving: y0 Y1 z, }6 T! ^; n
    set A_i to 11, A+ z: r0 J, }( s
    move into Q_induct2
) Q% z5 e& J' n0 M    move into pickaisle.induct2
, t+ N- H# j0 y% x% }    while A_i<=30 do begin  E: n9 F. Q+ \) d( ^
        travel to pickaisle.con(A_i)
0 C2 ]: l0 E7 \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* V) h4 ?% ]0 p- g        else wait for 10 sec4 e/ [% a: u9 p* B; Q% p, ]
        if A_i=A_leave then send to die
' x/ e$ r$ T0 ]- p- ^2 X, `        else inc A_i by 1
4 ~& A+ s; Q8 T: y  X: @    end9 b+ |0 U: t" O# F
end
8 G, \7 [5 {4 J8 h7 n- w% H, t( o4 ~* M" h& j4 n. R/ ]
begin P_pick3 arriving& `  o+ N% ~( u( y( H# d, {
    set A_i to 21
+ |; I! O" ^& h: v. {- u# m; ~/ p    move into Q_induct3$ V2 D" y: f. w& K' X* M
    move into pickaisle.induct3
' m  G4 C! C' i8 Y. e0 M+ p    while A_i<=30 do begin8 l" e& I. H' u0 f. q/ _
        travel to pickaisle.con(A_i)2 R0 H( S* G% C. N' c( g- ^1 Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' A# m/ ]9 \( v8 h! p  V        else wait for 10 sec4 F" m2 T, H+ N- {+ u" s
        if A_i=A_leave then send to die  {# Q/ l2 s/ e
        else inc A_i by 1$ r+ J3 w" o; v/ M) e
    end% C1 f5 Z2 j- [+ K- Q
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是个什么东东?& Q8 I7 }- C& A3 M* v
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; z1 e/ j1 T# ^# R+ _1 a' h: M$ d" j& ?0 F3 W
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# p+ C  p# H, r) \
. z( M) h4 _, [  m1 l* U另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' \, H1 h  t8 P8 d
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ U4 \7 t4 u' E9 j0 m3 E2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ J7 \) q% ?2 U8 M( U" P
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; @+ F6 B; m% {# k) K6 J# R
begin P_induction arriving7 j7 m4 X# g; V% C) F- I2 }  f
    clone 1 load to P_pick(A_induct)" ?5 y: A6 p/ [/ M
end最大的系- W# d6 p& o* h/ J5 x! S! k* e' d
; \& R( S* w2 d0 e8 ^6 P
begin P_pick arriving
5 W* o5 G/ g; P  b: T* d    set A_i to procindex * 10 + 1
; {# i. F: T/ G/ c% D( s    move into Q_induct(procindex)
/ Y8 \; ]: d& \# g1 z& s  r- E8 X    move into pickaisle.induct(procindex), F: g& R' R' C  k# t
    /*check the type of pickaisle.induct(i), for your last problem.*/
2 e* P2 i* u  p9 A, f; o$ ~. ]3 C$ a$ H* m
    while A_i<=30 do begin
6 `8 f+ e; H0 I! h0 g* \        travel to pickaisle.con(A_i), l) @9 q, [; h8 V  i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* G- s* d4 ~& y! \9 ?$ }: ~  A
        else wait for 10 sec& p4 r" [$ T8 \4 z3 c0 X3 r
        if A_i=A_leave then send to die  }! S3 O9 a; `: U
        else inc A_i by 16 h6 K6 y* v; P0 b  q: \
    end& E. N9 D0 x4 @! T
end7 d1 V' _" Z% `* o6 F. O

4 n! \% B# N- K" `( A$ b1 u其中的procindex为整形,代表当前process的序号。# p( Q; Q. J" M0 Y8 q
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-14 23:17 , Processed in 0.049975 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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