设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14099|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( q3 Q; x. \6 W& X) k
( B2 H7 W# i! 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中的数值,不知道会不会有什么不妥。
' \' o: `; I7 q# H9 o+ M+ \
( P, ^8 a3 T% Xbegin P_read arriving
: z; o. V, ^( p    while 1=1 do begin
2 i# g# f. |+ ]9 t        read A_tote from "data.txt" with delimiter "\n"
( l3 z' g$ `! p5 Q$ w  A- p6 [! {        read A_time from "data.txt" with delimiter "\n"& E- N* R, p" _3 ^. W2 }: z
        read A_leave from "data.txt" with delimiter "\n"$ w( x' p/ L& q% l9 l9 b/ Y
        read A_picks from "data.txt" with delimiter "\n"; X5 z+ i. S, r3 f. `
        set load type to A_tote
" n8 l2 S* ?1 b( [        if A_tote="tote 1" then set A_induct to 1  z* D' A1 B4 N2 t
        else if A_tote="tote 2" then set A_induct to 2
0 h1 x) v' B  C$ m; Y            else set A_induct to 3    # G+ i2 \$ J8 E; J
        set A_i to 0
- @$ Y% @' W1 k$ F$ ?) g7 j        clone 1 load to P_induction
+ {* J" V$ i/ H/ b        wait for A_time sec* u9 s  V4 Q) T2 g/ B
    end
6 p) H7 O/ T" R$ T0 b$ Q. k  Send; h3 Q+ c* t" k  G2 C

! J# Z* P  v& y1 F" b& Dbegin P_induction arriving
5 g" b8 x) t3 @    if A_induct=1 then clone 1 load to P_pick1) W' Y3 c+ Y6 [/ @2 c7 U
    else if A_induct=2 then clone 1 load to P_pick2
' s/ P7 J1 ]2 P6 f, `$ p        else clone 1 load to P_pick3
/ m3 N7 ^5 s8 D: R& i1 jend
1 T7 E9 m; S  p. b& _$ Y" w0 C3 N6 S$ A0 h' H
begin P_pick1 arriving
# u7 @8 o# D# Q' U; B0 y    set A_i to 1. {; c! K+ U( N. d5 Z
    move into Q_induct1( E( B/ ], }3 K- x
    move into pickaisle.induct10 @4 z' u/ ^  U3 a- c2 Y& G
    while A_i<=30 do begin
8 u+ @1 C8 _' W  p2 Y        travel to pickaisle.con(A_i)( w1 U3 l$ \2 x7 `# [+ y# U9 P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 T9 i& k0 {3 C8 M% J+ [6 u
        else wait for 10 sec
7 Y% c4 m. n. n; L        if A_i=A_leave then send to die
) }$ R! o5 z$ J8 y  a* |        else inc A_i by 1
4 k; f6 `! Q7 R2 t0 u3 {    end
% p/ G/ Z9 [. t7 k7 Eend' j; H8 F- d4 ?$ ]5 \& m+ d

* P: N' a) W  \/ k  i. u1 Abegin P_pick2 arriving% n: [3 V- q+ M: ]
    set A_i to 11; _+ i0 `3 P4 i4 y$ F& S  S
    move into Q_induct2
8 o% X' j2 I0 D; E    move into pickaisle.induct2$ A; D- g' X" e: o$ T1 }2 y3 v
    while A_i<=30 do begin% b2 h6 ^3 b8 ^& n4 Y  i
        travel to pickaisle.con(A_i)2 Q0 ?3 O& @9 b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: z0 ?1 a. w+ F
        else wait for 10 sec' O5 R5 L9 X* J# ?  b, h2 s: \) ]
        if A_i=A_leave then send to die' E4 K- p% K3 ^9 ~. j
        else inc A_i by 1$ i! A6 w& t5 ^7 Y- i0 P
    end
& P: B2 I8 t: @" G, o5 Z, S' lend
. {( F7 o. F) E5 H& v0 {& l% S7 i% u: Y8 O8 t4 E: l+ Q- S
begin P_pick3 arriving4 d. k" o* G5 @! b0 i
    set A_i to 218 f0 g5 Q- p8 v4 ]* i, P1 H4 U4 e2 ~6 H
    move into Q_induct3
, S5 I$ I2 N( A+ @+ g    move into pickaisle.induct3
; h/ c  P  h5 s; G    while A_i<=30 do begin! e4 Y9 K8 D9 T5 ^$ Y
        travel to pickaisle.con(A_i)
5 @% R, |* W3 Q! N" @$ o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: X+ a7 F* Z, T2 l2 n
        else wait for 10 sec4 P& R( M# W+ l0 x
        if A_i=A_leave then send to die, u) J) a8 W9 |* H! ]0 `
        else inc A_i by 19 l3 o# \2 s$ L7 p
    end
4 O( }4 }  l7 O  S  \* T, ~* h" Nend

最佳答案

查看完整内容

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是个什么东东?
# e" G/ {# R* T1 y! Xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?1 B3 C: F/ C" v% F6 N( ?% Q  J

- }% I" P) S- t& T& o0 L$ NAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 Z  q) V4 d5 p- f* l0 {# B! K; h6 O$ Q
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" `3 u. ~! Q4 I
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
0 S; x: M: ^& w7 M3 D' s( N7 F2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 y* Y# w4 ^1 n
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 S; K; X( {1 Sbegin P_induction arriving
2 w$ f; ^4 j) l3 Z    clone 1 load to P_pick(A_induct)
; ~- D4 b3 u8 B; Z2 z, o) c' }" Rend最大的系
5 y3 c. C+ A. d: S- Q0 g3 U6 a  m8 N) Q
begin P_pick arriving
  t( V/ K4 w% a6 O. Z    set A_i to procindex * 10 + 1
6 O$ f+ E6 l2 D/ t1 d    move into Q_induct(procindex)- y' ]* r% i6 {6 [
    move into pickaisle.induct(procindex)
! m  p2 U2 E6 n- _; _    /*check the type of pickaisle.induct(i), for your last problem.*/8 \+ x: x$ w, [1 m/ g) G$ q# P* H

; B) |! i7 b$ c- Z3 t2 J    while A_i<=30 do begin
: Y; t: |' K4 B9 p: {+ \9 m2 I        travel to pickaisle.con(A_i)- f$ [) q# E) p/ f( K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. P) V$ f6 [1 W% ?  Q& _3 B% n" Q
        else wait for 10 sec
$ L1 z# I# [, J7 u5 K        if A_i=A_leave then send to die
6 E0 T9 f3 C; V        else inc A_i by 1
; t+ P+ [- ?4 X, t    end$ R! f1 t% O/ u, g2 p! @( e
end3 L1 D& D# c5 ~& w6 }9 z
. O2 k4 }: n" X+ o
其中的procindex为整形,代表当前process的序号。
, C6 \4 _) C* ?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-6-8 18:54 , Processed in 0.014867 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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