设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11853|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 M3 J9 _; \6 ^" Z6 Z8 f7 S' d( W" g1 a$ n6 b. Z6 |
我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ j; s/ t( y9 A! B
1 g% `, r& Z' R
begin P_read arriving% W' N9 m0 `: s- o' I$ j+ e9 y% g! ~
    while 1=1 do begin
* `8 d  B4 }' o        read A_tote from "data.txt" with delimiter "\n"
* Z: O- \* k( f) C        read A_time from "data.txt" with delimiter "\n"  W/ w2 Y" u6 z6 n" n9 `
        read A_leave from "data.txt" with delimiter "\n"
  r; F/ T$ v4 s( F* h; ]( l        read A_picks from "data.txt" with delimiter "\n"
! D6 ~, n$ O/ U/ V2 T        set load type to A_tote6 Y1 y5 R: a5 ~/ [
        if A_tote="tote 1" then set A_induct to 1
7 k  b% g. f: e2 p' g- K0 B6 C        else if A_tote="tote 2" then set A_induct to 2
9 A* ?8 e$ d2 y) z9 n. w8 Q            else set A_induct to 3   
2 o- p, Y* n! P9 g        set A_i to 0
4 ]' H, ?1 k9 F7 G0 `- l6 s, I! K        clone 1 load to P_induction
5 R3 ]$ n+ y4 g        wait for A_time sec
1 _) }# \! g# L' X    end
, d& H% m8 L. j2 G1 iend/ z: S# w! l; Y

/ w9 N9 J: G5 U! t. V; A! rbegin P_induction arriving
$ Z/ C9 m3 x( }! _5 k; |    if A_induct=1 then clone 1 load to P_pick1
0 h  V+ d) l5 E; S8 N; X    else if A_induct=2 then clone 1 load to P_pick2
% V, H) d# h9 k% ^) v' p; k1 ^        else clone 1 load to P_pick3
1 y6 q1 {+ z  b0 t& s; }) ?end8 m) f/ R4 k$ D, P
  }0 W4 e& o' ~& o& ?' P* Q
begin P_pick1 arriving4 S2 A2 T; I$ Z
    set A_i to 1
, y8 d5 a/ q! ^  h$ d: D$ F( N    move into Q_induct14 ]$ P+ f- Y* |+ f6 m! G" B1 U
    move into pickaisle.induct1' I& k  f) a  E+ J
    while A_i<=30 do begin
/ \  P- g4 N5 a: W( @1 g! m$ z        travel to pickaisle.con(A_i)  m" _' p4 @, o( q0 Y9 R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 X2 ^* X3 ?* y6 A. {        else wait for 10 sec, [: t, A& C2 A/ g
        if A_i=A_leave then send to die( w3 M, J3 x2 T: D% {- J
        else inc A_i by 1
$ g( i( V3 C  Z. Z8 t* S    end# }2 M/ O' i" j% a4 t
end
$ g  q, v- a3 t2 Q' W0 m9 X5 b0 }- X/ {, m1 _6 B. C
begin P_pick2 arriving
9 Z: I7 J5 [: x    set A_i to 11* S9 E$ Q4 C/ P) j; d# f; }1 H
    move into Q_induct2
0 ?' d" h; z2 K5 T. I+ M/ \    move into pickaisle.induct2! @: F3 t! G  i* r/ b/ E
    while A_i<=30 do begin
7 K* R& f( T7 _' H        travel to pickaisle.con(A_i)
3 F/ K7 V0 G" |5 p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 x+ i0 [! U& o& F
        else wait for 10 sec( v5 A: E$ }, N' b
        if A_i=A_leave then send to die: b4 o- X/ e  ]2 y/ ~* x
        else inc A_i by 1
5 e6 n5 Q5 [! U- [7 i) f    end- y- ~3 g+ d# v5 \8 \5 a; l8 q
end7 Z. E! F8 b1 p5 {+ y: |! m
# |9 v. z, H3 ]* y
begin P_pick3 arriving6 B/ q9 i( U6 ?+ y7 ^
    set A_i to 21
9 R$ }, s3 |. L% K    move into Q_induct35 d3 q( h" U& H) [& @" s% T
    move into pickaisle.induct3
: o+ A4 P) K* d* q- ~    while A_i<=30 do begin/ [  Y1 Y% C9 ~$ a; E& D
        travel to pickaisle.con(A_i)
& i: v" G, a$ O- N( l" Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 |8 d; t2 x4 x        else wait for 10 sec
1 T" H: n# M1 s) r        if A_i=A_leave then send to die8 [& G$ \, [' _. g) b3 E
        else inc A_i by 1/ c2 ?/ v5 Y" D( T0 O/ f5 ?1 k
    end
$ M% ?- a. [3 e- m/ }. Oend

最佳答案

查看完整内容

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是个什么东东?
. [9 V5 K3 r# ^5 P  {move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- a5 N$ G  G& A/ t
* W; H+ d" L5 E3 q% _1 l- v) k
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! r! W( y) U+ S3 C, S
0 m) r. j  s: K, X: S$ p另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 `# ]1 @5 K3 U4 T0 H, G0 ^4 }3 V0 E
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ w- T% ~' U$ b9 B+ `
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 @0 h! \& V( }3 _9 m6 r! ]2 p. i, _
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- V* }: T; }: E$ d
begin P_induction arriving4 K* a7 Y( j6 w+ b
    clone 1 load to P_pick(A_induct); L1 |2 S' a1 Z
end最大的系$ K7 A6 u8 s: Q

% x! U" E4 d) t( q3 sbegin P_pick arriving
6 g6 E, R8 S( W7 E, X6 e, E, }+ v    set A_i to procindex * 10 + 1) s$ b, T8 s0 p( j/ I$ L
    move into Q_induct(procindex)
1 \/ @/ Q6 F4 v* P! I" m& `    move into pickaisle.induct(procindex)5 P& U: R! |$ \
    /*check the type of pickaisle.induct(i), for your last problem.*/
& F* r! a6 g5 x* |2 ?$ u& P! D) w' Z% ^2 I) T+ I
    while A_i<=30 do begin1 s3 \) ^0 V: A7 u0 _* _" I- s
        travel to pickaisle.con(A_i)
6 i9 }$ N0 Y3 X8 A$ P; @0 I' ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ I3 G1 o. \' ?        else wait for 10 sec
4 r0 c4 K* ?  }/ |, c. G        if A_i=A_leave then send to die
' K6 G9 n0 c' x4 }5 [' E5 I' M. T9 Y        else inc A_i by 1
) E9 T1 G; k7 z8 I8 U" r    end
  `# |' {9 v5 q3 K. U, Dend
# b% `$ x: }) i1 ]6 x6 [4 `% w2 ]& m, q9 S8 Q2 P
其中的procindex为整形,代表当前process的序号。
/ o' `. i1 F# q: l% Fstation和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-12-10 17:41 , Processed in 0.015813 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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