设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14354|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ W+ u2 ^! s- }7 G* n- K
9 e8 n7 H( I0 z+ n/ M+ V& F我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% v& M6 z, R5 f$ c  b0 a
- |7 K  ?0 \* \! L3 Ubegin P_read arriving1 T* X% r# ^. v
    while 1=1 do begin
3 _; ]/ \" _& S! _. s! h        read A_tote from "data.txt" with delimiter "\n"
9 m7 o5 `- l/ o$ W        read A_time from "data.txt" with delimiter "\n"# Y$ k* d+ s1 X5 ~/ ~2 U& ^
        read A_leave from "data.txt" with delimiter "\n"* K( _9 i6 f6 l% _3 b$ L* n! _
        read A_picks from "data.txt" with delimiter "\n"
$ `( k3 B* y! |        set load type to A_tote3 Y: Y2 K% ]$ d7 {
        if A_tote="tote 1" then set A_induct to 1. C5 G( Y' m) |' r( ~
        else if A_tote="tote 2" then set A_induct to 2  t% U& M& Z, L6 x3 _* s' R
            else set A_induct to 3   
& Z' _) r# D; A9 ~' l* W        set A_i to 0' s% D# @3 ]# b+ t1 F& e/ ?' O& j
        clone 1 load to P_induction  X9 ^: ~% G  g1 T3 @1 r
        wait for A_time sec4 }- K& Z" y" t# C) Q
    end
: l* S9 H, G7 [$ k, n2 b% z- u9 mend
# C( U" n7 w- W" C7 d  U2 d) C9 o& j0 {2 x
begin P_induction arriving! l8 Z$ x* {6 x
    if A_induct=1 then clone 1 load to P_pick10 _4 J9 W3 g, u( b! ^8 q& _2 k
    else if A_induct=2 then clone 1 load to P_pick27 h  Y: h9 Z2 D3 ^2 j1 d% Q, P
        else clone 1 load to P_pick3
/ y, ]) T, `) [; Q" p6 {end
$ m; @3 H& P% R  _
6 L9 ]# H" @0 s; sbegin P_pick1 arriving
4 Q) D, r# ]& G( F$ \5 w    set A_i to 1% U! X3 A8 Y1 W% r5 L
    move into Q_induct1$ U- ~5 Z" L- e; }" f; H  }
    move into pickaisle.induct1( \. @) h7 I" Q% u
    while A_i<=30 do begin3 J1 j) _- T, K$ \! B/ J+ Z' l
        travel to pickaisle.con(A_i)
* Y6 @5 C4 n3 r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 |0 S1 t6 L" \: |5 @7 g        else wait for 10 sec+ u6 K( c2 A' v$ j, y
        if A_i=A_leave then send to die4 ~  V9 d" x+ h+ {0 N6 u$ Q
        else inc A_i by 1' i9 l- F& f4 g" z( F( A
    end7 l$ k' P, R* v$ I" L) l
end! H" h$ b( m; K( @, R  i: E
7 K$ h1 |, J, F! Q# S# S
begin P_pick2 arriving
( P5 i5 n# v2 E    set A_i to 115 K' H/ K1 m: Z' [; E  X5 I4 f
    move into Q_induct2
0 `2 ], b" D+ O    move into pickaisle.induct2
: l0 x# G3 ?" ^+ v    while A_i<=30 do begin0 [" C8 T* j6 |4 E, b6 r& y5 ]. f
        travel to pickaisle.con(A_i)7 i' F5 T% s) m  S/ ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 r. |7 F: x" T* r! m
        else wait for 10 sec
! d8 l4 c9 ^4 A0 V( w2 U- F2 i        if A_i=A_leave then send to die
! ^/ f" l7 r% U+ L- a* l+ c        else inc A_i by 1
1 K4 \- ]* c' U$ v; J$ ~! {    end/ a  k: K1 G  I
end9 g* c2 E- P8 X: m( ^1 L; u
$ B2 |' }5 p& d0 j2 P7 k2 ?" h
begin P_pick3 arriving
* Q, p# G8 Z6 b" Y# ~/ o8 x+ w    set A_i to 21
+ Q0 F" V. o: o2 e    move into Q_induct3
# k1 N1 `0 E5 j* D; m$ u# D; c! [    move into pickaisle.induct3) E0 M2 L$ Q( f+ z0 D
    while A_i<=30 do begin
6 n7 x$ q/ N8 n& d5 P        travel to pickaisle.con(A_i)1 v) H, n* w' m3 |' r* f- V: _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( i$ p* v" P( p+ u) j6 B% ?6 b        else wait for 10 sec
1 k: t' s, ~9 K& P1 g        if A_i=A_leave then send to die! g: c9 s$ b+ i; @5 p4 A: z
        else inc A_i by 1$ H- S: r! H0 b7 s8 d/ K
    end
) v4 Z- z- g9 T3 I  z7 Qend

最佳答案

查看完整内容

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是个什么东东?
1 C  ?+ k! e1 X8 q7 Q. L" @move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ t- G% [/ l6 Z8 _' p4 O
& k9 @! V5 F/ N! H% |AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 K9 W$ k4 b+ j: T. X
$ z0 \/ `' A, o2 A- g1 V! \9 L7 v9 a5 ~
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: \1 z9 T6 Y& Z7 Y& f1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# W1 d3 }: T5 t" b  e
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. p& A! L4 k0 b! e5 X
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 L. G3 m- J4 s  _6 P( O* H; lbegin P_induction arriving2 q& y7 A. o4 c5 _9 m! x( x" U
    clone 1 load to P_pick(A_induct)
. m3 v' ~, b3 R' r" u: |4 gend最大的系
. }5 M5 s3 o: v2 O+ Z8 [  O$ o
, n! |* A" k( I3 `- tbegin P_pick arriving
) |; e, G' A- f& B    set A_i to procindex * 10 + 1
: s9 U. O6 N4 K0 T; ]( t% Q! z    move into Q_induct(procindex)( \4 D" g, l0 L4 x3 m
    move into pickaisle.induct(procindex)
0 G" F, p1 e& y! a    /*check the type of pickaisle.induct(i), for your last problem.*/) D8 y- @0 _- V8 s! {2 s
4 L* k( G8 F7 {: @9 |+ U' _6 c
    while A_i<=30 do begin
2 [/ c2 ~% r" E3 {: b# o8 g$ Y        travel to pickaisle.con(A_i)% ^7 K- g* L; I1 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) i& k0 W2 l( A. u' C% b6 V+ `0 T        else wait for 10 sec0 k  ^) Z7 {2 w( x
        if A_i=A_leave then send to die
. b+ b% N" w" i        else inc A_i by 14 N# u. {( |* t
    end
% X' B& f0 h- `. Z) }2 dend
7 `8 ?- g# k. \( u
( \. |1 ^( W7 c; A. |. O其中的procindex为整形,代表当前process的序号。
+ N* G5 y/ J& x1 r' i. T, `: ?6 rstation和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-7-5 12:13 , Processed in 0.016087 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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