设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15363|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' N6 V- }6 R) n

" q7 W4 v( j; p4 L, L% e7 m: @) 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中的数值,不知道会不会有什么不妥。! H9 k# I- H  V

' {' i; j5 z, X8 gbegin P_read arriving
) X) V. l8 f$ O& f    while 1=1 do begin
7 C$ x: O9 \! p        read A_tote from "data.txt" with delimiter "\n"2 x2 `+ s2 x6 ^+ H# H( D
        read A_time from "data.txt" with delimiter "\n"
$ N: N9 u5 a7 [' [% J        read A_leave from "data.txt" with delimiter "\n"
. |5 J( p( Y* z; a$ z        read A_picks from "data.txt" with delimiter "\n"3 K9 `- L2 ]7 P4 Q  I5 g
        set load type to A_tote3 A) d4 N- ~9 p& n" c* _+ t
        if A_tote="tote 1" then set A_induct to 1
# n0 @8 \- ^9 q  C# I        else if A_tote="tote 2" then set A_induct to 2
, s4 C# G( |* U( o( i' M; |            else set A_induct to 3   
( o/ x' B: L% N5 c        set A_i to 03 J# r7 r/ ]% f( r' ^6 G
        clone 1 load to P_induction. A8 ?- L6 I! z4 ?% t
        wait for A_time sec
6 D+ K  x% X( @, q: D+ t% ]    end
+ X% n3 R& a( L" N$ c6 Fend4 d0 `5 ?' f8 Z
- C# B" X0 X7 @$ M8 J3 f  I
begin P_induction arriving
% q- }, s, @1 W$ {    if A_induct=1 then clone 1 load to P_pick1
! }3 m8 w! [2 o2 w, T* d    else if A_induct=2 then clone 1 load to P_pick26 S2 ~# }" ]" \. `+ h2 q
        else clone 1 load to P_pick3! Q) d7 v4 U. ^$ K
end
" o  Z) |# i1 K" P
- T- w. Z% o/ Y0 I: Ibegin P_pick1 arriving" W2 R1 B& j- N. P( G: [" S# a5 L
    set A_i to 15 e8 }% ?. d( e5 [4 F7 o7 W6 }
    move into Q_induct1
/ R, H) U; f% N2 d! J% B7 x    move into pickaisle.induct1
1 {! v& {6 t' J1 ?    while A_i<=30 do begin
$ c9 Q4 K! ~4 A        travel to pickaisle.con(A_i)
3 [# s/ `% e' f/ `% h$ u0 z# H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 I* O7 @. I# [- C        else wait for 10 sec/ _* a+ c" G' r8 r$ c% V: u- A
        if A_i=A_leave then send to die
5 j- s0 M5 I8 o' q3 b! n7 M        else inc A_i by 10 t4 R# e" G4 U  F. |/ w- \% U
    end
9 G9 f) h/ L/ R9 c4 K% c& Iend* `/ o/ Z7 [0 c8 e- q
- \+ j$ M) K, _) z
begin P_pick2 arriving* i  [$ E3 Q$ S! i; g0 V
    set A_i to 118 O- t6 ~8 h9 r6 y  K4 D  i
    move into Q_induct2
8 _2 J" A) j( {) n    move into pickaisle.induct2
9 T5 j. j- d, a& d$ [. Q    while A_i<=30 do begin
+ D7 ^/ ^: ?4 R% }( |1 D& g        travel to pickaisle.con(A_i)
& j: a& Q6 B* F& d! v8 q9 y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( j/ O+ c/ P5 ]' f+ [
        else wait for 10 sec
3 A5 N, T  @1 M: \; U. M        if A_i=A_leave then send to die7 }( X( e7 c6 }* d) W
        else inc A_i by 1
# Y. U  q) h. {+ Q0 {  m$ W5 N6 \    end& k- |1 t# \. c8 Y! D0 m" g1 n
end
5 ~4 [7 V$ I" Y8 z) t! Y4 R( L/ K
begin P_pick3 arriving
: i) X* F) ?$ N& l    set A_i to 21+ J& @& ~( U5 P. `& U
    move into Q_induct3$ }) n$ Z' L6 l+ }2 E4 `7 p
    move into pickaisle.induct35 K' m0 T5 _' \# P0 T
    while A_i<=30 do begin! ]8 h) \. x' b5 S
        travel to pickaisle.con(A_i)% q1 u$ U: a8 M1 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% p8 K: |& a' ]. g0 r& N
        else wait for 10 sec% O9 ^+ U- N0 t4 f  I: Y
        if A_i=A_leave then send to die9 Y( d5 l4 N3 ~9 N
        else inc A_i by 1, \9 B7 ~2 a, d8 P+ u
    end
: _$ G8 n" ?% ~% Q* P8 dend

最佳答案

查看完整内容

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是个什么东东?+ O/ k; n# X( k2 v$ M* \/ Q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; c1 M3 |# w+ x* X' ^$ F: `) g4 S; q* h1 d- V9 }* G1 F( x
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% q- d. m6 q+ Y( c  s) p& F1 k8 b0 t. A: L9 i
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, x- y7 r- G' Z  l' `, C. {3 s9 D7 t: U
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' z; \* s5 _5 q9 o( A6 m. g7 x3 [2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" R/ e7 I7 ^3 @( r( w
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. D  l* d9 @" {" ]: N9 Mbegin P_induction arriving
1 K  e" k+ j( e    clone 1 load to P_pick(A_induct)
# B/ P& B4 J/ x9 Y/ j& v0 `0 x8 [end最大的系" @+ V; P4 C5 ~9 j$ u5 p

6 p3 d1 H; g" Q8 Ybegin P_pick arriving! y! |! m% b4 S% t
    set A_i to procindex * 10 + 1; F$ N  P6 d' N# {( E
    move into Q_induct(procindex)
( y/ Y6 N9 V/ n! J; N5 l! C    move into pickaisle.induct(procindex)
$ ~. e9 N2 |7 e1 x& A    /*check the type of pickaisle.induct(i), for your last problem.*/' Y7 j; L+ N! V; a; s$ ]
- J4 V/ Q  G. F8 e& ~1 |
    while A_i<=30 do begin
) B) Q1 T" T: }2 g# ~- O; Q  M        travel to pickaisle.con(A_i)% r- |+ n0 F- v+ A) `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) B% U  q: q  |4 z& G2 S        else wait for 10 sec
/ o6 R. W0 L% i: j6 ]5 \        if A_i=A_leave then send to die
# I$ n) F2 k5 ^5 l/ |* q        else inc A_i by 1
" _! l$ K( _. c0 G" Y% r    end
/ B$ b+ _. `  \/ C5 x+ send
' P6 l+ Z. v7 W$ {
0 G- W1 J# Y8 B+ @: \其中的procindex为整形,代表当前process的序号。
! H- X# d/ x  W9 }0 w* l5 Astation和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-9-5 14:03 , Processed in 0.016970 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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