设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15233|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' X5 ]- k4 M' `& m- \. ?) t* _- e5 c  K9 p* n
我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 U+ {, O: e& i  b- c& g

  G! u- G9 |" x8 h5 Ebegin P_read arriving1 ?: u9 O1 \9 r
    while 1=1 do begin
9 F. D# A7 x9 E        read A_tote from "data.txt" with delimiter "\n"
9 n; U6 G: f% D- e4 d        read A_time from "data.txt" with delimiter "\n"4 C% {: [6 K' ~% l
        read A_leave from "data.txt" with delimiter "\n"
/ u3 p3 K: p5 B* l# ?        read A_picks from "data.txt" with delimiter "\n"
1 t9 T7 l6 y+ a$ h+ ^! x        set load type to A_tote
7 U$ u, H( U7 E5 U( P        if A_tote="tote 1" then set A_induct to 1
/ N6 |( t7 F  r2 E: T, ~: _        else if A_tote="tote 2" then set A_induct to 2
; f2 d" u4 K7 v% Q0 ~' v            else set A_induct to 3   
* h4 Y9 i6 E# R0 }/ t        set A_i to 0
. t( i: A& W8 w3 U- q, r. P        clone 1 load to P_induction
* k4 l& y; G( Y( {* k  ^! [% o$ k        wait for A_time sec7 s' M! o! t, l; I. J  L# u
    end
9 n2 x2 m- f+ n# [5 x* B' zend
. C' s% a' I* ?. ]/ e0 i; [0 R; f+ v+ R- a3 P% Q
begin P_induction arriving) A1 y# [0 o! F2 z  v
    if A_induct=1 then clone 1 load to P_pick1
0 W# a, \) f' {% S( C) X7 h0 l    else if A_induct=2 then clone 1 load to P_pick2. M( K- d) s- T! k5 X) m
        else clone 1 load to P_pick36 ~# V4 H) E0 b- h( P
end
5 \4 W$ T4 W* ^/ H+ k2 M" A" V5 T& X1 ^
begin P_pick1 arriving
7 M0 F7 O6 ]5 P: X" h1 j7 q    set A_i to 1
" ]' }, T2 L9 a) x+ Q3 n% M    move into Q_induct1
. u) G8 H3 F7 S  h    move into pickaisle.induct1
+ `9 B) v# t' V, z    while A_i<=30 do begin' z7 _! x8 L* C; [
        travel to pickaisle.con(A_i)
2 g- t" d$ j9 H/ J$ M; p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 x6 r8 O: o, s( b, G7 c* o$ U# A. l
        else wait for 10 sec
: F4 F6 O- z* c) L" [# ~" Y6 u6 A        if A_i=A_leave then send to die
' `& k$ D" p8 ?8 {        else inc A_i by 1
6 A% s: V6 f/ V    end+ \( T+ w* a) g  l) b; W/ U. D
end
# s( C$ r3 D8 }  f( ]! F( ~* }
5 J' i$ `- a& Y# r2 ibegin P_pick2 arriving
. I4 E8 @. z' m/ `+ f# v4 D9 N# X& |    set A_i to 11
' e  p9 g; Z- m* L    move into Q_induct2
& i0 F" L8 v6 q$ i$ b    move into pickaisle.induct2
9 J* U+ u9 ^3 j& F    while A_i<=30 do begin
+ M  \& h' t7 L7 B8 X3 ]* E        travel to pickaisle.con(A_i)0 _) V6 R& C3 t( b; `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 B( E0 G5 C: T; L& m        else wait for 10 sec
* N: N: h1 e& ~        if A_i=A_leave then send to die2 N- \2 e  i0 U. P
        else inc A_i by 1
" E4 l0 K% d5 T* Q* ^9 S: q    end0 p: B" C, B3 V+ L/ Y9 s5 O
end
. i7 p+ C8 x) \: U3 D( i; w; a6 Q8 [, p( |2 M4 I
begin P_pick3 arriving( a9 o+ I: Z- Q$ D0 l4 d; C
    set A_i to 21
* M6 g/ y9 G7 ~& u  p7 N) `& }    move into Q_induct3
8 C8 {) Y9 z  e0 y8 [% W- N    move into pickaisle.induct3
' F5 n& \8 {2 B. E. W    while A_i<=30 do begin& v. V8 s( d6 I! s$ d4 `
        travel to pickaisle.con(A_i)
+ P  _- U2 y  c2 ?$ |+ d, i( M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 g% ~" w. e( u0 M# _$ d: z6 c        else wait for 10 sec6 o/ N/ o% W) n
        if A_i=A_leave then send to die
: k% V2 _& }$ e9 y1 f        else inc A_i by 1
4 b* v) V, V  }' B* I    end0 q3 l! [# L2 y! _( s
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是个什么东东?% u. J2 |5 {& U5 h
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! D( D% ~+ h$ G  m3 u9 M) q2 }

3 j' A/ I8 Y; y, F; @& b$ dAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* `* O$ }# n# ~' Q0 I3 }; p

/ G* B& |) g" _. h另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, p; n+ p: a& y5 k6 J1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ U  }: f/ D1 d
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 p2 j$ e$ w, L4 B+ a( `0 I$ [
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; k- t- u: {+ m6 [# y0 p4 Qbegin P_induction arriving. s% S& k* _  ^, y% d: H! e
    clone 1 load to P_pick(A_induct). U6 b. |% j* g* [/ P: Z( r: @
end最大的系3 d) U- ^( j  P( q* k
/ l; v$ R2 `5 E( H- {* u* B
begin P_pick arriving
" S0 C3 `: J8 c    set A_i to procindex * 10 + 1
7 W5 F/ j2 O' @7 a    move into Q_induct(procindex)
; I1 V& v- k! n! G4 J    move into pickaisle.induct(procindex)8 D3 u# P0 k" T: \
    /*check the type of pickaisle.induct(i), for your last problem.*/! Q) J  M4 q& ]( C7 Y6 t

/ g  v& i6 X3 c7 ]    while A_i<=30 do begin- A- t2 a: f( I! d" w$ e
        travel to pickaisle.con(A_i)
9 Z- l, g! }4 Y+ p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% X( k8 y- }$ N- ]# a
        else wait for 10 sec  W1 J# o& d6 Z. f8 F) n
        if A_i=A_leave then send to die& E7 l7 ]/ u% C/ B6 T" w
        else inc A_i by 1
- B* |$ ~, b+ y+ G2 F9 o0 J! W" \    end4 N& ~8 s& q7 ?8 }6 ?& U
end( i. k: F$ V/ f" K$ W+ t
; l1 g& I0 K3 d( ], M
其中的procindex为整形,代表当前process的序号。; t7 W5 Q" H, f7 n! 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-8-26 05:19 , Processed in 0.018780 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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