设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15367|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ c. F" O$ q8 w/ F9 h" ]
" }0 f/ Q$ t7 I9 ^8 O- F
我的问题是,在每个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中的数值,不知道会不会有什么不妥。  J/ S) I( X7 m

/ c- O# t: |5 D5 S  x( R5 s1 V5 {begin P_read arriving6 u2 y! ^) j6 m
    while 1=1 do begin
, Z: [# C8 V/ B        read A_tote from "data.txt" with delimiter "\n"
# [! _% w$ L0 w! u% J5 D$ ^        read A_time from "data.txt" with delimiter "\n"1 o8 U1 z6 }3 }/ H8 @
        read A_leave from "data.txt" with delimiter "\n"7 k( r" h1 E1 I& @
        read A_picks from "data.txt" with delimiter "\n": G% l4 Y0 j- N: L/ }
        set load type to A_tote# O8 ~: y4 t3 z. W: X# ^' \
        if A_tote="tote 1" then set A_induct to 1
# m! r; q; F% q+ F        else if A_tote="tote 2" then set A_induct to 24 k0 I& b$ o* q- ~( ~
            else set A_induct to 3   
+ c) v: M6 m. s5 z        set A_i to 0
% p( ~* Q2 l& E2 n4 C9 N4 u        clone 1 load to P_induction7 C" [, e% t  M# s- G  z
        wait for A_time sec3 `% Q! V+ b$ v' G: J' m; m
    end; a+ p8 {, H1 Y7 E  ~5 @( H9 U0 O
end
  R6 g+ V; [5 s; m# N; d$ n/ v3 b9 _' l8 C2 w0 u  i1 B
begin P_induction arriving
' [/ J7 n+ q  E( S% V    if A_induct=1 then clone 1 load to P_pick1
9 ?: K% w' h2 J6 t6 K    else if A_induct=2 then clone 1 load to P_pick2
* L) `; X. P; a: b4 @        else clone 1 load to P_pick3
; t# g  z; ?+ H* t$ F) i6 F1 jend- c5 B" s/ d. B. F; m  |3 ~9 o
# {/ W! ?' q& Y1 E5 V2 Z
begin P_pick1 arriving
# X/ ]; ^8 L6 c- a8 |8 D    set A_i to 1
: o, W! Q" c& I/ F    move into Q_induct1% s" J% |& w  G
    move into pickaisle.induct1
, x% @1 e% m; a    while A_i<=30 do begin
& K+ j! ~7 m( Y. l; i& Z* i% P# Y8 P        travel to pickaisle.con(A_i)6 S  _& X7 j( M7 k: ]4 P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: t) F. N$ v! m6 r8 F4 M        else wait for 10 sec
6 c1 `' k  ?, s8 ~; e. g        if A_i=A_leave then send to die- u( s( X  q! o  ]. z2 U6 b6 A
        else inc A_i by 1# t0 |0 ]5 w9 g* x
    end
: J8 y6 b$ U# ]9 s" Fend' E. Z, q. u" V
9 ]( }0 `) O% a% J6 @$ ~( j
begin P_pick2 arriving
: I  S% C6 e& K/ S+ L    set A_i to 114 b# J8 |7 p' H* ^
    move into Q_induct2
0 I0 \; a6 S' J# e( \& O    move into pickaisle.induct26 m: Y3 O: y6 o2 t( e
    while A_i<=30 do begin
& m, I* C. f7 e) p* g- ?        travel to pickaisle.con(A_i)5 |+ e% q) C0 D+ I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: h! ~5 C( O% g+ }5 ?) x
        else wait for 10 sec
  R; a4 q: g+ O7 f- H; s, h/ U& u        if A_i=A_leave then send to die1 Z( W) j, ~! P5 T
        else inc A_i by 1
) [# w+ Z9 @9 v) k    end
/ J, i3 r* A9 _) T/ `end+ D" B# ^! G, H/ t2 d& Z

6 o3 ?4 I# i. d# q: W. Tbegin P_pick3 arriving
" h* k+ Z( u$ o0 P    set A_i to 21
/ v$ u* ^, y' Q& Z; R' r) S2 G    move into Q_induct3
( {2 V) ^8 Y8 x6 ]    move into pickaisle.induct3
. s% s* G4 X, x+ z9 K    while A_i<=30 do begin
9 t8 _$ d, C0 K4 g+ g        travel to pickaisle.con(A_i)
8 _% X+ P4 m+ ]. J4 N9 t+ L) T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 G9 ^& k# Q. j8 e# \; ]        else wait for 10 sec7 R$ R. }9 m& E2 r
        if A_i=A_leave then send to die
$ s6 `" a/ ~: n& l* \        else inc A_i by 1
( ~- t6 v, m: @+ G  S/ p9 T    end
$ e# E0 C' n4 ~4 V0 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是个什么东东?; c8 j9 r  S1 M/ I% `
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; ]3 t# O( _/ B7 L% I! J  a
* q! y" ^, [! I6 V  s
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) k/ F, a8 o6 F  u3 H# P2 R
1 ^6 G$ O, ?% r4 f
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
# M5 ]9 g  L% ~# d$ |  A% j2 U. N1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 o6 {* q8 X$ c$ z( @2 b2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ v4 P5 V$ h$ J, ]3 Y$ I  c3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 G" H3 V" R: O+ A( n
begin P_induction arriving
+ z! Y+ S' }( t/ H3 J4 N    clone 1 load to P_pick(A_induct)
- w" n6 i5 y! k& ~" A' s  Yend最大的系
5 r" J/ r* d9 [1 j+ }$ x( I; }5 {) V
begin P_pick arriving% Z/ {% |* I2 y; H( S6 P
    set A_i to procindex * 10 + 19 c8 x4 F& U& U7 Q  }
    move into Q_induct(procindex)
1 v$ c* n/ O. f2 M1 R- p7 }    move into pickaisle.induct(procindex)
5 {( g) v7 s. E+ G3 U    /*check the type of pickaisle.induct(i), for your last problem.*// _* Q# n  c( ~/ [

- v7 J! Q/ R$ J4 }8 n8 N    while A_i<=30 do begin5 {" p3 `8 X7 C. ]
        travel to pickaisle.con(A_i)8 o2 i- v- M% g1 k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 E% H& u, L4 @8 D0 `  H0 z+ s. z( @# f        else wait for 10 sec
7 l3 q* S' y& b% H        if A_i=A_leave then send to die& a2 Y. F6 l& l/ I$ [( v2 y7 E
        else inc A_i by 1
6 x3 m$ j% B* ^    end
3 j1 i2 n, X. |& h2 w3 V6 {end, R( r+ \, d; |' b7 d

3 [1 g5 h- e" s6 ^+ h其中的procindex为整形,代表当前process的序号。" S# O+ V& g3 n) }+ y
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-9-6 03:38 , Processed in 0.017341 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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