设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11348|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 t; }9 |8 ~2 ^3 m2 C
' L" {+ }$ C, L我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 ^/ m1 G4 T, x# P3 K2 V
4 n  B+ {* x% \begin P_read arriving
, m+ Y5 T% D5 w  K    while 1=1 do begin
( a) b  H/ _# P8 B: Y) ?        read A_tote from "data.txt" with delimiter "\n"# \& @! y$ y# j5 l6 Y& C; F
        read A_time from "data.txt" with delimiter "\n"( {% e  Y$ `8 p( E/ h9 s
        read A_leave from "data.txt" with delimiter "\n"
9 R  Z5 L: l: @* w" p        read A_picks from "data.txt" with delimiter "\n"8 ^+ c7 _1 a7 f, L& E- S% O3 @  Q
        set load type to A_tote- h; J- P- V* c( P1 l) `
        if A_tote="tote 1" then set A_induct to 1
/ P  o9 x; u& y) j+ X9 Q5 h8 ?9 B# w, M        else if A_tote="tote 2" then set A_induct to 2) r( i1 f: \: n. H
            else set A_induct to 3   
: Z' f2 S$ |' j) }/ s) P' f        set A_i to 01 |4 L: b, @2 D" r
        clone 1 load to P_induction% n$ C) T& r# S! ?; `+ _4 f$ B
        wait for A_time sec
  h3 J% r* S+ M  P: N- G8 g    end. y% Z+ t0 t4 _" o! b! X- l: p, S- e
end. p- @2 n1 H1 E. l2 P$ ~
9 I1 [, \2 G2 r" \) i
begin P_induction arriving) K  x+ ~% C) Z4 R% O; B0 f* {9 f' ?
    if A_induct=1 then clone 1 load to P_pick1
/ P6 S8 {/ d  \* ^% }. n    else if A_induct=2 then clone 1 load to P_pick2/ ~- Q6 R$ ~: ~5 M% }/ L6 _
        else clone 1 load to P_pick3
: k+ t# `  i2 Q9 |( C0 dend
, y# Y7 w, O: Z$ x+ W8 u5 F6 n
8 C( S' V; X: y, kbegin P_pick1 arriving
. W- b7 Y. |; t) s, v    set A_i to 1
/ }9 a' W& z8 i9 {, Q/ L% j    move into Q_induct1
9 O5 B, m8 N* @; M" J* v& S    move into pickaisle.induct1
5 g, v7 i1 k% u" o6 Y5 a1 E0 S    while A_i<=30 do begin
/ J4 ^+ j* G$ S. r  C        travel to pickaisle.con(A_i)
& J, `% ~) f6 s/ V0 i8 |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 Y  S: v3 g; m        else wait for 10 sec
9 Z8 [" x9 m# P/ l. E        if A_i=A_leave then send to die( ^. B5 ]  j. r3 r% K
        else inc A_i by 1. X5 n7 I3 n9 h9 p
    end) r% A4 x& B/ Q) o9 j, k
end
3 P6 K2 o1 F% p( ~
, w$ o3 l8 [" E9 y! bbegin P_pick2 arriving
2 Q/ c' R9 Z1 f- S. j8 K    set A_i to 11! R' T" M  J8 j) Q
    move into Q_induct2
* t+ W$ |! [# \, j$ c    move into pickaisle.induct2. h& j4 K8 H# j! S' t' ^
    while A_i<=30 do begin
' t9 O0 Q: P* g/ Q$ D        travel to pickaisle.con(A_i)- K# u+ C/ I7 m; q5 I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' z/ T" x4 Z. d( y. x% K0 o        else wait for 10 sec
1 {5 u4 {8 _  ]        if A_i=A_leave then send to die# m0 p$ S! H8 ]% z
        else inc A_i by 1. B. }+ b/ l% ?& S; N
    end2 |7 p& ~' p9 ^; P# J3 C' `
end: V6 s* t. h. h

- P/ B, L/ l* z( t/ i- jbegin P_pick3 arriving# n; L5 |+ @5 n0 G' i
    set A_i to 21+ L2 s+ S( _1 }) D# ?* |9 R
    move into Q_induct3% e% F2 o2 y- m9 L% q# q4 k( a' q
    move into pickaisle.induct3: V8 m# k- u9 y& T
    while A_i<=30 do begin: a' J# _4 O: x9 J7 m1 c1 {. i3 p
        travel to pickaisle.con(A_i)
: {) U) {+ Q. W7 m! P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 w% u" @( A2 P4 x. u. d        else wait for 10 sec
4 T  i3 S  F% x; v+ d        if A_i=A_leave then send to die3 E2 w# w# C0 f  a
        else inc A_i by 1
, c6 i- N' G1 ], Y  j5 C    end
. |) p8 h8 J7 {9 @5 B0 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是个什么东东?
' T) s) V& I( p/ z: k1 `move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ n& O2 E! B0 \! R0 Q3 T" ]3 y) r. W  z( x. n3 Q: A& H9 m8 G+ t
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: i0 n# @+ K; M& Z

) O1 o$ p( u6 a& o- a另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 a/ t) H( O" f4 P1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' E9 k' Y8 U7 a: B
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 r; c* a/ Q. w% w5 Y9 v$ w
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: n5 u7 K! ^. q7 H: w1 W' y0 t1 v
begin P_induction arriving% r; [9 _. p3 s; h
    clone 1 load to P_pick(A_induct)  x# i2 \; [# n5 E& @
end最大的系1 I) k& U( Y2 C. H

9 D6 c8 p" ^0 G9 Abegin P_pick arriving+ g) |8 \& ~1 r, Z( V
    set A_i to procindex * 10 + 1' @/ X( [5 s) f
    move into Q_induct(procindex)8 ^/ S( H9 k$ ~
    move into pickaisle.induct(procindex)2 u% d  s* |$ e8 k
    /*check the type of pickaisle.induct(i), for your last problem.*/
* P4 T% D, ^4 R/ a/ W3 m. z7 [7 P. P. ?( w& i
    while A_i<=30 do begin
9 y* Z6 G3 E  H: R: j% C4 Q        travel to pickaisle.con(A_i)2 e2 }) K0 Y% _5 q3 o) }( c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- q% d" v- Y3 e        else wait for 10 sec) l6 I- I! c( ^" a  b+ B8 H
        if A_i=A_leave then send to die
- f9 }6 t% }4 w" \) k4 L5 {1 v2 l        else inc A_i by 13 n8 ~" I5 J, k7 {; t: o) q1 i2 v1 _
    end
( `1 I+ H4 f, e  Z) Z4 Xend
$ {! [4 w- ?; G) k; K( K/ Z9 c8 K, ?" ]/ K) b. A& T3 K" C
其中的procindex为整形,代表当前process的序号。7 t" O6 \  E# Z; `: E) G: V6 I
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, 2025-11-8 13:48 , Processed in 0.019063 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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