设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14285|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) z1 ~7 t) \7 M% I6 [- @
3 v2 d7 o" t$ P
我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 _1 N: L. Y3 S; j, j1 f# m6 {

' x9 x- x3 m9 ~! U5 d2 J& F; C, Cbegin P_read arriving5 s6 D% g/ [. Y+ L( v$ ]1 z. B
    while 1=1 do begin6 t3 m7 C8 `- Z! E5 L/ N
        read A_tote from "data.txt" with delimiter "\n"! Z3 V; O( b0 V! D; q
        read A_time from "data.txt" with delimiter "\n"
& P* D: }& s& w9 ^) X8 K3 \7 e$ [        read A_leave from "data.txt" with delimiter "\n"3 S/ x0 y! u. |& s& b  v6 [
        read A_picks from "data.txt" with delimiter "\n"$ K% k' |; `: ]7 r$ i4 S9 w
        set load type to A_tote
+ o  }  A2 I+ @0 T: a* s. P+ Z        if A_tote="tote 1" then set A_induct to 1
' i2 K8 ], a% R. U! N# X) z; l7 \        else if A_tote="tote 2" then set A_induct to 2) y- D+ ^: ?! @6 l  U; R$ k* I
            else set A_induct to 3   
# Y( O+ M+ r. m9 F0 G        set A_i to 0
9 _: z( U( Q' ?7 E& H( |2 u0 b        clone 1 load to P_induction; o/ j* q$ p. h$ S& F$ p' o
        wait for A_time sec/ V8 y. J- a+ ~7 F; x+ b; B3 d
    end6 J) O5 h- ]9 i  Y3 o
end0 z- b3 H4 c1 f5 j  r- A5 D& c( M
# w# J5 m" q, z! _$ v
begin P_induction arriving9 H; s6 @. B1 F3 h
    if A_induct=1 then clone 1 load to P_pick1
# K" A0 j, M+ K' d" M    else if A_induct=2 then clone 1 load to P_pick2
: @) }: L6 I1 @/ r/ B2 m* x7 }        else clone 1 load to P_pick3
7 A; \) D. N  O! c" Y8 Hend
; L! |+ s- h' k1 X; _1 t
4 ~3 ~0 E9 F7 B. Y8 dbegin P_pick1 arriving# [% @; h2 J- G4 s4 O
    set A_i to 1
: U6 C9 q$ K9 |; j    move into Q_induct19 [6 o) ~5 Y* f' \. Z" I( O& g& o
    move into pickaisle.induct1
6 X- f, B0 B, `& `& e4 S! I    while A_i<=30 do begin; h% g" N& P/ `* r
        travel to pickaisle.con(A_i)! K$ R2 x! R' u. J& L: l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) s! v3 t/ j! k$ z8 I1 b" ?& U
        else wait for 10 sec
. Q& h: x; Q( m        if A_i=A_leave then send to die2 l  K: z: S! m4 P8 r
        else inc A_i by 1. T2 c' k0 q" Y0 A+ R7 i  |& M
    end: ?  ~7 y+ w, ]- |. `9 L$ T
end0 N8 o! H- N7 `, F: s* L

# l% b" R) t! @$ A+ m9 L4 ?begin P_pick2 arriving
( x# D. v; p6 U& o( ?: f& l- c# o    set A_i to 11
: X7 q7 N- j6 A) `0 G5 @& p) i    move into Q_induct2
& c6 I$ H( o% ]: \    move into pickaisle.induct23 T; g- ?" S$ i2 j0 C) n5 ~
    while A_i<=30 do begin
( ^2 [. t0 Z2 l- n5 z- b3 y        travel to pickaisle.con(A_i)$ R9 E  ]2 x9 J, r' Y9 e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 X* u5 A+ Z' x1 v+ w7 t- i        else wait for 10 sec' ~) I& b) u- ?& d
        if A_i=A_leave then send to die
2 @1 Q- s, H" u7 ~( z        else inc A_i by 1
! T" q0 i) x' v1 G4 B; t5 V    end6 ^* X0 y- k9 W! }
end4 c( I6 b6 w, {2 O- P

8 [0 \$ [6 `' L5 _6 E3 c1 ^6 abegin P_pick3 arriving8 e' g- p8 r: |' n% |( L. p. L3 P  Q! _: |
    set A_i to 21" S+ N- ^' h- S3 R
    move into Q_induct3# ]! f; j2 ~5 _' z+ u. P0 A
    move into pickaisle.induct32 j8 s" j  E" x2 a: U) P+ J
    while A_i<=30 do begin
8 J4 W3 @4 ]* ^/ ~+ J& v+ l        travel to pickaisle.con(A_i)$ [, x  |6 M8 F( y1 u1 v* W7 x) s( Y) R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 S% i, S& R4 Z! A2 z( L0 Y        else wait for 10 sec8 v5 W% i  S: P' Z
        if A_i=A_leave then send to die
% T' E% c, u9 a; O: d9 T+ C" R        else inc A_i by 1
1 b/ U9 V* }" G  Z. X    end
! Q: B* f0 D" \/ n4 h' X$ Rend

最佳答案

查看完整内容

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是个什么东东?
" [$ p  B3 i& ]- g) {9 Amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% B& m& }+ W: Q$ u: S4 x4 q2 B, X! a; J' K4 L, A  J+ O3 R. q$ s
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。, {1 b8 x: C# d$ f  G/ |! A

3 b4 F$ ^3 r8 B# \; I$ H- ?另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: q, r, X& W& f, K) w0 m1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 |' Y. B# d3 N, b, f
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 ]5 `' h: Z2 _' P
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  H9 \" F- p9 Z1 _begin P_induction arriving
# [7 |8 N4 f4 D    clone 1 load to P_pick(A_induct)
5 z1 f5 w3 v' Rend最大的系
/ R7 Y& K7 X- P- w+ t( _
) y3 y. V5 ]0 Abegin P_pick arriving
* `/ h7 ^) p" e$ a4 Y: a    set A_i to procindex * 10 + 15 G+ {! f# _* h% ~
    move into Q_induct(procindex)6 T5 v0 J! |: t: I$ r# D
    move into pickaisle.induct(procindex)2 a6 U. O7 R2 ]* v
    /*check the type of pickaisle.induct(i), for your last problem.*/
! m5 Z; E6 A$ k  D  Z  U" U4 B' e" s& q: [- H2 w. K, b
    while A_i<=30 do begin
% l0 a( p7 [! P. @$ A" H        travel to pickaisle.con(A_i), q. ]/ @; u+ v* }! O" H) t. W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 G9 j6 G; [; Y# P6 L% ~; C/ Y6 L; S
        else wait for 10 sec7 ]; i" S- p! X3 O
        if A_i=A_leave then send to die
+ m1 @8 A+ H6 P        else inc A_i by 1
; B, r1 y* n( j$ M$ ?: l    end
" J2 ]1 s% M9 s8 J2 |0 Y1 Cend- d! }6 v1 \! _; @& K

1 n% j: |* V. K0 l% M. O其中的procindex为整形,代表当前process的序号。
8 ]& j9 f/ Y/ p5 b5 ostation和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-6-28 06:08 , Processed in 0.013149 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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