设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12141|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 ~4 Y9 o3 U$ k% o* V6 ~; W6 a
+ n/ c1 q6 k3 r, u2 ^' C& W我的问题是,在每个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" s4 |& M3 y% m

" _( K+ k9 U; ^. T4 i# b- Abegin P_read arriving' V5 }1 I  ?0 u6 m% v. n
    while 1=1 do begin
# l* Z8 n% G$ O' h' t: h6 u        read A_tote from "data.txt" with delimiter "\n"; ~1 k. D" y0 u, w
        read A_time from "data.txt" with delimiter "\n"
5 P. Y" n. O! {  O5 c4 e  P% s        read A_leave from "data.txt" with delimiter "\n"" r# P3 N2 g9 H. \. r; j
        read A_picks from "data.txt" with delimiter "\n"! T+ r6 ^. S& t# p3 N) c& I
        set load type to A_tote
; a1 K% c6 x( w! p  I& J; B* m        if A_tote="tote 1" then set A_induct to 10 i# b! s" E4 @& U$ f1 M* J
        else if A_tote="tote 2" then set A_induct to 2
6 R- u: @, X+ U0 D            else set A_induct to 3   
7 [2 h8 f$ L% ]7 ?: d        set A_i to 0
0 k. J) Z3 O: r1 E9 s, _% K# t        clone 1 load to P_induction, f4 f& a) o! B! g$ I# ~
        wait for A_time sec8 e; B# Q# G/ Q6 ?! ^
    end
' g! a5 X: @8 w- n. y" qend
7 ^- d& t! `! l" f; g7 U# Q' b# k8 Y
begin P_induction arriving# K, w/ p6 g0 I9 q7 h+ a  h$ v
    if A_induct=1 then clone 1 load to P_pick1
7 f0 o: Q) ^: J- X    else if A_induct=2 then clone 1 load to P_pick2
" |; a; |, p# A+ G" Y- w        else clone 1 load to P_pick38 _# L8 q5 P2 n9 R
end
( ?' y" z+ z0 w: Q1 j1 u1 {6 f$ X  Y* w, _1 Q2 g6 ?: x: R0 s) f
begin P_pick1 arriving
5 H+ V+ g2 U/ n# Z& {    set A_i to 1' a" N4 P- Y% Z+ j- P# Q4 q
    move into Q_induct14 b2 U# C% D7 o, i) k( S, t
    move into pickaisle.induct1
9 M  P: D( O- \/ ?# f$ G8 W    while A_i<=30 do begin, S3 C/ H, j' t" u/ k/ Q
        travel to pickaisle.con(A_i)$ e  z7 \- J0 i) m- Q( B: @- Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 a/ e( F' m6 ]9 _/ R        else wait for 10 sec7 U1 s- j7 k& N  S
        if A_i=A_leave then send to die
% f: c. t2 b  ~/ B6 p        else inc A_i by 1
! T# M9 y4 M4 B    end
/ {) ~% T/ e% U/ ]; X+ }end; I( L1 R# |4 d: y" ?. p4 S  w

. |. I; C" Y/ R4 S; xbegin P_pick2 arriving
. h& m, f3 q  p5 p5 G& H7 h    set A_i to 11
9 p6 H* i3 K1 f7 {7 J+ K% \    move into Q_induct2! b6 o# n  M; _8 H
    move into pickaisle.induct2
0 X# U; e2 h! o) q* W# n9 W; j' _- Z3 r    while A_i<=30 do begin
4 O0 X- W  V1 o0 l5 h        travel to pickaisle.con(A_i)! y0 e" }2 N3 O2 y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 e# Z3 N# l( \, g! a        else wait for 10 sec5 \/ X3 l! \* z) h9 }3 Z( A
        if A_i=A_leave then send to die
: q' X/ O4 i3 d" e+ C+ Y        else inc A_i by 1
: {2 \$ E& L! G3 {; G. M    end& u. X! k2 H: x$ Q
end1 l) d  u! W" d& |" ?9 j

( T7 k  K, X" _begin P_pick3 arriving
2 f% e- U% X+ r, U8 A    set A_i to 21% f( c: J9 |; f
    move into Q_induct3
2 Y: Q( L) U: [: C1 L$ u# ^    move into pickaisle.induct3! K9 |" _% q, Y' v8 J+ ?
    while A_i<=30 do begin
+ b2 G, o  }* v- P2 q        travel to pickaisle.con(A_i)  g- ?" t: C  _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, l  e8 B! n2 e0 Q8 m  H/ h
        else wait for 10 sec; I; t$ m- f" m+ U+ @0 v3 E, M
        if A_i=A_leave then send to die7 q* y) {9 ~9 a1 U6 m! D
        else inc A_i by 1
( b) @0 p7 S% F6 ]( @. o0 S    end
" z3 t, M$ ?+ g) e+ pend

最佳答案

查看完整内容

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是个什么东东?
" E2 P/ L4 j0 O' }move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; z& T( }1 x1 N2 }5 G/ Y/ N9 b# f$ d0 Q8 p+ {' _
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; w! E% I, \. ~

3 ^+ b  ^/ ]) P; @! l; v: C/ \另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 K+ W# c% S# ]. O  o5 e1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 M$ d8 q  w  Z' l" n
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 y/ M! W4 l+ V* D) r% a1 E
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
0 i  [: G- z0 B! G2 V6 ~begin P_induction arriving
9 A' e0 S6 D* v, D    clone 1 load to P_pick(A_induct)# \! ]7 l1 |! @! G( t6 X3 o" x6 m" ~
end最大的系
6 B) C7 u- Z0 l4 z2 h* o! I
6 r/ j0 n# n7 W  r2 Bbegin P_pick arriving- o/ g# C( G' A- G  o) B
    set A_i to procindex * 10 + 17 P' U' Y2 T, q" F/ Q( Y8 x
    move into Q_induct(procindex)
) B, d( g+ f9 r& h3 D    move into pickaisle.induct(procindex)- l. B/ c: M; t
    /*check the type of pickaisle.induct(i), for your last problem.*/0 Z8 S2 Q7 B; c: f

* x- z* F3 Z, S8 k2 M    while A_i<=30 do begin1 @/ o6 v6 U) `( v$ o- D7 a+ b  X8 Q
        travel to pickaisle.con(A_i)% M* i' K3 W+ m9 N+ G% @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 s+ J0 m$ y( v8 `2 L: k
        else wait for 10 sec
: Z4 W. Y5 J4 z/ V% {3 p" g" p        if A_i=A_leave then send to die
4 d4 C- G' g) m# ^# \        else inc A_i by 1+ w+ k1 Q( R$ L4 k: P; {
    end
1 w5 D0 }5 e" V2 ?9 a+ @end
/ b+ A8 d' u: ^) V! [" C
7 F8 B* F3 U- I. R1 p- p其中的procindex为整形,代表当前process的序号。
/ K& b" l1 i2 t4 V8 Mstation和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-12-30 17:40 , Processed in 0.016138 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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