设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12524|回复: 2

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

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

5 v$ ^6 O/ ^9 N) D% 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中的数值,不知道会不会有什么不妥。
3 r9 x. b& K3 K$ D
$ H: ?4 \2 f% }5 U1 }$ b2 _begin P_read arriving
% F( G9 F8 X2 e8 C  C, t    while 1=1 do begin0 h; [  j* Y: U  ]  m5 h' i# B* _
        read A_tote from "data.txt" with delimiter "\n"' }8 r- K! W, [! u4 S6 h
        read A_time from "data.txt" with delimiter "\n"
# d: }* ]7 F' v6 }$ K        read A_leave from "data.txt" with delimiter "\n") a6 e3 V. X* o  r- l
        read A_picks from "data.txt" with delimiter "\n"6 u: l; W4 X% x
        set load type to A_tote
0 F/ H2 Y& X: ?- |* R$ O) ~        if A_tote="tote 1" then set A_induct to 1# Q/ L& L5 ]) _" n. |
        else if A_tote="tote 2" then set A_induct to 2. P" V& j+ Q# E* [7 Y
            else set A_induct to 3   
4 D, s, Y* W4 y1 g6 X+ W        set A_i to 0* m* ^% n- d! {9 U9 G1 H
        clone 1 load to P_induction
0 ?  g" M% u- ?4 _; [2 e+ L        wait for A_time sec
5 e2 ?- E7 ]% M, Z" i! @    end$ p/ ], H: ?% f7 q
end3 P. f* u2 E* ~4 W

! g/ f3 P; ~+ G! C/ Fbegin P_induction arriving
3 k6 R. v3 z7 }1 I! w$ c. q: i( H5 K    if A_induct=1 then clone 1 load to P_pick1+ @4 d" E" s, V5 L& \% I, j8 A  j
    else if A_induct=2 then clone 1 load to P_pick25 M3 h( @8 N1 m; S1 g3 r
        else clone 1 load to P_pick3
" f* z2 e0 i2 Dend2 F7 `4 H' e0 k4 Y- A7 R) U
( @6 _5 k" q6 s
begin P_pick1 arriving
. [' q* L, f( n5 e9 o) v. `) U/ D    set A_i to 1
. V# v3 x( B) _9 i    move into Q_induct16 W0 r: k! J" `
    move into pickaisle.induct18 k. [$ G2 q# @3 ]
    while A_i<=30 do begin
1 u" k; t! V& y) n/ J. Q$ ~        travel to pickaisle.con(A_i)  p. L4 Z7 o0 g& K3 |/ J) {. U+ W5 g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* y8 D1 f% w6 L7 D0 n& W
        else wait for 10 sec5 B* \, c# k, S( b+ P
        if A_i=A_leave then send to die
$ Y  }7 b1 U9 U4 _        else inc A_i by 1
4 \& A' a, a' N8 U5 `/ Q5 `- q    end2 J5 u: {& P. [) d/ f/ V, M- l
end
! x2 G( s+ E  {3 h7 `
* J" }& _+ |# F5 d! _4 L3 B1 kbegin P_pick2 arriving
" c8 o: A/ {3 }% @7 u) ^, A( L. S    set A_i to 115 f( ?0 w4 T, a& X1 E
    move into Q_induct2
& J' o1 E. ?: i! {0 J7 t" Y. [$ u    move into pickaisle.induct2
6 ~% d/ d; g, l# B3 b0 m    while A_i<=30 do begin
' G# z# ]! I, d2 J' n        travel to pickaisle.con(A_i)7 k+ t3 J: S' D% W) c9 B( [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ c) \5 G2 L5 C$ x  _* `        else wait for 10 sec7 C- F9 _& {& u5 z8 K
        if A_i=A_leave then send to die
+ R; Y$ H) |/ p        else inc A_i by 12 a9 k5 F& K. E) ]- v# L/ J' E, o& v* J
    end
, o2 c* E0 \4 E. \; M, C7 Fend7 h! R( ?8 Y4 w0 M4 E' q* r
& |& ]2 _' ^4 p+ C" q8 L
begin P_pick3 arriving* V; Z, k! K& V  o/ x# _% l9 }
    set A_i to 21
: q7 N7 E# F! l; x. T# t    move into Q_induct3! X& d8 m. l2 G
    move into pickaisle.induct3
) ]1 g) E8 K% y5 E0 C4 q# M2 y0 E    while A_i<=30 do begin
4 L5 d' F. U" g. R+ @8 f        travel to pickaisle.con(A_i)4 r1 \: c  J  m: |# \* w4 H! b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 y. Y8 r  J$ o$ k7 H        else wait for 10 sec
/ c, ?+ f% G9 b5 R& A        if A_i=A_leave then send to die, N6 L/ S# Q3 ?- \5 _3 ^
        else inc A_i by 11 v: M4 Q% m' o& H8 o
    end0 `! {  t8 F; |0 t
end

最佳答案

查看完整内容

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是个什么东东?2 Q/ u+ C' T5 j
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# @' I7 i5 X7 K$ z
' }* T# B8 R: Y3 s! ~5 \5 aAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 h$ y" x* _6 e7 t2 O# f. |
6 b% J0 E% V! Z4 s
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 |1 z2 C7 K* K% S1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* n! S; T  F& D: c# n
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) ^+ E: R8 G8 k- B+ Z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:4 C* y  @. x8 `. B7 @" G$ L
begin P_induction arriving
2 g4 Q- `( }5 j  s    clone 1 load to P_pick(A_induct)
/ j' C; p2 _2 `& S- h$ t3 yend最大的系
: I4 H, }' M! h
$ L; M( [  x( rbegin P_pick arriving/ k/ C0 G5 V/ q: L
    set A_i to procindex * 10 + 1
& N+ G7 p$ i2 A    move into Q_induct(procindex)% {; o: Q+ Y4 u) o1 ^
    move into pickaisle.induct(procindex)
! U- ^1 S1 Z! v( U! m$ F    /*check the type of pickaisle.induct(i), for your last problem.*/: ^( o5 D$ D7 Z" h- C( c8 p
2 h) x% t6 t; g+ q0 a8 e
    while A_i<=30 do begin
3 M+ ~. j$ N8 a4 M# W( [$ P9 k4 _1 p        travel to pickaisle.con(A_i)
# J5 c+ k$ v" N) p2 i4 ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 P+ x6 D* a9 q$ f, A: {
        else wait for 10 sec* {6 l( e' T/ a* e
        if A_i=A_leave then send to die
0 I: x# S  ~8 V# H% v        else inc A_i by 1
5 W9 H( [/ i  I1 j6 U    end: N5 ?& v  [7 I7 t0 |, a
end
$ p/ N# S4 C, y+ U8 J, f
! Y7 T/ b7 }% w# C其中的procindex为整形,代表当前process的序号。
0 T+ Y$ r# ~0 w; v4 ystation和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-1-29 21:59 , Processed in 0.019477 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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