设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13429|回复: 2

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

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

( ^) l5 ~. V% H我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% T" b9 A0 t; F" J+ A
+ z+ h3 b" I- z, ]1 e) l0 Wbegin P_read arriving* g1 |& Y  v0 G6 B- p
    while 1=1 do begin; E' t% q5 ~* I6 O* `0 B
        read A_tote from "data.txt" with delimiter "\n"% [# S. C  ~3 a
        read A_time from "data.txt" with delimiter "\n"
  R' O: w* d5 Q: O. d4 D2 h        read A_leave from "data.txt" with delimiter "\n"- L& V/ U4 R9 t7 k( v
        read A_picks from "data.txt" with delimiter "\n"
  H6 d9 _. |% w        set load type to A_tote  g* J4 j' Y) N" I% F
        if A_tote="tote 1" then set A_induct to 1  {* C  }4 K7 A/ S- z( c9 V6 a% B
        else if A_tote="tote 2" then set A_induct to 26 R4 `) C/ a. A5 ^5 |9 U) w
            else set A_induct to 3   
- a* M( P  r$ T2 x# c0 S        set A_i to 0
5 \1 T/ K8 ?3 ?# }6 F7 F0 J        clone 1 load to P_induction* G  o* {/ [. Y; H# T+ \
        wait for A_time sec. Q5 n8 P7 u1 p: M5 x% O
    end
& U: V5 r  ?2 qend
! O: h5 w: K' U' a# V; N! v0 W: M1 X9 R: v  A" x
begin P_induction arriving. M# e- \/ s* C9 z( |' \/ p2 X
    if A_induct=1 then clone 1 load to P_pick1
% g, i  x6 |8 w% H8 ?    else if A_induct=2 then clone 1 load to P_pick2
- ]0 c! K/ h$ T5 M3 C# D6 G        else clone 1 load to P_pick3# y9 b3 T$ M1 P- L: }
end
! D* h! q* ]+ a5 n9 h) t9 i; h! o. i6 [& ]4 ~5 S2 V: H6 g" v
begin P_pick1 arriving+ [. g' g  b' A# \& \+ u
    set A_i to 1& K* v. d' d) K! G- {2 l3 P0 _
    move into Q_induct1$ O2 m% N7 c; @( [7 S+ y& k
    move into pickaisle.induct1# L* v( V. F% ]6 F' p
    while A_i<=30 do begin
$ k% S7 Q! o2 H0 D5 _& {        travel to pickaisle.con(A_i)' Z; ?% V7 C- J3 e6 n$ [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 L- F1 k% B; F) Z' J7 m3 l        else wait for 10 sec
! ]" R* ~# w; q/ _        if A_i=A_leave then send to die
3 O; n5 k$ [$ f        else inc A_i by 1
/ Y) Y8 q: @( g' w! _5 R  }    end7 T8 x2 v( l1 P) I  s# ^$ P' ^. V
end
" ~; B* q; t" R, Z8 j7 x4 @0 p  l% y1 a  d3 `1 K* @
begin P_pick2 arriving
/ o( c# k$ C: t( [+ b    set A_i to 111 L. ?: d- [- d, K0 x8 }
    move into Q_induct2( \& t% Z$ y* D& n6 O& _+ z
    move into pickaisle.induct2
$ w" i2 Z& O. i& S; w    while A_i<=30 do begin* K) x2 f/ F6 `4 t- n6 z
        travel to pickaisle.con(A_i)
% Y2 ]! B' H' k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ M3 L) p, O0 D& P1 b  B        else wait for 10 sec0 S8 b3 J: \! i8 P2 K
        if A_i=A_leave then send to die9 y* F% V* X& E
        else inc A_i by 1
1 |/ u' i% n7 k4 h, h3 H: ?4 `$ i; L    end
4 |0 Y' }9 J9 t+ t6 }' H+ l! iend
  [' f/ s* i& K0 K0 v9 F. P( C
, x9 q2 b/ ?8 w" ebegin P_pick3 arriving
6 D! b3 O2 K# \, H% W0 e* ^3 |    set A_i to 21) @2 ^% Q9 b5 N; H# b" e! |7 H
    move into Q_induct3. W$ W/ V' o4 p4 m7 i" y' O; T, C
    move into pickaisle.induct3+ M5 B2 w8 F/ d
    while A_i<=30 do begin
4 L5 {. r8 m5 }. ]0 I. x# H! M: w1 I        travel to pickaisle.con(A_i)
: C$ K8 t) a. e& ]+ E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ ~! q! j, O) W( a* G        else wait for 10 sec6 x3 a( T& q! {6 ^- ^: [' o4 r3 ^
        if A_i=A_leave then send to die9 B* x. I  g0 ?. ^4 V, {# U* k6 v; t
        else inc A_i by 1
- [5 X7 P9 v: v. ~    end* m1 h; ]+ ?% f
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是个什么东东?
- b+ i/ |: h( ^3 nmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  q2 p9 X( k; \! D/ o2 g2 _

' |* Y+ X. N3 X8 u+ a) ~AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& F. D& z+ S; {- y& }

0 i( S* g- P; m& m9 b1 }另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ I4 f  ^* U1 S1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 b$ d* N5 |2 E$ W2 Y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( f  f3 {" a0 O" Q3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- W4 h  _" k. ]8 w; d! i' Obegin P_induction arriving, ~6 V, ]6 C' ?
    clone 1 load to P_pick(A_induct)
- e6 N$ X, r$ z+ uend最大的系
2 F* R2 ]) P. h. T1 k' u
1 ~8 S# p8 \- c4 E) gbegin P_pick arriving& T6 p9 I% J8 ~% m$ V( q- K
    set A_i to procindex * 10 + 1: y' g+ \0 e1 W8 Y: E! ^% ^3 H3 s" ^9 @
    move into Q_induct(procindex), S& o1 I8 V/ S
    move into pickaisle.induct(procindex)0 o7 q- x0 S! [9 o  e
    /*check the type of pickaisle.induct(i), for your last problem.*/# A/ J5 B$ Q* R) d- Q
! F3 a) n2 |9 i& c$ D- t
    while A_i<=30 do begin
) q' T$ F* Q5 r+ x: I" f9 \        travel to pickaisle.con(A_i)
1 |* y+ m, v3 L. u9 W6 p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" S9 ^! X. ^; a* E+ a% O
        else wait for 10 sec, }8 m  m7 p$ f3 O* ]- m) M, J
        if A_i=A_leave then send to die+ {  C! U+ T# x% p( A
        else inc A_i by 1
8 l; @2 ^; a* H& n    end& V, Q/ ^2 c% e7 D$ E
end. {1 j' k3 \/ Y; p( t

1 `  h+ I5 u$ U- A& O其中的procindex为整形,代表当前process的序号。  u0 Y$ F5 O+ Z* x% p
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, 2026-4-13 14:17 , Processed in 0.018501 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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