设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13064|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& @5 O# A' ~: R1 z% w& ~7 u6 ^8 a5 E& e! v& k" N$ d) J2 D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 s: T( e4 C" }' T4 `
; }2 k5 \' T* N. x# Qbegin P_read arriving
: u9 A, D2 U# f" L* O    while 1=1 do begin; Z% w  N. K, E) z4 Z  O0 L9 o
        read A_tote from "data.txt" with delimiter "\n"7 s& I# o9 p- y1 a2 u( d
        read A_time from "data.txt" with delimiter "\n"
3 A: ?; @! L8 W        read A_leave from "data.txt" with delimiter "\n"
) k( p+ F( C& |8 U5 d/ a        read A_picks from "data.txt" with delimiter "\n"; G2 |- L/ z8 P' Z; P+ {3 M
        set load type to A_tote$ [# i4 ^3 t9 c1 I4 [
        if A_tote="tote 1" then set A_induct to 1: ?2 @/ p8 s- v
        else if A_tote="tote 2" then set A_induct to 26 ?% v% ?1 e) ^
            else set A_induct to 3   
- r( f( r' {* ]' w) u1 b3 ]; I: d        set A_i to 0
0 c, R9 X( O! u6 A        clone 1 load to P_induction
& M: F" J9 E! n, u3 d+ m& U        wait for A_time sec7 x  K, z: k7 L( o3 d6 o* X
    end; D: `/ |: ?$ a% w4 u/ o  v% f
end
6 ^- E7 h1 w- _( G5 V) t' C. Y9 l8 d9 W4 ]1 P+ q$ V+ E
begin P_induction arriving. u7 C" r2 v! \7 `$ o. R# Q' F
    if A_induct=1 then clone 1 load to P_pick1
+ L7 ^0 |- {6 U8 i; E    else if A_induct=2 then clone 1 load to P_pick2; J/ D; [  y8 d
        else clone 1 load to P_pick3
" I5 E9 T; S- o$ z# Tend; o" k2 H5 R' j( f
( o/ @! g' Y! O6 f
begin P_pick1 arriving& j  o! Q% e' k& Z  D' E, {. `
    set A_i to 1$ D7 Z1 C5 A' J# y4 H5 [  t
    move into Q_induct1' k( V4 w# \* h8 V. V
    move into pickaisle.induct11 C/ q( U1 B  |& R
    while A_i<=30 do begin
  r, I, Y6 k$ W& o        travel to pickaisle.con(A_i)# a8 e  ^' b/ \6 J3 X) o3 g5 e9 G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 ^; b/ ~! S" }! g        else wait for 10 sec6 s8 @% Z: _, a
        if A_i=A_leave then send to die- R. [% Z% W' Z6 D- @0 m8 Q
        else inc A_i by 1
9 U( I; g1 b2 {7 |; [    end
& X% ^4 S. h8 S5 \end
# b' `4 ]- C3 t) b" R, S9 n
5 |( |5 D1 _  P- N; |1 @* Gbegin P_pick2 arriving
8 \, {9 y5 r' t9 j5 p    set A_i to 11) ]" ]' ~3 y0 O; h+ s5 m
    move into Q_induct20 {' T; i% c/ g( v+ L
    move into pickaisle.induct2& k7 K8 T- l" w3 c
    while A_i<=30 do begin' R. H) r+ f  A7 z9 _
        travel to pickaisle.con(A_i)
- _0 K! f$ H) |0 }1 h( o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" h$ |; W% r& J4 K# e3 |% G3 I) K
        else wait for 10 sec* P! x9 w$ d& t5 Q
        if A_i=A_leave then send to die
+ j7 W1 g5 y6 b6 ?2 \4 C        else inc A_i by 1
; y* I+ o) @4 Y6 ~3 s0 i    end3 @' Y3 `  ~5 C# H
end
5 B4 M+ J3 `& w
0 i, S+ X7 ]% j* i9 V  _+ ]$ fbegin P_pick3 arriving5 k1 C6 m% o4 P6 R& ?7 t+ J7 F
    set A_i to 21
1 c9 U! P+ f/ ~7 B; O* M7 s3 U    move into Q_induct3
8 }. m" K# y8 a# J" E! S    move into pickaisle.induct3( i- m8 Z2 M; S; W
    while A_i<=30 do begin
: @9 S* \/ i/ M% e& f* G& z        travel to pickaisle.con(A_i)0 f; {1 g1 n! u* W7 p+ |8 R. O2 v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- i; u% o, \! ?1 {; B# l
        else wait for 10 sec
( _2 O1 H; Y0 B8 t        if A_i=A_leave then send to die9 [' k9 k: n' B( ]. o
        else inc A_i by 1' H2 V7 ^% e4 G0 a4 Y& j  p9 E9 f
    end. Q; p! G& ~3 A  l. k
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是个什么东东?
3 |5 B, d. N$ e+ c8 S6 Bmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) p8 @, l! ~; i. f2 c) }( H
' F" U, j' P( OAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% i8 W& Z8 }, w5 J, V3 V5 x+ G# x- W% U
  B' }0 N+ G5 c+ Y# T
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 q9 Z* p! U- N$ r1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) ]: K9 f0 U, ~2 C
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
* d& r) G4 b. y3 P3 ]3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) E2 Q( D: G; u2 a2 z2 f, ybegin P_induction arriving' P7 |; ~: k5 }& F8 p
    clone 1 load to P_pick(A_induct)* V$ C4 y: m/ b  a9 k
end最大的系
( N: \- s) _5 ?. x" n2 W8 L& }8 e3 c% }6 X4 t2 s# E
begin P_pick arriving
" f! R# y+ W7 v    set A_i to procindex * 10 + 1
, L; y; x. w7 p" C/ ^    move into Q_induct(procindex)
3 z: c4 S" F0 C" E) l    move into pickaisle.induct(procindex), y- P9 a) L# I: T
    /*check the type of pickaisle.induct(i), for your last problem.*/
1 n3 W' {( |( y" v0 D1 l+ s( Q  M- V7 O" E& g, a+ e
    while A_i<=30 do begin. J0 g" N( b! h( Z  \. Q
        travel to pickaisle.con(A_i)
6 o% e% @6 r* c0 f: p. X. a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; g5 D& a0 T7 x$ n& i2 i3 X
        else wait for 10 sec
6 n$ f$ d9 r, h0 V# e1 d        if A_i=A_leave then send to die
" U0 t/ E6 c- {( ^* j. V% r3 B9 J        else inc A_i by 1; D' Z% J) x% @2 [  F' }
    end+ ~4 U" }- i7 X) c* c
end
4 B+ T; h6 B6 u5 R$ w- J! j5 n2 ]# h
其中的procindex为整形,代表当前process的序号。9 J. I7 k) R6 K- @( t
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-3-15 02:02 , Processed in 0.024008 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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