设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13905|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ \0 J3 R8 A! E* b3 v
) A' ]. |5 r8 ]. 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中的数值,不知道会不会有什么不妥。
2 ^" ~7 I2 ~, |+ N
9 b' g8 J) e2 N& \) W0 s" gbegin P_read arriving
5 m" C$ \! r5 ]- l) o- J    while 1=1 do begin
$ q' k9 F" K1 t) s2 `0 ?7 q        read A_tote from "data.txt" with delimiter "\n"( I" e3 ~! Y# O0 I# R+ q9 I4 }
        read A_time from "data.txt" with delimiter "\n"* F2 |# e+ A1 |" _
        read A_leave from "data.txt" with delimiter "\n"8 f, Y1 w. N/ |" ?! B
        read A_picks from "data.txt" with delimiter "\n"1 s9 Z! u2 l$ ^' b2 k
        set load type to A_tote
. M5 b; Y* Q0 E        if A_tote="tote 1" then set A_induct to 17 Q' E0 K" c, h7 J+ j2 L2 r
        else if A_tote="tote 2" then set A_induct to 2! h" X- N, Y* E
            else set A_induct to 3   
, `% ]. L2 Z/ u1 [/ k2 y. q& R        set A_i to 0
- h* Z2 H' R) j5 C6 m8 H        clone 1 load to P_induction8 Q5 |6 k& s$ w; B8 m  }8 t
        wait for A_time sec
0 Q: l2 T) Z- w  K; {! W5 i    end9 l+ [& t0 a" x% w% l. \6 r# b
end4 q5 k% S6 W. O1 U( Q' t7 u

6 U( ?& k9 p" }3 Wbegin P_induction arriving
# Z, w, ~/ e3 ^/ m    if A_induct=1 then clone 1 load to P_pick18 l# m% o( F  a! X& x3 x
    else if A_induct=2 then clone 1 load to P_pick2, o+ _. R* t* _5 B3 q- c
        else clone 1 load to P_pick3
9 x7 g% [$ P' Aend
7 J' i8 }9 B3 H2 v" R
4 a# A- n3 c5 k/ }! L9 Y9 J4 }, Lbegin P_pick1 arriving6 b! Y$ T1 j3 l6 u1 K# j( f9 }
    set A_i to 1
2 F8 m5 h( P$ s    move into Q_induct1
7 N1 m. s% ]2 j  X9 C# Z    move into pickaisle.induct1
% Y. h9 f' S% k6 H% q. m7 g" a5 b    while A_i<=30 do begin% \. r2 F. Z: t
        travel to pickaisle.con(A_i)
( R9 T% k2 I, f" P" _( `4 z+ o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! g& A1 X% r" r" C+ M' I' _6 {& T        else wait for 10 sec9 n& w5 k. I5 K  q$ p' `" E2 W
        if A_i=A_leave then send to die3 V* ]  {% {! P' H! ]
        else inc A_i by 1
: |$ a( f" `" N. N$ q+ `6 o    end
! J3 G7 p& x5 v. Qend
' R* t6 U" z) y- A
7 f$ U# z# k% Y7 _: [. }begin P_pick2 arriving! F0 {; V& U8 u; _. u0 R# h! ?5 o
    set A_i to 11
$ o2 E! g- ^- X/ m( s$ y    move into Q_induct2( `5 p/ W6 o+ w' ]2 i
    move into pickaisle.induct2
6 |( {( p# g7 k4 K    while A_i<=30 do begin
; ~4 _+ ?. {" L- Y2 J& I        travel to pickaisle.con(A_i)
& [; e( X% Z" A# f$ v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: C  c2 t0 Y# \# Q6 a# \
        else wait for 10 sec
6 N$ T( |1 m8 j9 O, r% N        if A_i=A_leave then send to die
% }, \+ \3 g: T& I# C  q; M  U        else inc A_i by 1" [) t1 x% p2 h, e. u
    end# G, A0 X8 P; W; F8 i
end: M. w" c+ r. b; ]: i. h1 Q5 s
/ ]) `3 w! |6 E2 v1 o0 m1 Y
begin P_pick3 arriving
" o9 @3 W7 `7 U5 h) Y  _, h, e% _+ J    set A_i to 21
9 R8 m: \  v: E7 }* ]- i0 }7 {' }    move into Q_induct33 y% D! v; P( [
    move into pickaisle.induct3
: C- \! ?* Q2 m7 Y- I" C    while A_i<=30 do begin
2 {9 O  i* y  a/ b; a( f3 h        travel to pickaisle.con(A_i)
& E/ B3 Y; ~' t( u* i5 ~  Y) h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; O8 e  {" @  v# H) o        else wait for 10 sec& \; d* F8 s0 j/ s
        if A_i=A_leave then send to die' ^1 v6 f8 F2 X' z6 [, X1 I* _
        else inc A_i by 1
  G0 x, [" ~; x( _) J! V! y    end& m$ u7 {) H6 e- R7 k
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是个什么东东?1 \" j; U3 p3 Z/ o. K
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 x5 I8 U3 c# n$ P; s2 ?# T/ T, n$ v- }7 X, s
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 w1 N! J/ H9 K: [+ Y3 A0 u# {" a1 R4 j1 \& ?
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ p$ {6 c- r% `% p0 ?1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& H4 Y1 P& F- e1 [% ~1 |2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ a8 o" B, Z( w; Z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( a# ~$ |( V" C
begin P_induction arriving
9 c, P, Z0 K, C- H% `1 Z    clone 1 load to P_pick(A_induct)
. F3 D2 d; M8 B2 Eend最大的系
# M2 W8 g0 n7 W4 H9 k$ V( W+ M$ N# C5 q
begin P_pick arriving
! T+ u  d9 a7 M$ r. n3 E    set A_i to procindex * 10 + 1
. g( f4 S. h9 ^8 q2 j, u; h' b    move into Q_induct(procindex)" @1 o) p, n+ @  q4 @4 H
    move into pickaisle.induct(procindex)& ~/ ~8 q7 z, ~% R& U0 h
    /*check the type of pickaisle.induct(i), for your last problem.*/
) v3 [" o7 }( R8 e
/ h7 [) u: O1 o5 {# e7 m    while A_i<=30 do begin  R" Y, x" v! P' s$ O, P
        travel to pickaisle.con(A_i)
# ?# v1 k9 }9 k1 Z0 h9 S* d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 u! T6 f& L6 s5 I( Q  ~% _        else wait for 10 sec! F2 X% U! M0 X8 {# Y& h
        if A_i=A_leave then send to die
5 ^' d+ K8 [$ `: y- G  Y        else inc A_i by 1+ J+ a4 r* l) _
    end; V0 n# |. G' X  c
end
" L! N% `7 W) O, A
3 ?$ L: r( y" c' c, C- f' `; Y其中的procindex为整形,代表当前process的序号。- c- ]% t$ N. Y- h3 O0 F$ G. a  F
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-17 13:34 , Processed in 0.017666 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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