设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11857|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, W0 K# H$ p$ m6 j5 [$ A) P
! i% k  J8 A8 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中的数值,不知道会不会有什么不妥。
6 Y* T( j: H6 I0 h3 Q5 y! B2 D1 s+ N# h
begin P_read arriving# c: j% L$ J1 u- M3 d
    while 1=1 do begin( c5 C8 u& A3 {0 V0 G$ U
        read A_tote from "data.txt" with delimiter "\n"
" k3 k# {* {3 L6 g        read A_time from "data.txt" with delimiter "\n"4 D+ O" Q. v8 L# A5 ]) l
        read A_leave from "data.txt" with delimiter "\n"' H( F" {) ~8 F1 W+ n0 b  u* S
        read A_picks from "data.txt" with delimiter "\n"/ t3 L2 ~7 p9 f) |% w
        set load type to A_tote
. g  f) b% U! Q, x; ?: O: L$ k        if A_tote="tote 1" then set A_induct to 1
7 D9 F7 P1 U2 G        else if A_tote="tote 2" then set A_induct to 2
- `7 ?5 e' P! O. F9 ^            else set A_induct to 3    7 I) h6 H6 G8 U) Y
        set A_i to 03 G" ]2 }) ?$ w& k4 S3 ^/ N2 p4 @
        clone 1 load to P_induction
3 E5 F( L4 P" Q        wait for A_time sec; R) R2 [& s) u6 g& x
    end; [7 q+ J5 W3 i# p; p
end5 W6 o) D9 Q0 j0 k4 }+ p7 Q
) j! Z$ @: S! Y
begin P_induction arriving
: L9 R1 r! _! m: f. g    if A_induct=1 then clone 1 load to P_pick1
. _3 B) q; G. R$ D1 B0 P+ e    else if A_induct=2 then clone 1 load to P_pick23 x1 q% j& A/ h; b$ j- |0 b0 J
        else clone 1 load to P_pick3) V7 L: y- U8 B: J$ K! g; q
end2 F1 W+ x! n: H
8 C' d( n4 z' i: E) g
begin P_pick1 arriving! r" A/ R" z7 V2 Y" A! ^- d
    set A_i to 1
( p# X& a( C3 @, z% {& k. I$ @    move into Q_induct1  N2 r7 n0 A  [+ `1 ]( f8 t) D
    move into pickaisle.induct14 x6 A$ \# U! R( t. t( Z
    while A_i<=30 do begin
. a, @' i6 D6 M7 `; V        travel to pickaisle.con(A_i)
9 ~9 a& J! |5 h6 z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& p: T* d; c/ d
        else wait for 10 sec: d5 y( }1 ?9 i! o
        if A_i=A_leave then send to die
6 E2 C, o& O9 x* R& N, l6 O        else inc A_i by 1
- o" U# l- e* t1 _( g5 p8 e* d    end
: M$ n( @4 s8 H  z+ ]# z5 \end
5 t* w& O; n( T+ @- ?4 d
0 |- `) E) P3 ]& w6 Ybegin P_pick2 arriving
# }( o, e: ]% {- X    set A_i to 119 T: E& K$ P: w  H
    move into Q_induct29 v  H0 Z+ {" o+ y# Q* Z9 N' ^! C
    move into pickaisle.induct2
+ R" E  ^. L4 _. {    while A_i<=30 do begin! W. L, C6 f* V& Q# }2 E
        travel to pickaisle.con(A_i)5 J/ `1 }) j0 s1 G- v8 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 h4 i% G& N/ S. X/ Y) R2 m
        else wait for 10 sec
. ]3 [" e% m& |+ Y  I! G        if A_i=A_leave then send to die
9 k: L: ~! e" c8 V1 }        else inc A_i by 1
( L! F" x8 s, F4 |5 E+ ?    end1 V5 f' [; ~$ H" F8 _( [
end# A8 N5 p5 ?& f' t' g
- T# X0 ?1 q% X1 Q% g# [3 F, V
begin P_pick3 arriving
. {. F6 ]' c  @2 ~8 ^  ~6 F    set A_i to 21+ k8 b2 A4 A2 K
    move into Q_induct3
5 N; T/ x! G' r. m1 ^    move into pickaisle.induct3
6 J" i# ?4 E9 ]" J. `    while A_i<=30 do begin, E) t" m% q7 V/ Q3 H
        travel to pickaisle.con(A_i): k- b- o; k, @; c0 u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 C1 }7 D2 G1 p' b        else wait for 10 sec
$ Z) l1 {% O) W5 ^$ u% S        if A_i=A_leave then send to die
0 P4 Y3 p+ b* d, _        else inc A_i by 1% m. w+ u5 T/ O: ~+ b8 f" O
    end4 M2 L* _4 H" x; b
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是个什么东东?
& C! b2 j7 U/ mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& V5 _% h( S$ Y# |6 n1 I" N
3 C  I7 L7 u) T. @+ V* D1 t& S" ~AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。  B: `3 O9 F6 f. V& w! ~0 z+ C

# r2 [8 ?' r# K另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* L7 b: P- A1 @* W! f1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ a9 x" {* c: o& |. _
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) I" ]" t) T9 M: Q
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* S$ ~0 r6 ~7 ~. z7 abegin P_induction arriving% x% q% r+ E/ J. _* z
    clone 1 load to P_pick(A_induct)
1 K( E4 a" h3 M8 e( h, g7 hend最大的系
( Y$ E$ a2 |5 X' q; `# w  {
8 b7 J, a3 t  I8 @6 U! {/ mbegin P_pick arriving  e  g, a. N- ]+ J* B4 x, p8 J
    set A_i to procindex * 10 + 1) H2 u+ m  n( Q$ f2 [2 h! Q2 _! |4 X4 L
    move into Q_induct(procindex), c: o1 p2 \0 s; O4 z; V
    move into pickaisle.induct(procindex)
3 Y: r7 S7 e, z$ O) c) v# ]+ v    /*check the type of pickaisle.induct(i), for your last problem.*/6 L& U6 e/ w5 B8 F3 k

9 k+ M4 Q% b$ d1 [: z7 e    while A_i<=30 do begin5 j5 g" h5 y- R6 [, y
        travel to pickaisle.con(A_i)7 q2 m4 x, G3 W: X* ~" g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' _! s3 R4 l) O; U5 x        else wait for 10 sec" B7 J, s: w: V/ e: c
        if A_i=A_leave then send to die7 n) K$ X5 |! U' V& j" W
        else inc A_i by 1
+ u5 d9 c4 ]) P, c' j+ A8 {4 F0 v* l    end
  L4 W, q* M! Gend
3 f  g% z  _+ ~" E# o! b1 S8 y! j! P/ I9 _* y
其中的procindex为整形,代表当前process的序号。: O( E& C5 \1 R
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-12-11 00:56 , Processed in 0.022219 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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