设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11567|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' I% h+ Q/ s+ _, i9 @0 d* h( @

. h5 N% F; h2 G8 h# b我的问题是,在每个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中的数值,不知道会不会有什么不妥。: _( k  q6 G1 R8 a
. w, I8 ]" i  Z/ V* E" a
begin P_read arriving
  C( k3 q2 R0 Q3 n    while 1=1 do begin5 |) U) {. f8 k# T8 m& q; {$ |
        read A_tote from "data.txt" with delimiter "\n"
4 O, q0 S6 g# U7 [; c2 Z1 a        read A_time from "data.txt" with delimiter "\n"
1 W/ Q2 v4 C; F% O, W        read A_leave from "data.txt" with delimiter "\n"2 v8 _# \1 G, u
        read A_picks from "data.txt" with delimiter "\n"
) N( U2 E% s5 e4 Q- d3 P4 H5 u. L        set load type to A_tote& M0 {2 x# O; K( b8 C$ H
        if A_tote="tote 1" then set A_induct to 1
% X$ I7 @' D$ m4 v0 H+ s        else if A_tote="tote 2" then set A_induct to 2
" ~3 `2 n2 X5 v            else set A_induct to 3   
9 u) |0 d( T9 D5 v- q5 ~8 ?        set A_i to 0* I2 _7 K2 T, ]1 ?3 e" d
        clone 1 load to P_induction
4 w' J$ o: H! r6 O0 b        wait for A_time sec
8 @% f( ~0 d8 i6 e8 X! N    end; F6 d5 |( M) M' J" z2 A
end
* c" j6 A% Y5 a7 g9 o! g3 V
* E* I( E- ~7 V, f' ~5 d! ]begin P_induction arriving! p& B5 V! Y2 w2 j
    if A_induct=1 then clone 1 load to P_pick1
) R' e' @+ d: n# a. s( y    else if A_induct=2 then clone 1 load to P_pick2
" t3 |1 w: T% b7 }" M1 r        else clone 1 load to P_pick3
7 N' O1 U! d: m! N% ?end! I2 Y5 w" s# h9 ?! J  L' T# @
5 m, _. Q9 r4 N
begin P_pick1 arriving  I# N- Z# T. B" J
    set A_i to 1
; y$ B2 C; z1 r, f( w7 A" X  B    move into Q_induct13 P- \& [) v: S4 v
    move into pickaisle.induct15 o9 @" e% B* T, a% t
    while A_i<=30 do begin
2 n- U1 m* _. O( h        travel to pickaisle.con(A_i)3 o+ x+ W) L9 c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# ~" A: C& k% \, \2 T% W
        else wait for 10 sec! @- V# i2 f9 G( K1 ^. E) s
        if A_i=A_leave then send to die
5 ?) C0 ?' J/ F+ D; O2 J9 f, P        else inc A_i by 11 h! G5 o7 g8 S8 c; O$ ], ~
    end
( A# i* J# }, R. @" y; s# Cend  i8 @( y9 F. B5 `. w6 u3 d

+ A' Y6 }5 Z3 L8 Lbegin P_pick2 arriving
3 n* U  K& s7 c. c    set A_i to 11! f. U" B' R. @  ~3 }9 h
    move into Q_induct26 B# m* O7 d; @# O% R6 z
    move into pickaisle.induct2$ H; k/ ^' N* ~" I2 ^% _) o9 Y
    while A_i<=30 do begin0 D/ T# f* B: F! G: _( F
        travel to pickaisle.con(A_i)
4 E0 ^: `" f" H1 I; Y1 u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( e2 d2 S4 ^& b6 j' `* q. m5 Y        else wait for 10 sec. l) l' r3 I' T$ h. c& r$ P
        if A_i=A_leave then send to die# v6 p. {/ }" y8 i
        else inc A_i by 1
; y: w% w( m) |& w    end/ }' t& S* ]+ D
end
3 e' J1 @9 Z$ h7 p- q- _/ I" x# l! o4 o8 H! V/ U- M
begin P_pick3 arriving
7 m4 v$ I$ X4 U* o    set A_i to 21
: e# n; V% y; ^& ?8 B) _4 z+ O    move into Q_induct30 W) R3 W5 m1 l) ^9 Q" `+ f8 r
    move into pickaisle.induct3* W( I5 C$ I# t& Y( k/ a
    while A_i<=30 do begin
; f$ j6 p& u' |  b# h9 {  s        travel to pickaisle.con(A_i)
9 B: }2 S1 _( Z8 X  n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 S  v1 p% V' G) b4 Z% O+ C, `% q. I        else wait for 10 sec
; H5 F# O" t# P% j* _7 V; P- H7 ~; n) Z        if A_i=A_leave then send to die
$ p9 N# K5 U8 T7 a$ I7 E' t        else inc A_i by 1
# `5 }: `1 F- [, q& u- P5 d: [$ e    end
5 d# f" B; C7 R& uend

最佳答案

查看完整内容

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是个什么东东?& F+ f: K9 ], p* y9 }
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 C; x, h5 [) X% c  C  c% z% ^& ]! C9 G! G' `, D$ q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。# R7 ?' ~; }: Y8 H) c7 ^5 V1 [
! R8 A7 N6 b4 J5 g" c1 h9 ]# T
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 V- p5 t8 H. G( `$ y% A; D1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# w! L. K4 L, H6 Y0 Z
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- T, `0 K% D, K. `3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- s- z5 H5 y/ N7 B- Q2 Y, b- F/ q
begin P_induction arriving! l. A2 j8 l9 c" i6 ?! ?+ l
    clone 1 load to P_pick(A_induct)& b. g  @+ A3 F( _! D
end最大的系+ e7 T- M& B7 }
5 Y" T9 `& K) z6 p+ u( f
begin P_pick arriving
& q% m. B6 ~( c    set A_i to procindex * 10 + 1
- N4 c! }7 y  s- ?6 b8 o    move into Q_induct(procindex)+ k' Y4 }6 `4 [0 L, u- N+ ~
    move into pickaisle.induct(procindex)- B7 H6 Q, a0 m) r
    /*check the type of pickaisle.induct(i), for your last problem.*/0 H, D# \. W6 m6 R) ?" q, }

' z1 U# C0 N+ Q3 W+ W5 k( k5 O8 Z* |1 N    while A_i<=30 do begin
9 ]# Z' p7 |) u: M% o1 `( g        travel to pickaisle.con(A_i). b% R+ j. z; S! m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 D9 {- T$ ]- g' f$ S+ A  W        else wait for 10 sec. N- ]5 D9 S! X" P' V8 L6 o3 N
        if A_i=A_leave then send to die
2 `' i/ T/ K: r; I" m        else inc A_i by 1# ^; T, ~/ B: n$ x4 {2 M- b8 g3 l
    end
% J$ `7 h6 }) w+ @! `end+ H5 [4 Q, c$ f( Y

. Y$ t8 Y" R3 D9 I  c( A其中的procindex为整形,代表当前process的序号。
5 ?1 W6 E8 R$ `6 Z& n. Wstation和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, 2025-11-21 08:06 , Processed in 0.017625 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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