设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15144|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 J2 g/ _! f0 Z
" K$ B( G0 X2 [8 P7 m* [4 ~
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( C0 i4 \$ q% z2 Y3 Q7 ^8 K
' L0 O2 S: [+ @0 P0 Y0 H* |
begin P_read arriving  @5 @6 P% V9 j& @3 m. Y
    while 1=1 do begin
  t8 V. W; x  e8 N) j        read A_tote from "data.txt" with delimiter "\n"
+ [, o* ^3 p7 r; X( _  z        read A_time from "data.txt" with delimiter "\n"0 T0 |3 N8 q$ S" v; l. E
        read A_leave from "data.txt" with delimiter "\n"
9 Z; N9 C( x" o8 M( a& B        read A_picks from "data.txt" with delimiter "\n"& `$ m1 P7 ?/ V7 F# X
        set load type to A_tote
8 w2 e7 O3 D% V" E6 a: L        if A_tote="tote 1" then set A_induct to 1
5 r  f4 ~' i# e+ `) @  ^- n( |        else if A_tote="tote 2" then set A_induct to 24 @2 F" z1 }  J  `6 @& N- N* Z
            else set A_induct to 3   
* ]. A" I6 \  L4 n# w# u        set A_i to 0( A3 G% k5 Q; O3 p" [6 U6 Z* ?9 L
        clone 1 load to P_induction% }+ g; d4 N& S* }% i
        wait for A_time sec
$ ~' M5 O, K6 V4 c9 _4 S6 @7 ~: K6 S    end
# j- I1 B+ x& j* S4 b3 Send
4 g0 [- [! }- q2 n/ o" A! W3 G) g% E  s1 J7 p2 q# d2 H. S
begin P_induction arriving0 G5 H: S* d! A' r3 B2 W+ k
    if A_induct=1 then clone 1 load to P_pick13 G  g% E+ p9 z4 n
    else if A_induct=2 then clone 1 load to P_pick2+ [  _0 L0 m: V5 b. K
        else clone 1 load to P_pick3
8 K: {$ W* }$ a& ]4 N$ Kend  g" O- n; f$ ^, T) q/ ~, G
6 G/ P) n( K5 W7 G- `8 `. k
begin P_pick1 arriving" ?$ g2 c6 c) t
    set A_i to 1
  e* x3 }8 g! Y! q, o4 O" M    move into Q_induct18 B8 T. G" R+ F8 E* `7 C
    move into pickaisle.induct1
+ J, P: c5 ?8 ~+ ^5 F# {; Q    while A_i<=30 do begin
) v" O& X* S$ @- t3 |4 W3 j        travel to pickaisle.con(A_i)* C  P' Q# A0 \; }  Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 }% e! o1 {% R( z. t( a        else wait for 10 sec4 A# f# P4 ^% ^! N" x& D
        if A_i=A_leave then send to die$ F5 i0 F; ]2 [9 L
        else inc A_i by 1# T' E& S, w! i; V
    end( v$ T  n  {6 H9 q! ?+ Y1 p# A
end
' p% U4 U2 X: F5 v) U- H+ a1 z- |
0 \: G' p2 X" A* q6 K, \begin P_pick2 arriving
5 [" \9 z, h0 r" v; \3 ]    set A_i to 116 o' x, k2 @% X# d: a6 a
    move into Q_induct2! B; S. Y2 ?* p# P) N& u) U" l
    move into pickaisle.induct2
5 l  _2 o; N" M! d* B9 _    while A_i<=30 do begin
! C, c  z9 E0 d  O1 N) V        travel to pickaisle.con(A_i)
6 o  {7 G& Q& A* B) p$ A+ C' w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 H3 u6 a* P+ c: f7 B4 b& B& i        else wait for 10 sec
: \% F" E6 U" P+ X2 J3 Q3 w/ L% ?        if A_i=A_leave then send to die/ p/ c- D3 l* z
        else inc A_i by 1
. B5 Z" ^# }5 T" @! B; `6 `    end2 y& u2 X2 I1 I1 `
end7 E5 E/ A0 r$ e
! E) x, Z* V5 m" S- g7 u
begin P_pick3 arriving' v. e% d3 m* j( h
    set A_i to 21
0 m- a, M9 U/ Q! t, Z$ ~8 i    move into Q_induct3' K/ {, e5 j. V, d4 w: X
    move into pickaisle.induct3
6 E& M$ L0 Z/ U% _: R  ]    while A_i<=30 do begin4 ~% W* j0 @$ |% J) k
        travel to pickaisle.con(A_i): `  v  N, u# m" d; `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 q( s9 R/ ^' Z* m' l. [( z        else wait for 10 sec" Z. C# [2 y( d: V6 s
        if A_i=A_leave then send to die$ U$ L; W' L" H- N' C; Y8 [5 Z
        else inc A_i by 18 }( T3 e1 a; r
    end+ V) }. h# @5 i2 n/ 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是个什么东东?+ U2 ^& {  O: z0 ^5 \
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?7 J3 q2 Q1 d& J; c0 ]
5 I' |0 C. l% f( i/ d) ~$ X" y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 H% U: d0 G& M
5 Z/ F" }/ b8 X9 g, b' z: B
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 R! P/ w! ~. I3 [( ]
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
0 u  p, b5 S/ l2 C5 c3 N9 l2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 W3 t$ |; y$ j4 P  _3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 b" g# ^/ Y, L$ S7 B
begin P_induction arriving- W3 F$ ?# X/ d& t8 a
    clone 1 load to P_pick(A_induct)
* }* ?& q. J/ R5 \end最大的系
, b" k- O) \$ T& @0 L# r7 a
* G& k9 g: ?: x" r: J% R3 D9 Mbegin P_pick arriving$ `) M+ y0 h- y! i0 j% n
    set A_i to procindex * 10 + 1
4 f) B1 i) [" k    move into Q_induct(procindex)) J: J" [: n- s+ s% B2 Y$ i( k
    move into pickaisle.induct(procindex)
3 M& x' K0 U' b1 l) [) J    /*check the type of pickaisle.induct(i), for your last problem.*/+ F  ^1 h& f; |& G. q, |
$ T; M: C3 }2 {2 j* p
    while A_i<=30 do begin  g# C% k# R% }9 |! q( q3 D6 N! p
        travel to pickaisle.con(A_i)- P! C8 d2 x, E) P7 x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 |+ [: ~0 K8 q! n  r
        else wait for 10 sec
' [9 z3 A; D9 u        if A_i=A_leave then send to die2 ~; p8 q" _% ~# L2 x3 j& s
        else inc A_i by 1
2 ~- j7 q+ B* {  _    end
( y1 I+ w$ }! send
1 h" e+ C; x$ X* v. v( f
- t. ?% U/ g( O% ~) X" ]其中的procindex为整形,代表当前process的序号。
2 ~) z5 \# S  [% ^% nstation和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-14 21:13 , Processed in 0.016630 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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