设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11906|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, M7 Y  t% F: I! V* |
. y- O7 K& |3 z9 \* 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中的数值,不知道会不会有什么不妥。
; S; K5 k: X7 M9 H  T9 d: k4 v  j; c3 c) R
begin P_read arriving
0 K) ?. w# B6 f$ ?8 l! s8 N# N    while 1=1 do begin, T6 R4 k) ]& j
        read A_tote from "data.txt" with delimiter "\n"- ~$ G$ E3 }) Z8 `
        read A_time from "data.txt" with delimiter "\n"
- d% [; E3 q2 N2 K, ]        read A_leave from "data.txt" with delimiter "\n"
5 B0 Q+ E) O6 f( x- h" S        read A_picks from "data.txt" with delimiter "\n"6 x/ i- i) D) B+ o) {
        set load type to A_tote4 S" Q5 ~7 M3 X$ G# \; g6 e
        if A_tote="tote 1" then set A_induct to 1, t' [, x* I; D* ~
        else if A_tote="tote 2" then set A_induct to 2
) `% v7 }/ B- C0 q5 E            else set A_induct to 3    7 R! I2 X) \6 O1 U) v3 S
        set A_i to 0) U0 D, p7 A- `! \
        clone 1 load to P_induction4 b) X: Q  C& p  J; ]# U
        wait for A_time sec9 w( x& A) [9 y
    end
% s8 N  u, P2 p' nend
# k) T) l! L' i% Z% S9 C# @  A' i3 f% A# J
begin P_induction arriving& u# @) V. }" @; ^) t: L- G2 q# m# o
    if A_induct=1 then clone 1 load to P_pick1
8 F. @5 b$ A: m8 x/ ]( N    else if A_induct=2 then clone 1 load to P_pick2" q2 W! Y9 C- {: ]* D
        else clone 1 load to P_pick3/ q2 j% x8 }  x, L: {
end+ e- Y) x9 R  o0 A/ ]) s0 r
! U0 F" [' H# t0 I
begin P_pick1 arriving
0 y% i2 C  F8 U    set A_i to 14 A/ y) i3 S! Z6 a! b! f
    move into Q_induct1
% M& r$ N, ~7 \8 g0 P: |; ^2 w+ P    move into pickaisle.induct1( y2 E- a6 [' ?' g2 w6 L
    while A_i<=30 do begin
& N' D2 c8 V. B, R' N# C: o        travel to pickaisle.con(A_i)8 x- P; e: G, G5 t; ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ ]. O" h" Y. X5 b: \! i% U        else wait for 10 sec1 F, h6 z+ A$ X# z9 M* a% Q
        if A_i=A_leave then send to die0 u+ }% q7 S3 g- w
        else inc A_i by 1
' C- J' x% D" ^1 u+ A    end
0 Z4 b2 r5 u! ~" d% |8 Mend. R. r/ X9 i+ _6 m

- h9 U; _8 b8 [! G' Q& ~$ nbegin P_pick2 arriving5 K4 }, k8 o: n/ K: T+ h& U
    set A_i to 11; I9 M) f6 R5 D& g& z6 d9 }
    move into Q_induct2
$ n0 ]) I& [4 q" f    move into pickaisle.induct2  W/ y6 U$ d7 v8 i0 Z2 T6 [- U9 S
    while A_i<=30 do begin
* B4 }' [4 k1 i9 C& K        travel to pickaisle.con(A_i)
9 [3 ^$ _. K& G  W7 T3 G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) G0 _$ U, S$ S4 `4 m( \
        else wait for 10 sec- K) C3 A- _! v) [4 D4 z
        if A_i=A_leave then send to die
" w' M' K7 q1 P% ]        else inc A_i by 16 F8 V7 y+ a  y" K3 S) f% [
    end
* N% {+ T. o0 @+ T5 U2 p9 Y4 aend
' r, o& Q: ~* Y) B
0 R& `' A" Z6 S8 O3 fbegin P_pick3 arriving- |0 o3 |2 ?* w7 k5 K6 ~
    set A_i to 21
$ }3 G% ?& }1 k4 t3 T  i    move into Q_induct3
% n2 ?9 P, y; H7 O' L3 {  B    move into pickaisle.induct3
/ O& k' O. E4 N- K# Y% f    while A_i<=30 do begin" ?4 m( D6 w( i' W7 @, [
        travel to pickaisle.con(A_i)4 i" X/ q* q7 u' S, p  {1 U* V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& P+ _/ L$ g% s& n, e. A        else wait for 10 sec
' T# h6 x, j' Q( q6 r' z        if A_i=A_leave then send to die0 m8 z# }' ~$ V0 o9 ?
        else inc A_i by 1
. n2 ~2 ^; {0 M, b% w    end) F! O- W1 o" I  @* q
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是个什么东东?
/ o. f: \# {4 D& O! ]move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( [% h- p& y$ v  m2 A# \
; ]- ~8 I: |# G* F; d1 DAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: @3 w- K" g' Z3 t4 `4 E$ P
! C! H/ e4 x$ Y7 l4 \# S: K# z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 u! L) c$ z% v+ U: W" z) T/ [
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! x; N# e( s1 I2 q' n3 U8 B! u2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ F* W) e; j8 i. B3 w. x* f( m
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 u& e  p) E' I+ `2 x7 hbegin P_induction arriving, Q4 p3 N  k* d8 I6 \, \4 A
    clone 1 load to P_pick(A_induct)
6 V# J7 p! x" m  ?end最大的系' Z' I* H' y$ u- h0 D  K8 Y) M" o. d
9 P" W- b; M' G6 Z. P
begin P_pick arriving
* ?$ g# r/ I& j  w4 M7 S. H' {3 [    set A_i to procindex * 10 + 1; r6 V' ]( _# y5 _, x
    move into Q_induct(procindex)* z2 J, c8 |( n# }: @7 T7 p
    move into pickaisle.induct(procindex)
" x+ ]3 n# N9 U9 u5 J    /*check the type of pickaisle.induct(i), for your last problem.*/1 k0 ^! [" c5 q' o0 P5 c% b

# {/ r1 x/ Q" D; ]" W: o    while A_i<=30 do begin
. i3 z2 }0 N: o: ^        travel to pickaisle.con(A_i)) [' W1 ]8 u' t% y" x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 t) w5 f/ p  M' @        else wait for 10 sec
/ ]: k4 \+ }8 H        if A_i=A_leave then send to die3 b6 {" m. _7 m: ~/ [
        else inc A_i by 1: @4 r; Y) v) _# @3 s
    end
- x' Q6 a# ^3 ]: H# bend; o0 {! j; K+ ~/ M& O# o# e
7 l7 x) B3 M7 J9 ^3 L
其中的procindex为整形,代表当前process的序号。
& i  Z. e# l1 L# x4 zstation和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-12-14 11:39 , Processed in 0.020584 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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