设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13106|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 `: F0 S# P0 ]. v
& g3 ]) h" |) m" Q- H/ {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# J; ?$ [8 X- K
  J' _8 `4 i& W2 G; t' M, N0 vbegin P_read arriving" F9 `$ V4 S8 q7 f7 e* _8 h
    while 1=1 do begin1 e, _' S8 H& X8 X
        read A_tote from "data.txt" with delimiter "\n"
2 K) ?4 ~% _  w; M: p( }, ~+ u        read A_time from "data.txt" with delimiter "\n") }9 L- `0 Y& n  ~* W, N* }& _# c
        read A_leave from "data.txt" with delimiter "\n"
! R2 ?$ E* f3 Z* K2 y( L        read A_picks from "data.txt" with delimiter "\n"  W4 _: k3 W; ]' P
        set load type to A_tote
5 I$ q' I) m1 q2 e! t1 p. A        if A_tote="tote 1" then set A_induct to 1
  n5 Y- Z. |2 _0 C7 l- u        else if A_tote="tote 2" then set A_induct to 2* l$ t$ Q1 @: Z3 E# N9 R
            else set A_induct to 3   
. Q; u1 Y! F3 B  v. D5 b3 ~        set A_i to 0: ?" K0 G9 [4 Q& u
        clone 1 load to P_induction9 i" E% m& ~" W  D* H+ f5 j: v
        wait for A_time sec
- p7 z# I  C: g) D2 t$ j% B, a    end& Q' H  I+ P& H
end$ |$ _" T6 s% n2 |5 l3 Q- b8 B+ f: t
* |3 G5 F! f3 Q1 p* a/ n
begin P_induction arriving$ m4 k9 G3 R" R9 \
    if A_induct=1 then clone 1 load to P_pick1
+ M: x! A3 |, v% ^    else if A_induct=2 then clone 1 load to P_pick2" a4 F4 ]1 U3 [5 F
        else clone 1 load to P_pick3
$ K# _" V# V4 ]end1 D& S7 G; w4 W+ ?

1 K) X1 ~& e2 E% d. \! h8 s5 r! Hbegin P_pick1 arriving, W+ B+ a* N; h& ]6 P! x
    set A_i to 1
+ U/ S5 q- r" [    move into Q_induct1% u6 |# I, h0 r) c+ k) G! P/ N' H
    move into pickaisle.induct1
& v6 B+ B+ x' j5 ^* X5 g0 t& l: M6 V    while A_i<=30 do begin& {' U0 s0 f/ x* o7 z
        travel to pickaisle.con(A_i)
/ q, p% S+ L  h. u( f; R- b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! E" v; J% t- g+ U9 r& F
        else wait for 10 sec
' |; Z( c" M$ }1 y        if A_i=A_leave then send to die
7 m* M- S0 u* L        else inc A_i by 14 |( i* C1 v: H0 }: B! q& ^
    end
3 Z4 c& U& }& U2 K( U, rend
' Z5 d( _" J0 e+ n) W0 x
# S: q" T$ ~/ B! sbegin P_pick2 arriving, T4 B1 m$ d9 x# I* [6 F! r
    set A_i to 11
6 _9 d5 j- X4 L+ ]* Y2 S- t7 z    move into Q_induct25 l4 c9 J8 n, A6 _
    move into pickaisle.induct2
+ Q0 D- k9 z8 j( i% L    while A_i<=30 do begin
& k. {: O  h0 P/ i% O% V        travel to pickaisle.con(A_i)
/ ?  r$ g2 S$ D5 U3 h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 `9 j: a7 M5 T2 B. Z( Z
        else wait for 10 sec; I  f) ~) U. |- X4 p3 @- B- P; o
        if A_i=A_leave then send to die3 v  x4 q' U$ T
        else inc A_i by 1
( l/ k' e% F+ ?    end( \+ E) Q9 A% q3 R2 r7 t9 P7 I
end
5 k; b) i0 |+ s/ B! @9 a- f% f
4 A. j) Z! N, Dbegin P_pick3 arriving
. }* ?4 G; j' j  S2 y/ K% p+ t    set A_i to 21+ F/ N6 `/ Z8 [& w; G
    move into Q_induct3
- I' \/ [  _  z: S5 r" _    move into pickaisle.induct3
6 }$ j( E" H2 L" ^    while A_i<=30 do begin. E7 m# V) _6 F( D- Y
        travel to pickaisle.con(A_i)
0 K" \  C, g" \# U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 E  j) Q. I) u% I        else wait for 10 sec
3 ~3 _, D, O: T. a( t" e+ ^        if A_i=A_leave then send to die9 V- F, R6 O% X; \( ]
        else inc A_i by 1) g3 H" g; Y5 m
    end
0 O+ ]* [4 c( h" F1 uend

最佳答案

查看完整内容

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是个什么东东?6 y7 q) R0 ?$ \- F; G6 y. i) }% [
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! G, p! n3 D+ H) s; y, ~
( g/ I" z, ?) v! {2 w" E2 K* x
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 b4 C% {( X0 d2 r7 `& z8 t

' }, y6 L0 s6 h" G9 @: e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ G6 c+ G! p/ N. S# B
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
$ _9 p/ w& o( U) I& A, N2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ \' }  T: [2 x! m$ o& `3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( G! M) ?5 U2 y; S; T6 H
begin P_induction arriving
+ u( z% G' E' |  M; s1 x' A$ ~    clone 1 load to P_pick(A_induct)
5 e; @0 B/ C5 m% z4 Jend最大的系% y- v3 V1 H$ X' }+ H

& B% z& ?- O4 P7 C$ E1 E. xbegin P_pick arriving8 J; y; J* q' P
    set A_i to procindex * 10 + 1$ m4 c6 b% V: }1 f: P
    move into Q_induct(procindex)9 \# g  S7 s9 V' {' X- Z
    move into pickaisle.induct(procindex)
2 U7 e' P4 x' W2 a, w9 i5 d    /*check the type of pickaisle.induct(i), for your last problem.*/' {7 L' D4 @3 Q5 @' b0 t- ]8 X

1 H+ [  u  o) e& A4 f    while A_i<=30 do begin
4 {6 ^* M( ^: h0 E% ?6 L        travel to pickaisle.con(A_i): o' X$ l& N) k' c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% Y5 P; c2 r% z! h" ~0 i. @: I( A        else wait for 10 sec
! _6 M# P/ W" q  v3 w        if A_i=A_leave then send to die
# N/ x. r' R! V) Z3 B0 K        else inc A_i by 1! o- ~, c0 G9 Q% [3 C
    end
9 K, [3 x' `3 Z- _8 G/ w4 v# }end
* O) y) F9 `3 P4 r3 E* G0 f# q" b) ?# b: E" i+ j
其中的procindex为整形,代表当前process的序号。4 o" Q9 f; X8 D' u/ q
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-3-19 11:02 , Processed in 0.024644 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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