设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13544|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 U0 H% R) |5 @- Y
4 F  ]  b, v! R9 a我的问题是,在每个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' x* ?4 u- y4 {/ ^
$ Y9 ]9 W  Q0 p" o- z/ zbegin P_read arriving7 B, \, q" d1 ~9 x, L
    while 1=1 do begin
9 I" t1 i2 i% R2 W        read A_tote from "data.txt" with delimiter "\n"
1 o; O- b; G' q& ?6 V6 s; K        read A_time from "data.txt" with delimiter "\n"
5 J* f' m. [9 D' J$ E! K& n# x        read A_leave from "data.txt" with delimiter "\n"' Y) w# y- m: j9 ~, B8 p" l! c
        read A_picks from "data.txt" with delimiter "\n"/ d+ U, ^' x3 h3 p
        set load type to A_tote0 w, s  {% @5 ?2 T, b0 c7 c2 n
        if A_tote="tote 1" then set A_induct to 12 m8 d8 u5 s2 `$ _
        else if A_tote="tote 2" then set A_induct to 2' h9 G2 s4 s, d
            else set A_induct to 3   
0 B/ U' W4 G. F, H        set A_i to 0: d: o2 ^% ~0 c
        clone 1 load to P_induction
3 V; q4 T, o; s  ^% [        wait for A_time sec
) J& F+ t" U1 a/ F1 h1 j! j8 Q8 |    end+ g/ F" I5 m2 o2 R
end
5 @$ D( J, o9 I2 j: P2 \
  u, O: g6 ]) O5 C; Mbegin P_induction arriving
% }+ [3 z4 ~1 Z, `    if A_induct=1 then clone 1 load to P_pick1
; Z5 R- w9 Z7 a8 I( h( I/ w    else if A_induct=2 then clone 1 load to P_pick27 _( d$ E- Q# J  j9 p8 ^2 C1 K
        else clone 1 load to P_pick32 L4 d2 X" ]& E9 z2 I, H' _
end$ [: M- u$ Q1 ~# w

. V- O  P6 C1 Y, r$ e% }$ Abegin P_pick1 arriving
  c* r+ ^. O5 ?' P7 K    set A_i to 1
6 Y$ U; c$ I9 v    move into Q_induct11 d& V/ e8 e0 t# a# o8 D$ c/ S* Y0 G
    move into pickaisle.induct1: J# n% F& v  G
    while A_i<=30 do begin
; `* K) n8 n8 I, Z8 s        travel to pickaisle.con(A_i)' @8 @  Z) e: ^1 v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) c2 @( s% }0 a% R        else wait for 10 sec
8 \9 h: {! a; m( a$ |- x6 G        if A_i=A_leave then send to die
$ x7 v$ I3 \7 t& G; h  O. t' R        else inc A_i by 11 l1 N! g* R' B! e$ B
    end
( H6 t& q0 ^& m) G& X  m. ?end1 V5 ?6 [  X1 d) _& R2 s* K
- v& E; o6 J+ Q- @8 u# o
begin P_pick2 arriving1 N- _9 E. [' x8 m; z& U/ }# e
    set A_i to 11" z$ N' j$ r" I# q* [) y. `; K9 `: w
    move into Q_induct2" }- U1 {+ E8 w) P$ I) |
    move into pickaisle.induct2
# z1 X5 ^  \/ ~% L9 V  o9 W+ {    while A_i<=30 do begin
# _2 Y' y, j  u5 a5 F) u' F        travel to pickaisle.con(A_i)
" w, I$ M- X0 c1 a( z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, k7 O6 M) [5 Z0 A- j$ J        else wait for 10 sec# a  L0 T* z  o& B3 g. R7 D$ }
        if A_i=A_leave then send to die: F4 Q/ D1 h% X
        else inc A_i by 10 P. z' X  m' y9 y  v
    end1 _9 e# D# d! z' g$ s# B% L
end
6 v4 h6 Q3 o; K; Q: g+ z; B
5 ?: K/ \- w( h; M% _begin P_pick3 arriving
1 B; c! c. h' u8 N; W    set A_i to 210 y5 w/ Q, N8 j$ t/ Z
    move into Q_induct3
5 ^3 Q/ w2 G. M, U    move into pickaisle.induct3
0 `# ]" {9 }% `# {) b    while A_i<=30 do begin
6 {  u5 z) X. |* }" M3 ~        travel to pickaisle.con(A_i)
, x& F  r, I7 R( B( d6 j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ k" s. F1 R9 X5 a# k* d1 v
        else wait for 10 sec
2 r& ?0 y3 p5 \2 I        if A_i=A_leave then send to die# l1 q) [. i6 l$ P
        else inc A_i by 1
+ n3 _( m/ x- U    end
' g1 o8 P# Y6 C+ \& b- @' M. X2 M2 M" aend

最佳答案

查看完整内容

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是个什么东东?, q3 `8 u6 J. G$ J
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?* n& u% ~4 [0 a3 P( ^  r8 }# U
; B+ l, ]4 ]* g  r: `
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& x% B: w: E4 Z( R* ~
, ]) S0 I7 g2 O. o2 m  ]另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, L# I& m4 `8 m, Z! S) a
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;1 b' K6 Y) a) o) W# g; ?
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 v4 h) y- E& g& J* a7 d
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ |, w9 Q4 c! x" Y& ubegin P_induction arriving; r4 t1 i* `. F8 ^
    clone 1 load to P_pick(A_induct)
& {& ]4 k! u+ xend最大的系
) z% |3 f+ P3 R% v9 C8 T3 l
6 y7 m& J( j4 w! o# L& g) Y1 Hbegin P_pick arriving- q. v7 S- R, C9 E# I
    set A_i to procindex * 10 + 1, A% A3 B' v, m
    move into Q_induct(procindex)
) g3 z# }! X8 {* c" N4 w, f+ E1 R    move into pickaisle.induct(procindex)7 s- c6 ~% V( s' K
    /*check the type of pickaisle.induct(i), for your last problem.*/+ ]6 F3 @. V4 B

7 I$ l' `5 |8 w0 M. E( Y$ Z3 H/ |: a    while A_i<=30 do begin/ K/ y& h8 f0 H7 c) }$ A
        travel to pickaisle.con(A_i)- ~% U6 `' @* L4 W6 |) i7 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- C) O3 E4 \0 }* K5 A        else wait for 10 sec
+ ?+ p4 a2 T( h9 c  k! ], l4 A, y2 w% q        if A_i=A_leave then send to die* a9 j8 q4 U! f* u: s: t
        else inc A_i by 14 v0 p, N8 K# }
    end
  F0 x/ x* A+ n/ pend
  W7 ~- B0 h6 \2 ]0 p7 o! K3 t  F' T# J8 O4 |1 i2 ]" p! N6 C* X
其中的procindex为整形,代表当前process的序号。% \  o, B6 Z3 x+ `1 |8 Y8 E' \
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-4-20 20:20 , Processed in 0.019491 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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