设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11628|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" @% {' z2 q" k( p1 C
# Y6 a$ q. s) K3 E我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 Q( Q' z$ |9 X' r% q1 R2 J9 J. R
begin P_read arriving
3 r4 l4 F3 P) ]& q$ i, h5 Q    while 1=1 do begin, \' X% s# K6 j' n8 B; p+ V
        read A_tote from "data.txt" with delimiter "\n"
# c( b+ {; L& i# B        read A_time from "data.txt" with delimiter "\n"' N( _" P& r# {& |, x3 l, s. e$ h
        read A_leave from "data.txt" with delimiter "\n"4 A6 p9 @* O6 _& X" ]
        read A_picks from "data.txt" with delimiter "\n"
2 _8 F6 M! l  M8 V0 q        set load type to A_tote
, P% v' S0 ^' j' q* C        if A_tote="tote 1" then set A_induct to 1
( ^" j. C+ J% M        else if A_tote="tote 2" then set A_induct to 26 I, R) R( F5 D* Q7 f3 a3 E5 R
            else set A_induct to 3    7 E( m5 y% @& l; c; g
        set A_i to 0
8 F! ^; C/ ?( }1 H        clone 1 load to P_induction( U5 R- r/ y1 o$ h6 n
        wait for A_time sec
+ O3 Y; {- t' ]. p    end
; j# I0 r; L- Y' Tend8 g8 _: Y+ `, k2 f# v6 z2 F

& `, E9 n3 H7 g$ t  @9 Pbegin P_induction arriving
8 Y, Z; W+ C8 u3 K+ g    if A_induct=1 then clone 1 load to P_pick12 h' K  S6 Y; V( k' Q7 {9 W$ I
    else if A_induct=2 then clone 1 load to P_pick2: Z0 W4 ]( r$ W" G1 q6 {
        else clone 1 load to P_pick3: k; b0 u' z8 n! \* Y
end3 f+ S/ n- f" L+ I' `

- u. V; V6 _' l: Bbegin P_pick1 arriving
7 d/ Q/ i2 S2 P0 P  W- s    set A_i to 11 @* r+ Z- B" p9 K) Q* X; U; q
    move into Q_induct1
( Z& P; b0 \# U! l+ z2 D    move into pickaisle.induct1
0 @2 o; B9 M& T    while A_i<=30 do begin6 n8 D3 H7 j# k2 n; V
        travel to pickaisle.con(A_i); J6 F) c: b* j; b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ V4 q  j5 Y( s7 H3 v' C5 f        else wait for 10 sec
" n! W3 [  F6 f" W7 K* p        if A_i=A_leave then send to die
* {" u* O4 \/ S, f# G5 g0 ]2 r& y        else inc A_i by 1* G* Q9 W7 `' t  o! @* G& P( ]
    end- d. x2 F, E" [/ v3 [4 {5 {: s
end# c+ \: k% D2 h; B

# x( N( a5 C( l. Gbegin P_pick2 arriving
& B, w. p0 \* e! ^2 _% o    set A_i to 11
+ L, x" M1 ^! g, c1 i$ k1 V    move into Q_induct2  I. X  q/ G3 W, L  Z
    move into pickaisle.induct2
  j7 M. l$ S- [+ x4 o9 y3 N6 n    while A_i<=30 do begin& F  z- w9 f' l' b( ^
        travel to pickaisle.con(A_i)
9 W4 U, D* B5 m2 F9 @0 `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 ]4 \1 z) S% D) }2 \" J! M
        else wait for 10 sec$ n3 {7 X% B. K. e2 Y3 n: s
        if A_i=A_leave then send to die
+ ~9 R5 D# x/ Y. Y( e  y; ^3 m1 ~        else inc A_i by 1
: K9 j: s8 J. m, j+ C- o6 S    end
: w. Z! i! c' v. \2 qend
( _3 L6 U- [7 z/ C8 g9 c) S- F+ X  C" H! k$ \2 O- Q5 @% L( h7 j
begin P_pick3 arriving; c: L9 S: N% N) D' I
    set A_i to 21
+ K" L+ T5 |. f2 {' d    move into Q_induct3# a: l8 V6 B5 W. `5 k
    move into pickaisle.induct3
' i& R- S, b9 `6 n+ R    while A_i<=30 do begin
# ~8 e) u3 C# J( x        travel to pickaisle.con(A_i)
3 V$ r# B6 |  C5 K, m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 q0 b2 r! ?4 Z; j* Z
        else wait for 10 sec! T7 m5 u. T/ B* R. h
        if A_i=A_leave then send to die
7 N, ?( o) w) k& P' h* l8 a# N        else inc A_i by 1* A8 [5 Q) c  N
    end+ h. `% O  H+ F9 d6 H
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是个什么东东?: ?  k/ b( @4 I  R
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" D/ L. R& v: x' x

: L7 T9 ]+ {6 _6 l. w+ |AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。, C* K  Y& X: @: t: B
/ ]& ^, M5 y6 H8 E- M9 @, q3 j
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" M: ^2 n% b( {& s; L$ ^5 U, G  ]1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, t. H3 U9 g3 K" \& H$ U) s
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;( Y' T; G: K+ f8 `! B2 N
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 K! Q' M) L  X9 H6 r6 bbegin P_induction arriving7 r/ o2 r( u! E
    clone 1 load to P_pick(A_induct)
8 W5 C1 r) ]: g3 I$ J% T% c! Qend最大的系, G5 `: r/ E/ v( Y
5 b+ K6 s8 p/ N. F* k
begin P_pick arriving8 |  ]. ~% n5 B0 ~( B7 d" R: }: j
    set A_i to procindex * 10 + 1, |' Z- N" o, F& E. S7 j
    move into Q_induct(procindex)
. d" T+ C: v$ w4 |    move into pickaisle.induct(procindex)
9 G4 `! W. Q: N9 T    /*check the type of pickaisle.induct(i), for your last problem.*/" v! L4 I" A$ k

3 y2 A7 c5 d% l6 d3 a" V0 \    while A_i<=30 do begin# T* g# w( O- ~" o2 y
        travel to pickaisle.con(A_i); y- T+ H8 |- c: V; [8 \% \$ R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ Q. k7 y* T1 c: M$ w- y
        else wait for 10 sec; e2 r3 M9 D6 I+ h
        if A_i=A_leave then send to die
( V( `* ?/ D1 d        else inc A_i by 1
! T/ j* J! H1 I. l    end5 U3 {% t- I1 c2 |6 X
end
. i; I- k$ S1 O: s) l( s7 G3 I+ n+ E2 Z2 _3 A
其中的procindex为整形,代表当前process的序号。
+ _" P+ D2 _- W0 }- A% Sstation和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, 2025-11-24 17:12 , Processed in 0.019110 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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