设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13976|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 w/ c) e2 G' ~/ Q! \
( T: w2 A( M2 m. O' y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 S( r- B6 q" B  b
% x7 H& x# H* H6 F$ Dbegin P_read arriving
' y: _+ [1 w8 R  ^3 u" E+ z3 E    while 1=1 do begin' u$ L  p! n" c3 i: W
        read A_tote from "data.txt" with delimiter "\n"
( q4 S9 w0 V/ B  [( \: [" E! d! p        read A_time from "data.txt" with delimiter "\n"
! h* X/ m5 y& j/ _9 `        read A_leave from "data.txt" with delimiter "\n"# g( E3 ]: f5 h7 ^$ z
        read A_picks from "data.txt" with delimiter "\n"
8 q6 b% J, u( g% _$ g5 Q0 |0 T        set load type to A_tote% Z. V7 M  P. i. u
        if A_tote="tote 1" then set A_induct to 1$ Q7 j$ y3 u/ P4 \0 |0 m4 z/ r
        else if A_tote="tote 2" then set A_induct to 2+ j1 A& H2 ^5 Y6 ]3 D3 L4 K& L! @
            else set A_induct to 3    , v% B2 X* ~$ C: T5 G3 L- t
        set A_i to 0
. u' U$ H  J0 k+ {- c1 L        clone 1 load to P_induction
. e9 O* t4 b9 I- I! K        wait for A_time sec
" J( H- `3 u" W& o/ Z    end: E" |" f& e. H6 }  m* R' I
end
' \; n1 \0 J- |
$ s1 X) j# j1 O4 O$ |' x6 b& F! V0 Bbegin P_induction arriving
7 D* n( @1 ~* W* I3 u. i    if A_induct=1 then clone 1 load to P_pick1
$ f0 @/ D0 i' A    else if A_induct=2 then clone 1 load to P_pick2
5 b2 a6 `% J( ^% ]% v8 i4 \        else clone 1 load to P_pick3
6 v2 G' k$ G; d- v1 m! l9 K, Pend
% a6 M: v% S, ^, r% [3 X0 r' e
0 Z' i  K. G/ I( Abegin P_pick1 arriving
- ~2 @: c8 g9 A0 R; {  l    set A_i to 1# R  ^% n/ y7 R
    move into Q_induct1) C" z0 {! j+ S( H
    move into pickaisle.induct1& }* U! H" W5 }/ P. q; N
    while A_i<=30 do begin2 G) z6 w2 D5 f. X) o. {
        travel to pickaisle.con(A_i)4 r9 u: Q* B. s8 [; B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 \$ T) k3 R+ y# P8 m6 F
        else wait for 10 sec, V8 Z$ Y6 u7 K, [  B+ C# L
        if A_i=A_leave then send to die
0 E+ Y* K' I2 {0 K        else inc A_i by 1: y* Y( ^1 }& m5 G' j! s9 {
    end6 S7 ?/ v" s& G* S4 f( L
end
" G$ ^" m1 K' |8 l. c
: L+ a6 w! L8 |3 }begin P_pick2 arriving
8 q, m2 Q  \2 j/ D$ D    set A_i to 11; {1 _( R( |  j' u. ?$ Q& \
    move into Q_induct2) ]! t( F$ e7 F  P, }  g
    move into pickaisle.induct2
, e+ X8 j# g# |7 }0 h7 K' M    while A_i<=30 do begin
: Q! F  J. ?! h! y1 q7 O" T        travel to pickaisle.con(A_i)
; a# r0 o% K( F7 I' {: G5 U3 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ _: F9 Z1 O1 U" L) p. Q, R
        else wait for 10 sec% u  ?" A/ X$ \" d+ O( u
        if A_i=A_leave then send to die1 O) G  {* b1 E
        else inc A_i by 1
& s% k5 u2 b8 z; q    end
  M, d! U' j# T7 r* cend
; u! k4 C5 p7 U! j, R0 x0 [( F  b+ \
! E0 g# u0 z0 _  m2 K/ W' cbegin P_pick3 arriving
' C6 P. R5 G- N8 u( t& P    set A_i to 21+ z# Q$ e  K- A. c! l
    move into Q_induct3& i+ o$ Y4 ~" f
    move into pickaisle.induct3: d) d3 D2 q6 d4 i
    while A_i<=30 do begin
' z2 l& b3 t8 z; ~* \        travel to pickaisle.con(A_i)/ c6 S% r) l% g' F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 F, H1 l, Z0 M4 y7 }4 M# D  H/ v+ ~
        else wait for 10 sec
* @+ k6 j  M. Z, \        if A_i=A_leave then send to die6 |& h! N5 ~( ~# A& O( a! o
        else inc A_i by 1$ u$ W7 H8 {# |
    end
/ w) ], ^: ?1 {& vend

最佳答案

查看完整内容

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是个什么东东?
$ J+ a! h" L2 K$ Y  lmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& l) H1 n" e" v% S' q# L
( F$ ~+ K& o- b& w3 _( U  QAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; |: Y+ M1 b$ M1 R% F
% z. _: k5 K. v! x+ g另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
# R% [5 W4 Q$ B1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' \! [' r8 o1 N6 d8 Z: w9 W2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 N& A/ c! I! C0 B* z, J5 e8 B3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 l: X; P- W0 d1 U0 W0 k: J/ N3 mbegin P_induction arriving
& u; ~' X; ]: p! ?9 _- U( r    clone 1 load to P_pick(A_induct)
7 |1 i9 [& o$ k! Hend最大的系- e2 W1 W2 A. J+ Q2 }. I: e3 `
4 @% a& W! Z! i0 p* I
begin P_pick arriving
0 H7 J0 x9 g% f+ H' `4 P$ V3 w    set A_i to procindex * 10 + 1+ U1 \* p9 P7 @# U$ Y9 g
    move into Q_induct(procindex)6 X# H9 K( E) Q" k9 y
    move into pickaisle.induct(procindex)
6 @* c" P+ C( G' p6 F# w    /*check the type of pickaisle.induct(i), for your last problem.*/
' i2 q/ k+ f( S, x4 A% p5 R( J+ ^5 J9 w
    while A_i<=30 do begin
  h/ U& i  H5 Y5 k$ v3 Z" M        travel to pickaisle.con(A_i)
' F1 Z9 J: k" y# H' a) I, a! I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! I8 W  `" _# y9 Z6 n  t# X/ J3 h
        else wait for 10 sec/ m# {3 |& L3 h" h2 ?
        if A_i=A_leave then send to die* w0 {$ C; U0 n* O# q6 A
        else inc A_i by 1& i( ?& w3 w. D2 }
    end4 s3 f1 h" J) n+ p8 D$ i3 r: }
end
. p* q! }* \4 |' Y* a% M
9 h8 e/ H1 k' j' q其中的procindex为整形,代表当前process的序号。% j- q* _+ q% l+ F/ 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-26 16:53 , Processed in 0.018028 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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