设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10669|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 {* P; W% x+ u$ V0 t

- m0 s  _8 g; I8 V我的问题是,在每个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 g. L5 q8 s6 b$ h* i/ {
, n3 M# G, a# _! n0 \
begin P_read arriving
4 r) r7 l- v# ^    while 1=1 do begin; E* V0 M' v9 e9 m
        read A_tote from "data.txt" with delimiter "\n". ^! B6 ]+ J. `2 \8 R& Z3 e: \
        read A_time from "data.txt" with delimiter "\n") X$ n0 [- D& T* y, D. G
        read A_leave from "data.txt" with delimiter "\n") b; G- R' h" v' t
        read A_picks from "data.txt" with delimiter "\n"' q  u# P, b, r. f
        set load type to A_tote
- k: J- c: f8 _! ~        if A_tote="tote 1" then set A_induct to 1
3 ]6 I6 I: f, f6 X7 P        else if A_tote="tote 2" then set A_induct to 2
- \( S& ^6 i8 O' L0 q0 J            else set A_induct to 3   
6 r% I9 y- U: Z9 L2 W3 ], X0 J; t" P        set A_i to 0
9 S1 L8 o2 h& A        clone 1 load to P_induction
3 E( t% s; t7 ^) g' W4 `) a        wait for A_time sec
! M8 @& _* E! R    end! g0 F# E1 k" \, C: U+ R* W6 U
end
+ f1 R, a0 {5 t, [  m
$ S- F' D, O5 D( U; Q5 xbegin P_induction arriving; d- q# `3 }$ B9 G# _2 m& ^
    if A_induct=1 then clone 1 load to P_pick1
2 y& I7 }7 f; {+ e& n% E( F    else if A_induct=2 then clone 1 load to P_pick2
# r% ^# x; @) F- T        else clone 1 load to P_pick3
! ^3 _, B( F( z! }$ e: d! Rend
8 G) ]% e+ k+ k( \$ H& p9 G1 M: d, d* r; A. K+ F" e
begin P_pick1 arriving
8 W) W7 \8 K4 {  m5 T    set A_i to 1
0 j* E& X! [7 z    move into Q_induct1
- U- P9 l7 @0 ~, d- R  B* C    move into pickaisle.induct1
4 y% S* I' J4 g" @) M    while A_i<=30 do begin
6 B. W! ]! d6 U1 T* b        travel to pickaisle.con(A_i)9 X8 P* c3 C+ h% R: h! W  I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 `: ]2 [8 o1 R* Z5 T
        else wait for 10 sec, C1 n' C$ O0 O) o1 V# A3 f
        if A_i=A_leave then send to die
0 G$ b$ w: w4 z- f        else inc A_i by 14 `9 J' P  L/ U! ?, C
    end: Z1 z0 ^8 A3 u- }/ ^6 k- K
end. f4 \) t( T- b  y* H0 ]
/ ?9 M. z9 ~3 v2 e( K' F
begin P_pick2 arriving
5 v% X" c+ X$ c3 W$ b7 P6 x7 O    set A_i to 11
6 f$ l- X0 j1 Y# |$ I    move into Q_induct2, y( m  I3 n* y% D$ S: {& U. ^% y
    move into pickaisle.induct28 Z. ?9 u' \* N* g, b5 ?
    while A_i<=30 do begin4 D$ c* u( R/ v1 B2 M
        travel to pickaisle.con(A_i)5 o( W& n" c" f9 X" N+ @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 ]* N+ L+ C" D5 D/ M( h. c- A        else wait for 10 sec7 ^! S  {5 [; p! a
        if A_i=A_leave then send to die
- m" u/ m; }9 {9 p  v        else inc A_i by 1( V- G" i" [1 \3 N# q2 U
    end. v% L* W# a) e1 y$ N$ b
end
# g5 }6 m0 `3 F; ?% P: g: R1 `! X* b' x& V( y. Y
begin P_pick3 arriving
' M; d. P: z8 U& Y7 Z  D7 o/ r" v  g    set A_i to 21
& q# S. @' d5 g0 v! \/ ~    move into Q_induct3
& W0 X/ l1 s* _; y2 ~+ \& N7 ]" t* z    move into pickaisle.induct3
  Y5 J9 J% S+ k  j1 T7 p1 i    while A_i<=30 do begin. j1 w: v% {# q2 Z) o
        travel to pickaisle.con(A_i)& I" W3 P. a/ C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 H+ E( F) l  V6 X2 [0 Y1 W1 g6 [( @        else wait for 10 sec2 H6 p9 |" O3 G0 ~- {" S6 s( t
        if A_i=A_leave then send to die4 M7 W6 s3 t) |: f
        else inc A_i by 1
4 P4 C3 w8 E0 O. J1 m( {$ I    end
* l) ?; X# L0 x( `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是个什么东东?  i; c" U/ h, a, j! ?- w, s( V  T
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  y6 K0 _# N' s3 Q3 ]
% f: @/ b2 N$ L7 g# |AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& X9 K  G; Y$ n2 d
# r8 g+ F0 @3 S' G
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! y: A1 L. ~; J- l2 d$ \2 l' [
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
0 N) w1 g- V% y% A9 D# D# t$ Z2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 @8 k5 O! p5 n& h9 K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- W; e8 O, o+ L. T7 d
begin P_induction arriving2 C- M* I/ M7 J4 s6 U+ n- M! u
    clone 1 load to P_pick(A_induct). m! K7 e. f: F+ Z% ?* K9 H
end最大的系5 c7 g5 I! A. F
1 A3 ^& `) c( q9 W& |& a+ i
begin P_pick arriving
2 k" y" w+ O- q) j, P/ n    set A_i to procindex * 10 + 1
+ t% f- f1 a% B  h9 q+ `; t  Q% N    move into Q_induct(procindex)
7 g# V3 A4 U( y- `    move into pickaisle.induct(procindex)& F4 \# Y3 @  w! ^1 Z8 ]3 }+ _
    /*check the type of pickaisle.induct(i), for your last problem.*/
0 k$ ~% Z. a: Q: h9 r) I( K
: H9 l7 s+ Z  u  F    while A_i<=30 do begin' ?; J4 F. z1 Z) Z
        travel to pickaisle.con(A_i)
9 R! W. k3 _' l, k6 J; X# q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  }5 @% D! i2 m6 h/ I% V8 N3 c        else wait for 10 sec" X) o  z9 T4 J" y1 Q' `$ J
        if A_i=A_leave then send to die6 ]7 f- z2 ?1 _; j
        else inc A_i by 1  b: s# \0 `. I7 m) G1 ^; D. _$ Y1 l/ T
    end
: n8 c  {: q7 ?: Send
+ z; o- m* e% @4 i
) Y/ z$ |5 @3 K) P其中的procindex为整形,代表当前process的序号。3 ]2 ^- e3 r! G( I
station和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-9-18 05:30 , Processed in 0.019079 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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