设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14123|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 X5 \0 P+ C0 V6 }& N( L: u
1 @7 K8 N/ r8 @我的问题是,在每个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中的数值,不知道会不会有什么不妥。: F! S& U$ u- U( x7 A% H- p% d+ v

* e( [, s( k. A$ Jbegin P_read arriving8 o: i8 S& w' E0 `0 v2 O# t
    while 1=1 do begin7 j+ ?  I$ s( g5 L" y) v
        read A_tote from "data.txt" with delimiter "\n"
$ [! L4 j2 A& P3 x5 g# i$ k        read A_time from "data.txt" with delimiter "\n") ^; p8 E( @* P* m' H& g
        read A_leave from "data.txt" with delimiter "\n"
: D2 M, k2 e# z! T& t! @$ E, k) W        read A_picks from "data.txt" with delimiter "\n"
3 b' U( P- Z# S  A+ J        set load type to A_tote( `8 Q5 ?1 P* j$ a& o
        if A_tote="tote 1" then set A_induct to 15 x9 Y3 |7 E4 w7 G
        else if A_tote="tote 2" then set A_induct to 2. S$ `' P5 D* Z: S
            else set A_induct to 3   
$ V1 D7 c$ V& v+ U) _( U& A        set A_i to 0
1 z/ v6 e0 E6 W2 X5 U        clone 1 load to P_induction+ X5 z/ v* v7 ?2 Q& o" m5 {4 [
        wait for A_time sec
0 H0 H: T5 I  t4 {; @: N    end
7 k$ g' C& j1 D4 U, v& `6 eend& F( b" k  a) A. b! i' ?- h& O5 i8 h
6 E7 `0 N; |' F* Z/ ]
begin P_induction arriving: ^2 ^, b+ A( G8 P) u3 R( x
    if A_induct=1 then clone 1 load to P_pick1
, s* M: p" K- U9 ?- {    else if A_induct=2 then clone 1 load to P_pick2$ \2 N; D' k6 f/ m% n. u
        else clone 1 load to P_pick3% P  w8 a* y7 X5 I+ v
end5 D0 y, \/ Y, x# Y; v" _# o

. Y6 O- v# s. R3 A/ N1 Abegin P_pick1 arriving8 a/ q9 r6 N3 a' {7 K! W  W
    set A_i to 1; K; B; R  d' U
    move into Q_induct1
; R; W! @$ W& T/ \; e: D    move into pickaisle.induct19 O* T5 B" T% h# `. H8 t8 R( I: G
    while A_i<=30 do begin8 u; P4 G5 n, i+ L) f! J& A  p% r0 a
        travel to pickaisle.con(A_i)
3 e3 B; m8 W" Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ D' ^: {4 I' q# s. A- o$ i! U
        else wait for 10 sec
4 L0 R/ n' w3 V( x        if A_i=A_leave then send to die
3 j' s+ i0 _$ d' H, w8 u        else inc A_i by 1& Q* _/ E; O' {, C
    end
4 V0 w5 v* y# I" Pend, g) E/ x+ ~: N" k% D. R

3 l% x) H) `1 j- c$ C# r/ pbegin P_pick2 arriving* m5 S, l* a8 `9 l/ A% j( t2 w
    set A_i to 11
5 J5 F$ r. Z+ `    move into Q_induct2
$ D0 V  X/ B7 y3 q( J, Y% K1 j5 [3 z    move into pickaisle.induct2' k) p6 S2 u. ?2 t  v) L" I
    while A_i<=30 do begin. {2 i" H6 e* }* E- ]8 B/ ]% a
        travel to pickaisle.con(A_i)% Z: H* A4 C6 B- d2 _, Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) C" A! _. x2 c9 R" i        else wait for 10 sec/ {5 I7 o6 _0 Z
        if A_i=A_leave then send to die1 E4 n$ k6 a0 X; ]; i
        else inc A_i by 1
1 X  ^( N9 ]! {) M# M) [8 b: N    end- p8 A# Y9 W& n: V( S
end
. a8 C& c9 ?; }! O& n1 j! M& N5 _. i# S! F
begin P_pick3 arriving
) G, L9 R/ M/ ^# ?! Z& y+ X; q/ d    set A_i to 219 m+ y8 B; `: s5 v
    move into Q_induct3
# s6 ~1 q$ E; r" S    move into pickaisle.induct31 p5 P/ @  T" `$ J
    while A_i<=30 do begin
, c, ~$ I& O! y- N+ X! @  y( O        travel to pickaisle.con(A_i)
7 u+ _2 g1 g5 ]4 i6 N9 e3 Z7 |! @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( u! R( B% Y6 O8 \# V        else wait for 10 sec1 v/ w+ ~2 o5 x7 E/ D9 C
        if A_i=A_leave then send to die
, k# }: v" @8 c        else inc A_i by 1& x& q: v* A5 e2 O
    end
/ Y$ j- t$ Z( y# Oend

最佳答案

查看完整内容

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是个什么东东?
' C8 M3 U' n/ J3 C9 Q+ V! Y9 A9 `4 q9 V6 C; Zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
* F; E2 q$ x& Z7 ]* M8 w/ v
: Z0 n; P  B) h! J( R/ ZAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 N# |& ]! K2 P! }
" \" R" a0 b$ U( E8 Q) c9 k另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* E! z/ y1 g! `9 G! u8 r3 J  O- R1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;: h2 N3 v1 E" F9 U/ Z
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ {5 R3 z5 B9 f: M- i0 j
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( Y. D( D7 N; ~5 A. i
begin P_induction arriving
) w5 S6 u  \3 z3 ]    clone 1 load to P_pick(A_induct)7 O; g% |5 S. V# u: s
end最大的系
' R" D, }; y0 D. R1 M7 ]8 R* E8 h3 ^. D+ H* |, a
begin P_pick arriving
7 m/ V7 J. `, e- K% f! i3 c  Y    set A_i to procindex * 10 + 1
0 Q3 z) p; I+ x6 [* e    move into Q_induct(procindex), `% o9 y. s+ q  r. K- f6 g9 v7 k
    move into pickaisle.induct(procindex)9 n) \/ C6 t  C: S8 Q( I
    /*check the type of pickaisle.induct(i), for your last problem.*/
. D+ n. ]- U3 E* x' ~% p% p8 B: P) \  J& i) y
    while A_i<=30 do begin2 f$ S; y1 w! w
        travel to pickaisle.con(A_i)5 x  U0 }  y( X7 q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! z: R# }7 R9 M! Y& [3 \
        else wait for 10 sec0 N' B$ i0 F9 D/ O* |) q
        if A_i=A_leave then send to die( V  x# C& }3 V
        else inc A_i by 1
1 \) f3 J6 [' ^; f; {' F) j) ]    end: r7 u: R# u2 X& P+ k  |
end8 d  c* T1 U( M# x4 e# Q+ n' H  y
; w3 N5 \# v5 V- a7 ~. ^, m' M
其中的procindex为整形,代表当前process的序号。* v3 Y9 w' d2 M& `$ D( q0 u
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-6-11 11:56 , Processed in 0.015570 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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