设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6261|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ E/ t* a% {( J6 j% t" E( J
4 K! ~7 \3 J" g
我的问题是,在每个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 e* Z3 {. G2 p
' n; b% F1 C- ]) M( Ubegin P_read arriving
3 c5 V/ d& i( _, A    while 1=1 do begin
+ s. `9 o" N* v) Q        read A_tote from "data.txt" with delimiter "\n"; b9 @% ^8 |" i/ h) V. m/ h
        read A_time from "data.txt" with delimiter "\n"* x6 k/ B9 ]1 n$ g0 a+ E
        read A_leave from "data.txt" with delimiter "\n"
9 n6 {. P" X: f/ Q; ?5 E" ~        read A_picks from "data.txt" with delimiter "\n"# `. m3 @" I$ b" _* G
        set load type to A_tote, J- \) r  w( y% d# Z5 b
        if A_tote="tote 1" then set A_induct to 1
9 D0 _# g1 x/ G        else if A_tote="tote 2" then set A_induct to 2
; A0 }7 {5 g3 `            else set A_induct to 3    * N" d: C8 p6 n
        set A_i to 0
8 l/ J, E; ~% I2 R        clone 1 load to P_induction8 q! D( r+ }: F/ x
        wait for A_time sec2 M& B+ g: `2 g$ e8 r6 J
    end
0 }: z9 T1 j2 d7 X7 g& x% k% Hend. D5 ^* @0 R! d$ F5 _
5 }+ J5 K* V3 m
begin P_induction arriving' d: f: K" q" F  t# a
    if A_induct=1 then clone 1 load to P_pick1
; u1 _. n" h* p* s" D    else if A_induct=2 then clone 1 load to P_pick2! M+ a' Y7 a$ D" v" z
        else clone 1 load to P_pick3% T' M( t) Q& [/ N* @8 i
end
* A- B; N' n- j7 S4 C" E& m$ a1 _7 b, B8 G# I5 i# k0 p4 m1 m- m
begin P_pick1 arriving
( S) r4 Y; ]7 j    set A_i to 1
$ T4 V$ f2 J- B) S& J5 t  K! W    move into Q_induct19 d) [5 Q0 N' B  C
    move into pickaisle.induct1
8 z% c, R1 i& ^- b/ ]    while A_i<=30 do begin% u. C3 F) k1 _- l
        travel to pickaisle.con(A_i)
' U6 {* X# M/ ?3 U+ k  \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; Q( ^3 {* E) ?        else wait for 10 sec/ S$ I2 Q! v' d- f6 u+ }+ j
        if A_i=A_leave then send to die
1 @2 k8 Y( \* }+ n9 H3 r6 C. U) \        else inc A_i by 11 [0 t9 b5 d& j1 Q/ e
    end
6 T' e5 r5 D' |end% l0 l7 D" d: Y

' o& \, u# G0 H( Y+ @begin P_pick2 arriving
. j: {* c8 \  S1 `    set A_i to 11
& W: Y' {% Y2 g- E9 J    move into Q_induct2
- T; c, ]2 z, x* s    move into pickaisle.induct2
" O4 W( K5 s! Q+ D4 L3 ^    while A_i<=30 do begin
# E1 T, d6 ~- x0 [5 x        travel to pickaisle.con(A_i)) X$ @: ?/ s7 B% W) c- y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! C1 y; G$ E. v  N2 K$ L# v        else wait for 10 sec/ E; S3 u7 B/ u' X' m
        if A_i=A_leave then send to die9 O0 x1 L% l2 Y* n, T
        else inc A_i by 1
/ N* U& h& a+ O4 W. S7 P; j    end3 o3 V: g1 B- O- k. S8 K
end1 c( u( a) o5 L( D# x

7 t1 z2 a- n1 n! `0 V4 mbegin P_pick3 arriving
( H2 L7 |* Y4 u/ w  e. y    set A_i to 21
5 c5 c; I" E& d) C0 |$ }    move into Q_induct36 `2 v. Q2 t& ]% h: f# u
    move into pickaisle.induct3
8 j( [' f  n9 w2 v& s" c2 k    while A_i<=30 do begin
- Y# j% V5 w- |) w        travel to pickaisle.con(A_i)
, m- C6 B# S+ A8 t% g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: ~# L/ b8 s7 }" R) O4 y. @        else wait for 10 sec
4 e2 d' K8 s" R5 a        if A_i=A_leave then send to die) l7 w' G0 v) t  I% C- I3 M7 a& Y
        else inc A_i by 1! \' |  B" v3 X6 V0 D8 E
    end* z9 H" K) s! n
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是个什么东东?+ M. Q0 h6 ~* @6 d, G( h9 Q7 s. M& |
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ C$ a7 r7 E/ K  ~% o( ]) a5 ~* N
3 ~9 Z8 u  I! |" a5 B/ \AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- S. z3 U9 Q. L  T0 ^0 }& c! P7 H2 D5 c. R9 {) Z6 b0 B
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
) w& j1 y# g, U9 x1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 R$ E8 X& [8 O* X! W0 i. s' u0 c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& K0 Z7 u  i! \/ Z8 |
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" y. h  q8 D, m& Vbegin P_induction arriving
+ F7 }  F) J6 H% g  |- K' f9 l    clone 1 load to P_pick(A_induct)
8 U) C% @) B& C* E) Iend最大的系( |2 K. N5 T7 Z' s5 s0 J" I# ~# i' ]1 I) x

' \% D; d" {/ T* S" |9 K9 Qbegin P_pick arriving
4 Y5 i* e& r5 G6 d, N& h    set A_i to procindex * 10 + 1
5 I" o2 a+ ~& J, N/ \& I    move into Q_induct(procindex)
. ?) G" k4 s' l( j    move into pickaisle.induct(procindex)3 w5 ]& Z- _' |/ F$ B$ s
    /*check the type of pickaisle.induct(i), for your last problem.*/8 p' q, U' U0 F: w6 k7 d; g& k

) n, k+ I4 ^5 v$ m# q    while A_i<=30 do begin
+ U) X  g  J1 D" |        travel to pickaisle.con(A_i)
8 q4 H" j. G! K8 c: C: s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  t' i5 v( x+ ?' j+ v: U3 y9 U
        else wait for 10 sec3 R) u5 k# @3 M3 d# c
        if A_i=A_leave then send to die
; m. _9 ?% ]- Z0 V/ F% C3 M" m: a        else inc A_i by 11 h( K0 U  p. c0 a2 l" u2 r- u& M
    end
: I3 U6 B/ k2 Z) O9 U5 x5 cend
% O: u* F9 |2 u- j( U( O
8 Y1 S' A) A. Q; @) b+ E6 H# O. t其中的procindex为整形,代表当前process的序号。- P# r0 B  H; f4 U0 `' L
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, 2024-5-3 18:12 , Processed in 0.014781 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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