设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9517|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 S* \7 O4 C1 T: l
$ S1 N/ L" A1 w  Y" @6 {我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) A  x0 v% \" w' O* L8 A! `; k8 e: c
begin P_read arriving( A/ e7 c! D# h3 K9 T* Q9 ^
    while 1=1 do begin# @% F* i5 T3 n* v$ o  J" H& T& f
        read A_tote from "data.txt" with delimiter "\n"7 z2 R; A! ?9 c# b: b+ J9 s
        read A_time from "data.txt" with delimiter "\n"
* v& d: p" C/ k$ t3 ^        read A_leave from "data.txt" with delimiter "\n"
( K; M& v6 L/ f$ e) E        read A_picks from "data.txt" with delimiter "\n"$ R6 ^2 k9 {4 g5 O/ l9 P
        set load type to A_tote
# h7 `$ S* D- _        if A_tote="tote 1" then set A_induct to 1
1 z0 C8 |* J& g2 J        else if A_tote="tote 2" then set A_induct to 2  M; y" S- z( R4 S- w3 y6 w6 h
            else set A_induct to 3   
9 P; M" L: x6 k7 q        set A_i to 0
# U' k3 T, ^  P        clone 1 load to P_induction7 x  t: v# [8 w  A0 T1 ~
        wait for A_time sec& u, H  w/ |+ S! O- F* W8 ?
    end3 Z9 P" ]' `8 W: V, J2 x% {
end
' f. |' q1 H* B$ @
, H) _' `7 `9 `4 ]begin P_induction arriving) A( s" w" K# N* ~* O; J
    if A_induct=1 then clone 1 load to P_pick1
, K8 w& E2 r* ~3 P4 C2 v# m    else if A_induct=2 then clone 1 load to P_pick2: L% D: w7 N! Z: H( r
        else clone 1 load to P_pick3
2 `( b+ _( T, v& eend
8 i1 e1 h* @2 R) W0 M, _
" V( D. F5 h6 J+ ^( H# k; }begin P_pick1 arriving2 P" P& N! u" o/ K( Y3 n
    set A_i to 1
; W" |7 d2 s( c, q    move into Q_induct1
  T& ?. C% `( ?0 r  j& u: \    move into pickaisle.induct18 t" b- S5 x( K6 N, f) z+ j4 L
    while A_i<=30 do begin; u$ S1 e$ ~. Y5 @( _
        travel to pickaisle.con(A_i)
0 O' i! S/ l$ c2 f- k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ A! G) n$ L; Y7 e+ l        else wait for 10 sec% D+ w+ t9 D& U. x
        if A_i=A_leave then send to die
+ X7 T5 Q; Z/ r& T        else inc A_i by 1
2 H6 j  U  v0 }* ?3 e) n  ~    end6 @. f0 ~3 ]; J; N
end
. p  {0 r  L+ T( x5 f) R
  P6 S% {/ V1 S& ibegin P_pick2 arriving
% Z' w2 a* z, b" L    set A_i to 116 o) D5 c5 P: S1 ]
    move into Q_induct2, F+ ?# N0 `' v) n
    move into pickaisle.induct2
+ d- W7 V, B! b( a: s    while A_i<=30 do begin
+ R; H. F1 B1 v4 }6 q% ^' R! |0 ^8 e, @        travel to pickaisle.con(A_i)
7 d' I6 S* q+ N! _% S: I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 U) u2 c( w% S( p6 u6 @$ Z' ^. c        else wait for 10 sec- ?, G0 |! }, f4 b6 z$ a
        if A_i=A_leave then send to die! @5 [- m. p' E
        else inc A_i by 1
! w7 d$ q* e- Q8 V' |+ X6 x. P    end
) N# u2 X! [! Y: kend
' Z; Z& k9 s5 ]; U5 s- b) F" y0 Q/ e% C8 }* w3 h
begin P_pick3 arriving7 ~' n, [0 j! Q4 z  C
    set A_i to 21
- D3 Q& N" t/ N1 g+ a: a    move into Q_induct3
8 u6 Z7 x: b8 n: V; j. v, o0 n    move into pickaisle.induct3
  o& M% i( O$ E/ z) E9 I! T    while A_i<=30 do begin
2 [6 U! A; j6 s% \( \0 J* K        travel to pickaisle.con(A_i)$ Q: t0 Y% ~0 w/ X! r  a3 h' Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, q+ u  ^  _4 p3 r+ ]7 A        else wait for 10 sec, J1 t  Q& @" V# \5 H$ c+ h$ o+ x
        if A_i=A_leave then send to die
* A- n2 |. `- N$ d        else inc A_i by 12 E7 G+ Q# U* b
    end/ l" B! s, ^1 S' s8 V
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 z; [1 b& I$ K* Y' _
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
2 H3 _+ U1 }3 P; x2 U
3 Y% D7 I$ U" E# B2 E  B4 tAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ i, J1 B; V: K& R" x. T1 J9 \* n# y% b' U6 {6 C/ x, |, p8 |3 U
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:# l( b6 c  b; R
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% P0 K; }( d1 n7 a( `. ]* @/ Z
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ |6 O' h) T5 m! B( @4 X4 v$ g3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 T& _3 [  u; U) s
begin P_induction arriving, L) A" U4 {- x9 a
    clone 1 load to P_pick(A_induct)
- `0 _/ y( P% i  g- N3 Jend最大的系
  J7 M- |3 a" S. I0 [
# k" I: |: g' {; i4 O4 A/ Ebegin P_pick arriving; j1 y9 d+ y) |0 f# D
    set A_i to procindex * 10 + 1
" z% u0 u2 c7 T2 r9 Y/ W    move into Q_induct(procindex)' o+ H$ N+ e2 w
    move into pickaisle.induct(procindex)% f& |. q5 q9 I& a' x+ L
    /*check the type of pickaisle.induct(i), for your last problem.*/) y, Z* `4 F. z, ~

, |% r' r+ P% d: q    while A_i<=30 do begin
! y6 h/ g5 k3 s2 Y        travel to pickaisle.con(A_i)
; v5 w1 a" U' A# P" t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- ?1 ~/ U% e: `  L/ ?
        else wait for 10 sec9 U: Q( h8 ^7 d% c  y; ~
        if A_i=A_leave then send to die
6 R$ \+ h, ]1 @. m        else inc A_i by 1, o! h8 S/ |. [& D' t
    end
( f! f; l8 z% U+ I$ r7 nend+ {) g( X' r$ s7 n8 \/ [

) m7 i+ l+ z. ]其中的procindex为整形,代表当前process的序号。
& f5 n. W. A( C# i' |: 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, 2025-6-4 05:02 , Processed in 9.589837 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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