设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15024|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, Q- w3 o% W# N) M5 p) }. Q: R5 J5 h
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' a$ R/ ]* c: n8 a7 d& A, x6 A. Y

2 U; B3 B+ j4 I' H, I$ `( ^begin P_read arriving7 I) R3 y) u  E; E! u% k$ x/ y4 P
    while 1=1 do begin
" m" y, E2 z3 A+ S3 u, P7 ^        read A_tote from "data.txt" with delimiter "\n"
+ z) [( B2 M% k, i% U" W% L( w        read A_time from "data.txt" with delimiter "\n"
; ~5 k. I" O+ h: \5 T% s  a        read A_leave from "data.txt" with delimiter "\n"1 }& w8 o5 K% A* @' x) g, {! [  [
        read A_picks from "data.txt" with delimiter "\n", S" o, e  m. p$ l9 s+ Y
        set load type to A_tote1 x) C5 w/ q4 F; }
        if A_tote="tote 1" then set A_induct to 1
5 `- {# i9 ?+ |  G( j        else if A_tote="tote 2" then set A_induct to 2% v8 X+ \9 i6 `  {
            else set A_induct to 3   
% v7 U9 h+ ]! x! N: f% x        set A_i to 0
6 {, }- v) @/ X3 G        clone 1 load to P_induction$ h3 b' X5 v0 W9 c' v* {5 P3 f
        wait for A_time sec
" X' K" p7 ?1 ~    end
6 m4 a8 B0 q6 w# a8 zend2 c' q" S: w* J2 H. `0 ~7 n( I
( j0 e" V8 z5 k& I5 ?  ]
begin P_induction arriving
% G( ]% Q; f0 Q) t+ N! O* a    if A_induct=1 then clone 1 load to P_pick1) i2 ^. Z! ]1 }4 M5 A
    else if A_induct=2 then clone 1 load to P_pick2
3 X: |. z$ ?( @5 [        else clone 1 load to P_pick3
- l! ~) U" {( x( Dend
) F3 |9 }& N. X' `
2 T7 ?+ {: F  w  Zbegin P_pick1 arriving* z4 s% S, ?+ ^7 i0 N* ~
    set A_i to 1
: s" R$ |8 a' S  `2 V) `8 r    move into Q_induct1  P6 Y1 E  v7 M1 A
    move into pickaisle.induct1
4 ?+ m8 {, W& O& f! v' `0 L    while A_i<=30 do begin
% V. B! }) T' M' B        travel to pickaisle.con(A_i); u3 {  D" |3 Z/ y" D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 e3 M% g' E: K' O- D
        else wait for 10 sec, j# q5 \7 D1 W. [! }
        if A_i=A_leave then send to die
- X/ z; [" v3 |2 |8 p1 d5 q        else inc A_i by 1
4 i1 {; b7 E! [' O    end
& ?" W  T2 n& h! ?  m! \end
; J: G7 v' P, A5 w1 v) r0 g* `  b7 @0 A0 o) r& x- D* \
begin P_pick2 arriving
' A$ D; ~7 C! x+ n- M7 R; Z    set A_i to 116 e6 b& n" a- j# H7 r3 H
    move into Q_induct2) ]1 }0 w8 Z# Z' Z- u( ^
    move into pickaisle.induct2) A* k# x; n9 K5 z# E
    while A_i<=30 do begin5 _/ E. P; k* g2 l) G
        travel to pickaisle.con(A_i)- e" ?6 F2 t/ A% W/ M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- A( @/ L) I! `4 U. [1 ?
        else wait for 10 sec
4 b& a$ D/ t& V8 J0 t        if A_i=A_leave then send to die
& n) g3 v; V8 R& k6 R        else inc A_i by 1
7 _$ r! d6 z2 w: @    end
6 \2 \! L5 W# N! Vend+ @! @' f& a" i1 p
7 R+ j( ?* n  d+ ^5 d5 y* B9 u
begin P_pick3 arriving
3 i8 ]7 k) R: d4 w1 S$ S; E* b    set A_i to 21
, A+ S* M/ C9 ]+ i( v0 }  ^    move into Q_induct3
9 z0 F) A  A9 L' [    move into pickaisle.induct35 `7 I! |4 ]5 y
    while A_i<=30 do begin- q) [% S8 z1 W" v4 q1 v7 i, h- O
        travel to pickaisle.con(A_i)4 n# A, R6 ^  ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ `2 P1 C9 h6 {) v) M
        else wait for 10 sec
$ e( u% G0 b: w( y4 Z! v8 R        if A_i=A_leave then send to die" }& I; |& N) N! z  _1 |* ~
        else inc A_i by 1* Z1 C& ^/ s9 U. `$ V2 H
    end- W0 I! n" w0 X+ c/ E' o4 k* a- c( u
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是个什么东东?& _! h. |4 t( W- v( Q& s
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 Q* Z; n9 i$ b' ]/ m" }; G
- U' O( a4 |8 }2 JAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" t; I" b3 A+ B

, u. G8 ?, ~* U! w; h$ V% |另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 f6 O% s! @  T) C% d1 ?- u1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;  m4 {% e5 i/ a) f/ K; e
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 d4 s" ?& w) J+ V& x
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- ?% _; n" v" l/ h# d/ o: b
begin P_induction arriving
0 q2 w/ u9 @6 P! r' n( [    clone 1 load to P_pick(A_induct)
9 H3 e6 J# s6 l1 vend最大的系
4 b0 }/ k, I, X! }) X
+ c, \* k- G3 y6 Y6 ubegin P_pick arriving
: m, G, h+ ]0 t1 E    set A_i to procindex * 10 + 13 l% R4 N2 H7 R; A. Z# G
    move into Q_induct(procindex), |, ^1 t9 i! ?# E
    move into pickaisle.induct(procindex)$ M! S, Y6 }% T* x/ U
    /*check the type of pickaisle.induct(i), for your last problem.*/
0 `, Y0 i% `7 O, U' v: M1 a+ U9 Y, g/ ?7 x
    while A_i<=30 do begin
. F  l( G+ W9 i3 `        travel to pickaisle.con(A_i)
# I; c1 i* X" `. E+ r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( |/ f( D6 j$ @8 b) P) |        else wait for 10 sec* F  x) P! k$ o" r# X% C* @; D2 q
        if A_i=A_leave then send to die
4 B8 e3 `7 E: g1 C  H$ r4 T        else inc A_i by 15 {  Q: R. o. h
    end) B9 B7 c$ N4 g
end
# |, ]2 y/ e4 K, \. U) q) j4 c
. b- }5 W. M4 O3 p其中的procindex为整形,代表当前process的序号。
$ @+ ]$ I. f2 p& ]- ~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-8-4 19:30 , Processed in 0.022211 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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