设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15259|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 j) f3 p* n* g, P/ Q3 x" ?6 ~! C" i% A0 T
我的问题是,在每个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中的数值,不知道会不会有什么不妥。0 \6 c! j( \4 A! V

& c, o7 ~$ Q, w2 o) c: gbegin P_read arriving
: m- N! A2 \$ d3 f& j' P1 |    while 1=1 do begin9 l6 k& o$ S5 t4 q: a& w$ `% p
        read A_tote from "data.txt" with delimiter "\n"
0 X, \/ h) C% @" A        read A_time from "data.txt" with delimiter "\n"
2 E) G" x& ^* ~2 q) t( ~& Q        read A_leave from "data.txt" with delimiter "\n"& ?5 H* _$ }( c5 D2 x
        read A_picks from "data.txt" with delimiter "\n"
: X3 b) L  [( w/ J        set load type to A_tote
  i  }) }4 l: b        if A_tote="tote 1" then set A_induct to 1
5 Y/ n7 x& G0 X) T        else if A_tote="tote 2" then set A_induct to 2
5 H  F2 d& ^: ?. ]8 K- D: I9 j            else set A_induct to 3   
9 F$ [) H- J) w. M1 b5 {        set A_i to 0
7 @" c- k3 B+ Y! M+ {2 F: T8 z        clone 1 load to P_induction, g* o9 R1 [* g8 ^+ C+ X7 K
        wait for A_time sec
# u; U; }. G& k, N4 N    end
9 R8 L( g+ I' Z0 Z! q$ v0 bend
5 r% M+ m& \7 [0 a9 r' y
+ A/ V* `/ d$ [# \  L& n# z, W! Nbegin P_induction arriving! N# i7 |# \* ~+ e: A+ B. |
    if A_induct=1 then clone 1 load to P_pick1
6 S- R; t2 M% M: W" v3 R    else if A_induct=2 then clone 1 load to P_pick2
" y0 @  H) V6 N1 P        else clone 1 load to P_pick3; p. h- E: w, t6 ]# @
end
' z8 R+ m( f8 }8 t1 R' e0 J0 t) x6 @" q& m  ?1 t; B$ f  L1 J
begin P_pick1 arriving
1 |1 z! C1 o% `, o7 K9 f; V3 l    set A_i to 10 O' Z0 O) G( b2 n6 {# t# G  l' m
    move into Q_induct1* h& h$ Z) k7 h( m! O0 a. }
    move into pickaisle.induct1
, n$ ~: r5 l/ _9 c6 ~, e    while A_i<=30 do begin& K& D8 T% h3 N* S! L0 D& x+ E3 A5 Z/ x
        travel to pickaisle.con(A_i)
& q1 {! b7 x: x8 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ y' g8 i) `1 v9 B# y* o% W+ K        else wait for 10 sec* Q, n7 Q& Z3 a' v5 X7 C
        if A_i=A_leave then send to die( U1 b' l  c* ~% s$ L
        else inc A_i by 1' ?! ]+ [4 [% u; L2 H0 T0 {
    end$ H+ w0 v; ]  @- A* S# W
end
: L, H" p/ C) w
. f: a& g# x: c/ i5 H; dbegin P_pick2 arriving1 ^2 z& K1 u$ V  F2 S
    set A_i to 111 {3 ~  G% x6 ?1 W' n7 H
    move into Q_induct28 J* K$ I( e# \9 f8 c/ ?6 c
    move into pickaisle.induct2
! n$ I$ U3 o2 U2 ?" V  e    while A_i<=30 do begin0 p5 i% o: P4 ]; }% C
        travel to pickaisle.con(A_i)0 v' K4 A% x: b& E% K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% J0 f; N" w: r4 d# n2 ]        else wait for 10 sec
9 b) @1 `" C$ \" P  U( o7 {$ @        if A_i=A_leave then send to die
' v7 [4 `$ ^- n4 e$ s        else inc A_i by 1$ Z' F. \1 L# k! H$ _
    end
/ s$ m; T/ p/ l8 h& A' kend( S* U8 W; }6 _. p
& `' ]' O1 Q2 w) K6 P
begin P_pick3 arriving; k# a' Y  U' g' I
    set A_i to 21
* M) ^2 v% O' k8 D/ }  `    move into Q_induct3
- o6 M1 D- S5 X: f% Q0 ?, L3 N$ L    move into pickaisle.induct3
4 T' M. P; b: b# P7 Z    while A_i<=30 do begin7 h. o9 g, H& h4 K. g7 _
        travel to pickaisle.con(A_i)
- p( U* R( J+ m7 I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- c2 T8 t9 s3 H
        else wait for 10 sec; q( b' Q/ _' ~- _4 U/ i3 a
        if A_i=A_leave then send to die' Z6 A& ?8 Q. K, C
        else inc A_i by 1
' ^: F$ s% a' {+ ]    end
! E  a8 [) j8 Q5 M2 ?- C( N# a7 Mend

最佳答案

查看完整内容

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是个什么东东?+ [5 A) w0 Q8 \; w5 I& u: ]/ K& e; u9 I
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  \/ o8 t" x) h( E9 F. I- A. b# w2 A, Y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 [* s% D8 Y0 _7 G# O  E3 {

# ]- Q: Z! o1 e% W- v# @# _4 e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:& m8 K! G, v" Y4 O1 |$ ]
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  E9 v, i7 ~& F2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! C( F: t( }8 y6 Q3 b, f# N
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- [# e: z1 e* J7 N+ L7 ~begin P_induction arriving% R1 K$ t" H# S. m3 {+ z
    clone 1 load to P_pick(A_induct)
) m# H! S# X( y) [  o" yend最大的系: y. K) D4 B- c# b
& c7 o, G0 l% G3 R- j7 B
begin P_pick arriving/ S% }; r5 f: ^2 T0 q, w
    set A_i to procindex * 10 + 1+ J% Z1 M8 X2 u' G9 I3 {
    move into Q_induct(procindex)) d  Q, a* R: o: C% A
    move into pickaisle.induct(procindex)
- p6 q" o# ?' o1 @. V3 ?9 S    /*check the type of pickaisle.induct(i), for your last problem.*/
) ~+ J/ j1 R( L2 q$ C; w% W- H. _+ o  Z" r" P
    while A_i<=30 do begin6 O) ]5 f/ b- T5 ?' k. D- H1 G
        travel to pickaisle.con(A_i)) A$ g" A' ~, [: j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 L' }/ N% E' r; \- h" r" D
        else wait for 10 sec
9 L  W% s: }, x. F: k3 u1 L8 @        if A_i=A_leave then send to die
% D2 J; P! {* @7 d        else inc A_i by 12 k( G) L' N' p( }' i! y
    end
, w# f  [" W6 H4 [end) F5 M* c3 U* h! Z
- f) {" _8 G  I* Z" p2 O
其中的procindex为整形,代表当前process的序号。! ^* q  ^& b+ U4 R4 {0 Q. [6 g
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-8-28 06:01 , Processed in 0.016124 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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