设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14260|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. T5 P3 @2 U3 U# W: U- A- K

3 x: \( u4 @- q$ L, @) |6 B我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 i% w; b; R* C9 u$ z% I+ G3 u

- v. D- z9 _' u' f" e7 _begin P_read arriving
5 q' T- Z4 A2 J: U; }! X& F    while 1=1 do begin
4 d% f, \* B, z        read A_tote from "data.txt" with delimiter "\n". L8 l5 ]8 n' V
        read A_time from "data.txt" with delimiter "\n"9 m4 I: m. {& w% ~) H
        read A_leave from "data.txt" with delimiter "\n"
: g0 D1 w+ Y: R+ v4 b: J7 }/ G        read A_picks from "data.txt" with delimiter "\n"
$ u6 K' R1 R6 N        set load type to A_tote
. C% f, O; C+ u3 g! m, W        if A_tote="tote 1" then set A_induct to 1& f- L* s0 y1 N. f- l
        else if A_tote="tote 2" then set A_induct to 2' U9 L! Q" {+ @2 e
            else set A_induct to 3   
4 L6 t5 ^! D" ]1 ~4 j! Z8 q        set A_i to 0* \5 \9 O7 `7 z, z7 Q6 q( H( o
        clone 1 load to P_induction/ e5 y( t: J1 Z9 y
        wait for A_time sec
" ^, U5 q' |4 `0 Z7 g8 V5 Q. C    end4 Z: d/ E3 L4 Y( _  ^, ^
end% _  j4 W' |% q
# f  C% ~, {9 H' ~
begin P_induction arriving
* ?# O6 ?% V' d5 G1 J$ F( {; M- U    if A_induct=1 then clone 1 load to P_pick1. z- k* {) h  f
    else if A_induct=2 then clone 1 load to P_pick2
7 s# x6 P3 ]( [3 \* V        else clone 1 load to P_pick3
9 u* Q% \! @0 ]% l# qend6 u# r, D7 K: E

2 t6 k% T; |; M8 a. p$ W5 k3 ^begin P_pick1 arriving: f7 }# p4 [' \; T
    set A_i to 1
' m2 j+ O) c1 q" B    move into Q_induct1
- t" D; v' @5 S3 M4 A# i    move into pickaisle.induct15 J1 S5 U. V* d% r7 s/ J/ Y
    while A_i<=30 do begin
$ r) v0 t# X& b( P* v( _* b        travel to pickaisle.con(A_i)
3 T8 n4 Y9 \! ~) ^5 Q3 t# b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' K: p, H& _4 w8 v' v& h        else wait for 10 sec7 S! N5 f( _7 c. K+ R/ I5 _
        if A_i=A_leave then send to die
# o2 i0 |0 b! A* q" @2 w        else inc A_i by 1
$ c2 n0 X( |+ H( i  u6 A" M; h    end4 }5 j# O) A$ v" Y% \3 @
end
, y! |& N, v% c! `' s& N
7 ]9 Y8 M6 ^$ H5 r9 Kbegin P_pick2 arriving
; x9 p# R. J( h    set A_i to 11) x/ M) j: J+ I+ R! T& D8 s) v: j
    move into Q_induct27 D0 I- ?0 Z( ]2 o
    move into pickaisle.induct21 ~8 Y4 k/ X4 _6 t
    while A_i<=30 do begin' F: m* a$ U+ }7 k5 j- i
        travel to pickaisle.con(A_i)
4 N& U5 P+ [$ X( Z. p% h; Y( {7 b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 P$ G& x+ n$ w) o3 x        else wait for 10 sec
; g# d6 ?* |" i        if A_i=A_leave then send to die! f" R; `% M( u9 J( ^4 I0 _1 i
        else inc A_i by 1
/ ?& H$ S  J9 K, N  p6 c4 v7 \    end
" C' A8 h5 S1 v" w# ^; Y6 S; y) S+ fend5 V4 I7 U+ _  a. @' ]% h4 v. {
& `  G8 r% X5 H; m
begin P_pick3 arriving/ S' I& U2 K8 `; S& Y# u& I3 b
    set A_i to 21: L( T" j- U  V5 Z$ Z
    move into Q_induct3% ^! J. W. x1 b
    move into pickaisle.induct3
2 [+ Y! l7 J8 U    while A_i<=30 do begin6 {; r4 M& A# V* t0 S  v# L
        travel to pickaisle.con(A_i)
; `9 d! b; q8 Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% ]. ]1 I9 S1 m7 I+ V: @
        else wait for 10 sec
. W, {9 i" x. t2 X5 W4 z$ c        if A_i=A_leave then send to die% S- F+ e' B2 {
        else inc A_i by 1
* v" x  D) o0 N5 a    end
0 w$ T, ~+ J- send

最佳答案

查看完整内容

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是个什么东东?$ n1 U7 H. h! v' y& i4 h9 m  x/ t( w
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 l2 w9 a) f7 y5 {4 t
. z8 m# e. G$ h
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 s3 u. h1 q4 R7 I2 E& p8 M8 x4 J( W) o4 N1 r2 D
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; a* X* ?1 Q# o! @$ E9 A  h! @1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ \8 \* k0 }/ M: @  c2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. l8 S" B6 m+ ~2 v
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 k: n5 x. f2 a- F! sbegin P_induction arriving- V5 Z% H6 p+ b4 C5 F( Z
    clone 1 load to P_pick(A_induct)
/ W4 h6 \% ^- F' jend最大的系, \: k1 m- U3 e' ~. j7 t

- |' A% Y8 M' ]8 j! c5 B3 Qbegin P_pick arriving  O8 ]" I* S2 p- d! `
    set A_i to procindex * 10 + 1
6 e# E, }; J3 Q& @  g, X    move into Q_induct(procindex)8 m# Y( A( n, b3 L' h1 t2 X
    move into pickaisle.induct(procindex)* g$ k. V; Z/ ?) z% B; Z! X
    /*check the type of pickaisle.induct(i), for your last problem.*/
' N: X5 T+ ~5 {+ V+ W* v6 H  h* d+ a/ E6 ]
    while A_i<=30 do begin7 ?, Y8 ~1 h3 m5 \. d
        travel to pickaisle.con(A_i)
1 Y7 P6 o/ h: U+ U3 X# ^" [( R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. L9 o  T: a7 N; V3 ~        else wait for 10 sec
) I$ T0 H7 S% N$ \9 k        if A_i=A_leave then send to die+ j: S( e  B) {0 N/ x
        else inc A_i by 1$ O9 A8 V6 V4 I! N- r
    end
! f/ e- p6 s2 `* Q# S) _end% J1 `) ~' D0 U3 w6 p
6 o( U2 Q( U, x; S5 d5 i) V; g
其中的procindex为整形,代表当前process的序号。
. A7 K* G- j0 S+ Astation和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-6-25 23:34 , Processed in 0.015208 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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