设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13953|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ s0 G& Y! ?8 X3 T
" a, `* E6 n# [: t/ A- I& ?
我的问题是,在每个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中的数值,不知道会不会有什么不妥。; K7 J# m. W8 c$ P+ v" |' I4 y

$ c( b  o* Z! V; s. Lbegin P_read arriving
- D) \$ }- c; K8 k    while 1=1 do begin
& V6 I' I+ d0 j& b0 R        read A_tote from "data.txt" with delimiter "\n"
! ^5 E, g9 |7 ~4 x0 k: J9 f9 P) X        read A_time from "data.txt" with delimiter "\n"
4 B& k" y. ~% H        read A_leave from "data.txt" with delimiter "\n"
/ R* a8 s6 x1 ~+ r- K" a: q        read A_picks from "data.txt" with delimiter "\n": N# V5 D' \9 j6 a# Q3 d) [! n
        set load type to A_tote" u& H) s* D) Y5 H7 y2 P* u
        if A_tote="tote 1" then set A_induct to 1+ c* b, @/ B! I; x% z
        else if A_tote="tote 2" then set A_induct to 26 N4 Q3 ~1 `0 P; A
            else set A_induct to 3   
( ^: F7 Z4 Q3 B. W% X5 P( ^        set A_i to 0
- p/ S$ b2 y0 c) U6 }: M        clone 1 load to P_induction7 k# r* R+ s+ O9 j/ d" T1 U
        wait for A_time sec
; |/ o/ ~# L6 C) P    end
' x1 O6 c# k4 b# ~+ N( qend8 ^* d) [0 q/ {& h# e

0 u* z9 l8 H) E) Gbegin P_induction arriving
9 o. S' f' \6 e    if A_induct=1 then clone 1 load to P_pick1" d  u: Z* `% S5 j' T! C" t8 R) d
    else if A_induct=2 then clone 1 load to P_pick2
. k. \8 ?2 D& s/ F: l0 b        else clone 1 load to P_pick3! }6 O2 x1 z* c4 ?( c
end
% n! h% M( d# w: G5 ~
2 @2 O# p! S( N9 j0 u: qbegin P_pick1 arriving
( D' v' z# H3 P0 T' y    set A_i to 1( M, S2 b# P# q
    move into Q_induct1
# o9 m+ Q6 a0 ^$ Q! l! ^  c8 E$ ?    move into pickaisle.induct1( s3 i5 ?9 [( k7 a- s& h
    while A_i<=30 do begin
9 b4 ~: u9 {, S0 H: d* y* R        travel to pickaisle.con(A_i)
6 e. B6 c3 s( Z  j5 \) u: |; H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 u4 H4 h5 o+ t
        else wait for 10 sec' |0 N' C! T+ O' A+ c- P
        if A_i=A_leave then send to die3 W. E% R' N+ L. f3 W0 ~) s& T% [
        else inc A_i by 1) H6 @4 q* k. U9 \; h( X
    end
3 a  \/ R0 E) I- t# g9 S& lend, e% [) R! \. i/ ~
6 G9 E9 `8 |) ]: z5 h; p
begin P_pick2 arriving* M* F/ k+ k; G
    set A_i to 11" s" g; \7 F1 p: V8 g
    move into Q_induct2
' v" S5 Q( F$ M( E1 _; j) _    move into pickaisle.induct2% U: z! X% w5 l* I
    while A_i<=30 do begin  ?( c  A' R! Y' R! P) O$ M. B  }
        travel to pickaisle.con(A_i)0 f/ I- b) }) S* B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( n3 @4 L" x* G4 g7 W+ e
        else wait for 10 sec
  O) v+ i" R4 h" e/ C$ Y7 ^# [; P        if A_i=A_leave then send to die
) t7 P5 B( J- h, T( {        else inc A_i by 1
" c9 K/ o& E' |2 Y& \    end2 Q: y, R( b  U8 @# R; d
end/ L1 |% T; A( W
, X) f: m$ U" O2 D& P: c
begin P_pick3 arriving8 Q; T. d9 A: }) n  x
    set A_i to 21& x$ {) k4 v, u! s" n" s3 q
    move into Q_induct3& A) N' u% y1 V" y* v/ [
    move into pickaisle.induct3- ~$ U- `6 Y1 ]- L3 }/ S* p7 \
    while A_i<=30 do begin: U3 R- O5 t6 e' G$ ?1 S" H5 o
        travel to pickaisle.con(A_i)+ j. a" Y1 v! ?) t+ c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) ]; h( g& u, a% O        else wait for 10 sec
5 K0 O5 Z9 Z! [( O! C3 {        if A_i=A_leave then send to die
: ^& [! V, W5 P0 G' H" E) R, @        else inc A_i by 1% Z) M: i! s" p; `2 W/ i7 k- d
    end
/ {2 x' c* M( V. l6 xend

最佳答案

查看完整内容

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是个什么东东?, P- _* K7 r& T* f% s4 _/ v. C
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ X8 f' u5 t: {6 |8 Y1 D( ?! i+ g
' b  g; `3 q$ W3 DAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- T' h/ a& {) `/ H# C$ }! ~

5 o4 k# {% k. S  u; r1 `另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ v0 o) x7 `( s+ t1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 L$ n' N! r- `5 e: ~4 L0 w5 J& `2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 u* H! H% B% u
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; l4 h% ?$ A  {2 S4 u( Y8 N7 r# u2 Wbegin P_induction arriving
& o. P$ N* c% g: F: ]    clone 1 load to P_pick(A_induct)1 q9 x) E0 V- @- Z2 g
end最大的系+ U7 p" }, Z3 L  Q) }

  B# i" f- d( N& W0 vbegin P_pick arriving
9 d, T$ J& B9 p$ |    set A_i to procindex * 10 + 1
9 {" Y6 x7 ]0 y    move into Q_induct(procindex)! S) K8 _: d# v* A
    move into pickaisle.induct(procindex)
2 b6 _, q( I. t) {% r$ i    /*check the type of pickaisle.induct(i), for your last problem.*/
0 I! M, v' {6 I7 u$ i3 J& x
. l$ `5 y* C/ p7 Y4 |% O8 ]0 G) b1 X    while A_i<=30 do begin
6 W3 m) ]6 A4 g& ?& q0 X        travel to pickaisle.con(A_i)* z' `8 i& r  J% J0 G7 i: T- P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 p% C7 L/ V$ W* l3 M* H5 J        else wait for 10 sec
' D6 q, m, X; h+ |$ D        if A_i=A_leave then send to die# k  H8 }1 H2 @; ?/ w8 ^3 d  M
        else inc A_i by 17 w1 V) z8 a# }  s* C' ^
    end, S; x$ m4 g: Y, }
end
* K( v' u7 @; A& N5 R, h! }( T: o% c
其中的procindex为整形,代表当前process的序号。3 J1 t$ k; Z2 W% a9 t3 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-5-23 22:58 , Processed in 0.021350 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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