设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12161|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: e  J) U( T' u7 G7 j
: D  x: r- L+ a, s; C$ j8 n# 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中的数值,不知道会不会有什么不妥。
/ f% Z( A& s: v/ @/ a  ]9 T: W4 K; G9 v) u' R1 q
begin P_read arriving
( T8 z( T0 z3 z9 r    while 1=1 do begin
! f6 [8 _1 m- }6 W        read A_tote from "data.txt" with delimiter "\n"1 S4 ]3 c  v8 t6 E5 Q
        read A_time from "data.txt" with delimiter "\n"
* v# B' Q9 m; D8 }' g        read A_leave from "data.txt" with delimiter "\n"  E: A; c! F  K3 ]8 }
        read A_picks from "data.txt" with delimiter "\n"* ?2 c: A1 w; Y1 B- N
        set load type to A_tote3 L( T. F% Z- |# B6 }! d
        if A_tote="tote 1" then set A_induct to 1) o2 g! F- ]$ H
        else if A_tote="tote 2" then set A_induct to 2: M1 ]. u, _% S4 Q  ^- a$ F" ^
            else set A_induct to 3    ' P2 b4 h- b; j* ]& ~; {; D
        set A_i to 0. I. o% {6 ?  l/ \# V
        clone 1 load to P_induction
' D& U( w: f2 L1 {8 F        wait for A_time sec
: q8 \$ |# y. ^0 ~* H' A8 M) T' Z    end
, \4 h/ n. e9 ]0 }0 ]/ V$ Cend* {4 J' Z6 b9 N
0 e% p! o8 u2 q
begin P_induction arriving% K. x9 _# l- c$ F' n3 e' A+ A
    if A_induct=1 then clone 1 load to P_pick1
9 l$ ?9 z2 W, k& K) q; Q1 |- T    else if A_induct=2 then clone 1 load to P_pick2
8 P6 E4 C. W. m* Z, k        else clone 1 load to P_pick3
' Z. n7 L8 }7 e6 J' d% F# k4 ]end( Q% j* r1 {# {. F: {. j4 @$ {6 q

7 O( p: G' A% m/ g4 q2 X1 k" {- pbegin P_pick1 arriving
" G1 N) s; S+ h; Y8 j2 Z" T    set A_i to 1) r$ x* q/ Y- Z2 [# @+ ^1 v
    move into Q_induct1% ~* y' z0 m4 v9 v! d) a% s
    move into pickaisle.induct1
, Z5 `& n) [, W  ]    while A_i<=30 do begin4 y2 C: j! P6 ^
        travel to pickaisle.con(A_i)  n/ `, w6 J& G* O1 l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ `8 ]+ n( G0 q/ U4 D        else wait for 10 sec
9 l& ^0 B6 w# w8 C+ }% _; a6 B        if A_i=A_leave then send to die
+ ^3 O* B, ^: A& T: Z        else inc A_i by 13 B" y- e1 I3 L/ F2 W
    end- U* N$ j$ p- [, _
end4 y( ]. h- M$ }# x. Z' |2 d9 R
. u9 G: ?1 V0 b
begin P_pick2 arriving
: J6 b, ~& f& V% Y" j' N    set A_i to 11
0 X# `  ]1 _5 k/ @8 p9 {    move into Q_induct2
' S' S# h4 C2 f$ F9 ?/ ?    move into pickaisle.induct2
* X/ ]4 T' \2 D  L3 X# E1 L2 M    while A_i<=30 do begin. b0 N+ O& P" E+ x
        travel to pickaisle.con(A_i)
# ^! e* x$ ~" x' |; ]! r! m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# f# @5 E1 a7 B        else wait for 10 sec
1 O% m8 [6 ?% r8 G5 _        if A_i=A_leave then send to die: d+ d( B" F5 V; }
        else inc A_i by 1; z. o1 @, a! M) w
    end
. y8 @) A  P; |& Aend% R3 M. }& i% E+ F$ d* |0 X) |+ O
7 B4 ~" m, s, X! n9 f( H
begin P_pick3 arriving( \& B" B' `$ G* O, d% Q
    set A_i to 21$ ~  X" y% ~6 l
    move into Q_induct3
$ T) U: `# g6 j( E    move into pickaisle.induct3& Q% U9 L: d  V
    while A_i<=30 do begin
4 I0 u) _, y4 x: F/ y; Z7 e1 v        travel to pickaisle.con(A_i)
' W; f- U- g" l7 N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# B3 c1 T* p, r( N8 G% j* M  v% ?  m
        else wait for 10 sec3 x( V8 B1 S* i; ?7 w
        if A_i=A_leave then send to die
9 n2 D, u/ a5 e* A  Q" T        else inc A_i by 1) L9 H- V1 i9 n2 g: }7 P3 ?5 k
    end" Y: ~* {% q' x
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是个什么东东?& ]5 k" T' Y# }0 d& |
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 j8 c& F& R4 J. Q# {
2 o$ a+ i' b0 C% @" VAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: V: O7 a( R% B  C1 L! R" {$ q
9 V3 m+ X7 x/ F8 M, X" C6 A另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: Y( V3 _( o8 T, P0 g$ G) H
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ T+ g- [1 _( i; t% r( o8 x6 w2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' E8 ^5 a( I( m  @( A8 x
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% S" ]# D' U6 i6 g5 ^  s; B
begin P_induction arriving
& S( |( x; o  f: \    clone 1 load to P_pick(A_induct)
$ a1 u  J+ k* j* @end最大的系& A& j: K- Z* F% l: g
5 T/ V% l5 O2 |4 v: x
begin P_pick arriving
# o# }; l8 a6 y0 f1 V7 c    set A_i to procindex * 10 + 1
9 K2 q4 E9 r( v6 p' y    move into Q_induct(procindex)' m- m% e1 ^& U; F
    move into pickaisle.induct(procindex)8 Q9 u2 i3 F( Y. y
    /*check the type of pickaisle.induct(i), for your last problem.*/
( _  |8 Y  u, L/ }$ j4 g% Z0 d4 `5 K3 J" m. L# N4 E
    while A_i<=30 do begin
- }8 e) b0 {  }7 H* {, w        travel to pickaisle.con(A_i)% M" z; @4 M7 ?' @4 |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 G! V; O, u; j% m; ?( B
        else wait for 10 sec
: V3 [  B9 T; j& {# R9 [        if A_i=A_leave then send to die, p! n4 ~$ t- @! f: K
        else inc A_i by 1
* r( J8 M, a; v* Z4 S- o5 V( _    end
4 h7 L! r7 ?( Eend
5 p2 I" q3 q7 j7 x! h6 {2 K
' R. R' K* z) f7 V+ h! q其中的procindex为整形,代表当前process的序号。# ]7 J: Y; a, N( y& r) K2 b3 v
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-1 12:06 , Processed in 0.017728 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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