设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9808|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' M$ N8 ?8 D8 R9 d
- D) }# r7 L# ?2 m3 h, S我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* S3 i# B8 P/ a, d/ P
, H+ |* \4 ^: H4 d8 r& Pbegin P_read arriving
  S+ o+ b* Z& Q    while 1=1 do begin
+ G+ D+ [& _, R0 N: q- L        read A_tote from "data.txt" with delimiter "\n"
7 R/ Q1 p* n/ I        read A_time from "data.txt" with delimiter "\n"% n* i4 T- h8 H, W. o( s
        read A_leave from "data.txt" with delimiter "\n"
& B2 s  ]% h% p5 |6 j* e+ ]        read A_picks from "data.txt" with delimiter "\n"7 W$ S6 j: ]1 r4 t8 M
        set load type to A_tote" o, o2 w/ b9 a. j
        if A_tote="tote 1" then set A_induct to 13 |) C9 b& q, z. i3 z% i
        else if A_tote="tote 2" then set A_induct to 2
9 \/ K& e1 {1 J, r8 Y5 \            else set A_induct to 3   
( Y! ~- h- @) g8 `" f; G        set A_i to 01 W! c: O8 |  Y. P7 }' G$ e* R
        clone 1 load to P_induction6 I7 N. ?- y9 \: ~( f; ^
        wait for A_time sec: {( A, J7 p% T: O  q+ {
    end- w% j" Z/ b6 |6 |& }1 x7 M
end
# C! q% P! _) I  T1 U, L
$ c( W3 m" w8 F) R4 ~2 ?# o. \begin P_induction arriving
) a8 N3 N: ]  [7 U  R& ]  S' F5 Z    if A_induct=1 then clone 1 load to P_pick1
' N, K. w# ~& k" U# E    else if A_induct=2 then clone 1 load to P_pick2
) M* m, [6 B* h9 z" k0 q        else clone 1 load to P_pick3& m% ^% Y9 ?) c1 \9 j) e" O
end
9 f5 W% Q% c0 l+ c
% ~7 E% J: h9 @0 k- J$ Hbegin P_pick1 arriving
& y' U9 P% e" H    set A_i to 1
  i: g3 g+ @$ J( G! m4 a    move into Q_induct1
8 Q3 R) }* e. X& W- y+ ^    move into pickaisle.induct1% K5 d$ s8 H3 U& e- M9 t9 D
    while A_i<=30 do begin% |& i1 T% u/ Z" y/ @5 I4 k
        travel to pickaisle.con(A_i)
3 X# m, y+ G( _$ e) C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ L/ D% e5 a4 y$ P' Z. [1 J! e! J        else wait for 10 sec! q. k3 ~4 b0 ^1 g' M
        if A_i=A_leave then send to die) h. p& J" r3 Q, R8 y; a
        else inc A_i by 1& m2 Z1 n/ ~4 V2 e3 W9 g  F
    end1 X5 a; y( n- U+ f0 l# t
end
, t8 B$ k* Z9 x
) J7 `) Y' ]& }5 qbegin P_pick2 arriving
  P- Q& W1 e- e, w5 Q4 Q    set A_i to 11) k+ U' `, w; B) N/ \) p. Y
    move into Q_induct2
; P; V1 Y9 \( }2 T" q  l) C7 t    move into pickaisle.induct2
' s* X" y, a7 ?  e! G2 W5 e( u9 b    while A_i<=30 do begin/ l4 P' X  f& ~/ q0 ]$ ~$ n
        travel to pickaisle.con(A_i). `+ R' X8 I4 _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% ~" m+ }( T0 c) m; d
        else wait for 10 sec
; D# \7 ]. I1 N; @- }        if A_i=A_leave then send to die
) K$ L' M$ U( \1 ?& X1 C- H- U        else inc A_i by 1
) r; w* N1 ?  S+ |    end
6 X5 n4 ]0 w4 Lend
- B6 @, ~1 H1 ?7 O! G& h
* U2 g. ?5 G% p, g( Kbegin P_pick3 arriving* V' `& a& \. i7 Z2 @2 T! B
    set A_i to 21
% F5 Z8 e" y( G0 ?( m3 L, e. g$ ~    move into Q_induct3
- m* U) D, S; U    move into pickaisle.induct3  v  v$ M: J  H$ }+ D, G. l
    while A_i<=30 do begin
9 b" M$ e; ~4 |' x& u3 ~        travel to pickaisle.con(A_i)
# P) A0 ~, |: v& D' t8 z( N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ x& v& L1 H8 i3 I) G  k        else wait for 10 sec& ?5 b# [7 J: G2 k: F) u- V8 x
        if A_i=A_leave then send to die5 y- v( W& v( o: p* M+ z
        else inc A_i by 1
! Q* v) }7 Y+ b# h: v    end4 S4 w9 N2 \1 c- V* B6 T
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是个什么东东?/ a5 {9 c$ W/ K1 f
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" w7 R+ |2 B" z
9 E! x  z$ n5 \# ]8 A* F
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! d+ H# p) Z  J; [% K* r4 j
  [5 i2 A; g& T/ y- R' |另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 E% y7 i1 D' |3 `
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. K7 O( J% m1 P. V) j
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;* f4 g0 X& P$ G% f. J
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ Y% [! B2 B$ p; e7 \
begin P_induction arriving
7 ?$ X- W. ]" N( D4 y5 E& z1 s    clone 1 load to P_pick(A_induct)2 y9 ~9 j% ]0 Z! n8 f; L
end最大的系
0 p5 l& i) A4 p0 g% N. R$ R" \' z+ w, _- \( p2 B
begin P_pick arriving# p0 Y4 u, N) d, B. u! V8 v) L
    set A_i to procindex * 10 + 1
% r8 ^. d% @7 ~% ~! y# f% e    move into Q_induct(procindex)! l' M7 {6 p  Q% V
    move into pickaisle.induct(procindex)- g/ }1 _6 _2 c3 Z
    /*check the type of pickaisle.induct(i), for your last problem.*/
9 z" Y7 [% x3 N' m- r: T2 n4 w
, l9 v% ^* n3 d; ?0 n8 U    while A_i<=30 do begin. I) J, l; |  B5 B: d2 \
        travel to pickaisle.con(A_i)
6 N1 n* J# B9 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  v- T! a* W: Y' H1 z        else wait for 10 sec
) j3 |% ^. {0 v; Q        if A_i=A_leave then send to die1 M% ?7 k0 _. e' j8 L* t4 e6 f  F
        else inc A_i by 1. D" n) S; d$ r
    end( n  L' @* h9 w9 t; _9 D
end
5 [1 C# Z5 ?+ W6 V0 L' q
/ l" r- I# K/ c- w4 _7 v/ W其中的procindex为整形,代表当前process的序号。
7 v9 a) X5 {- R2 c6 S, `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, 2025-7-7 10:46 , Processed in 0.013772 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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