设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15501|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  l# a8 t0 u# Y# S% s0 v0 G; E% A# h; y" U
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 q. W8 i- j; R9 s+ |

/ ^8 R% c# A$ i+ R5 }' J  U! }! Ibegin P_read arriving1 J% R5 n: w. y
    while 1=1 do begin1 H( Y- w6 C) k8 `8 _
        read A_tote from "data.txt" with delimiter "\n"$ ~+ \, K' B0 h- x7 E
        read A_time from "data.txt" with delimiter "\n"/ b8 L' @  K* r( R/ X. i! C
        read A_leave from "data.txt" with delimiter "\n"
9 v! J& i( \3 l5 p3 q3 v        read A_picks from "data.txt" with delimiter "\n"1 F2 M% N- q% Y' N0 P2 w1 _
        set load type to A_tote* ?# I- [, \) |
        if A_tote="tote 1" then set A_induct to 1
  ~4 R/ O7 a: L6 M; {3 a        else if A_tote="tote 2" then set A_induct to 2! v& J1 h: ?, x/ r6 A
            else set A_induct to 3    . u6 b6 i$ W7 O) M6 c
        set A_i to 0
; v/ l: q9 r# k5 T* {) I. ~        clone 1 load to P_induction
( s+ |% G) {. r$ o& a5 W6 b        wait for A_time sec: O2 A8 Y3 d, ?7 [$ u. d8 u" O
    end
7 e- y& }$ a; N! B4 _+ }end1 x. ]# {8 E( e& j4 Z& T

! [+ g1 S8 X2 @2 }begin P_induction arriving0 ]) d0 u8 q; B  G; m. t% H, v
    if A_induct=1 then clone 1 load to P_pick1
, I) Z) y& G' y9 o! B    else if A_induct=2 then clone 1 load to P_pick2: b% m+ [* P$ d# k  u* {
        else clone 1 load to P_pick3, H# {! l/ j4 b
end
7 `+ i4 o9 i& [( \4 U8 C: Y' X' C% q" {$ h
begin P_pick1 arriving
2 \8 T" ?, a$ d2 x    set A_i to 1
: g! J) q0 {# o, L( N2 }% f& ]' [    move into Q_induct1
. @/ b, Q) T9 U6 r) ?    move into pickaisle.induct12 P( h$ Q; y% P/ b+ P" c7 g
    while A_i<=30 do begin) E8 k' t7 P, I7 d  n3 c( y
        travel to pickaisle.con(A_i), i+ ^6 z7 f* ^4 f/ E5 Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ D1 k$ k' v" M( N; p' R
        else wait for 10 sec( _7 s: S- g, ?: t0 O8 y2 D
        if A_i=A_leave then send to die$ x$ o/ ]" K6 `+ y! I2 I) v
        else inc A_i by 1  i% G) [4 x, ?5 g; }
    end
' [  a( e, a: Y0 X. P* x; s0 ^end  U/ `9 p) j9 h2 b
: @, }* `6 W' x/ J
begin P_pick2 arriving
: u0 H5 x& m+ k- }+ c    set A_i to 116 c: M5 o: W" ^. u- W
    move into Q_induct2
2 W1 Q# p7 z, [& ^, H    move into pickaisle.induct2
( y' ?2 x* F, F5 f    while A_i<=30 do begin
" ^; {  o2 U7 t" N        travel to pickaisle.con(A_i)
+ B! W* d& q* V1 {( q1 G& a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' O: W- G7 p* }) d2 ^  o& w
        else wait for 10 sec
6 B1 U. E5 M% @: Z2 A        if A_i=A_leave then send to die' S* Y+ N+ [, W' d
        else inc A_i by 17 j) j* l6 w1 U5 S: p
    end$ W! @! `- O( N, i0 P6 V! Y/ U. e
end6 M( m1 c8 v0 B, r/ [% T/ r3 a
$ j5 w! l; [! P' m, {
begin P_pick3 arriving$ m- ]4 L6 F- ?: M
    set A_i to 215 C+ G# A% A; A4 F7 h
    move into Q_induct3
; j$ U# E: I/ j, _: r7 L0 y    move into pickaisle.induct3
7 i3 m- C* N( V; K1 |    while A_i<=30 do begin
0 b6 G. @# s; a1 x& _% Q7 S        travel to pickaisle.con(A_i)6 J' i, @/ A9 |1 K" A7 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! ]) b( E% \: U% [7 r        else wait for 10 sec
. y; ]0 L/ }4 n( [$ `0 G        if A_i=A_leave then send to die1 S$ @3 z, G2 `% _: R; `0 ]4 u5 n. K  u
        else inc A_i by 12 {+ \) C) `. X# h  U; |! w
    end  F$ J& t+ \' S9 N4 ~8 g
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 x; @# w' y9 g+ |- B" {/ Omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ m; r) E3 o) ]# F. l

3 Q5 s) Z' S5 e9 Y+ w$ z) aAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 K6 ^! L. H- F; Z0 s
) F3 h; @! p/ }另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) \. W7 k' S3 d4 t& L
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& A9 y- j6 a2 e2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- G3 ~! U6 y5 C) s) a1 V5 u! k3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  i7 a/ O' ~# ]# D+ D% sbegin P_induction arriving2 Z, K2 t& e$ e( I* D! u
    clone 1 load to P_pick(A_induct)
5 X# x4 p- s+ k+ e$ lend最大的系
, N0 s1 _2 ~( C- |( N# x. g7 M
- s1 i8 K. ]- |! ]* Abegin P_pick arriving6 w8 d5 N, j, z, |0 I
    set A_i to procindex * 10 + 1
' S( \" |" B3 B! d    move into Q_induct(procindex)
; @3 v1 f3 _+ w3 X7 |, B* J    move into pickaisle.induct(procindex)0 j6 [2 h! {7 M! Z/ V
    /*check the type of pickaisle.induct(i), for your last problem.*/" V8 x$ Z5 t2 K- a

  h9 F$ t/ R/ ]( }' C    while A_i<=30 do begin) l2 r7 E$ |& f2 i2 t" z6 ~
        travel to pickaisle.con(A_i)2 I" Y4 z  v1 ?, x% o3 v# o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( m0 l: A* {$ R1 z        else wait for 10 sec+ J( C8 V& z3 B: w& x- \6 g" A
        if A_i=A_leave then send to die
, f+ y0 H5 l2 g4 B/ h+ W, Q' }        else inc A_i by 1* c3 V" E; G8 O
    end
, ~) {8 ~0 ~" b7 bend
! a! D$ z! d' z' p, A! f
  `& l+ l& D2 a其中的procindex为整形,代表当前process的序号。
5 R7 H6 ~4 K* O3 g1 H4 u; sstation和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-9-15 10:17 , Processed in 0.019474 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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