设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15275|回复: 2

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

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

* j" O) [1 U- X9 u; ]* Q$ {" B8 i我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ n% Y, Q* j# o. y3 {2 v

5 V, k( n: Q' A4 n2 mbegin P_read arriving8 @0 y" a' b; z& z, b! B9 ^
    while 1=1 do begin! r5 A+ \  q0 c: U5 Z: Q
        read A_tote from "data.txt" with delimiter "\n"
4 y, U# J4 R" {        read A_time from "data.txt" with delimiter "\n"
+ m$ D+ {/ V- q" a+ R( d        read A_leave from "data.txt" with delimiter "\n"
9 U4 z- _! u9 e$ H6 D        read A_picks from "data.txt" with delimiter "\n"
9 r" W& y9 w0 z" f; Q% b        set load type to A_tote; \# s* U/ N; E2 T8 {  ?9 `
        if A_tote="tote 1" then set A_induct to 1
" r! Y$ r; A7 S  b) ^        else if A_tote="tote 2" then set A_induct to 2+ V+ w$ T: T& E0 O
            else set A_induct to 3    0 }1 n' i8 w& s( i
        set A_i to 00 X) j) J# M0 P& [- q/ k8 Z( k
        clone 1 load to P_induction
: H, |% w& m+ \9 T  r* R( [        wait for A_time sec
; i" f% i- k2 {, f; A- P9 f# M    end  {7 R3 v! A+ B
end
  Q6 H1 G: B3 Q' ^( u( R
# |3 g: V9 Q8 U, |" q' l5 Dbegin P_induction arriving6 ^) p$ b; a! e5 V0 \2 [
    if A_induct=1 then clone 1 load to P_pick1
: ^5 q! i3 _+ T- B    else if A_induct=2 then clone 1 load to P_pick26 s) \; X7 S5 L6 W
        else clone 1 load to P_pick3
4 g9 R$ u% b4 e9 m8 i$ N9 oend9 O+ e7 Y! r/ I! r& P/ X
# ]6 F% i# O$ g' y- J9 }
begin P_pick1 arriving
0 |. u5 m; @% d    set A_i to 1" ]  ?* E2 i2 w1 X
    move into Q_induct1
9 _5 \2 \; C4 y9 q    move into pickaisle.induct1
9 H$ |9 l  Z% x; Q# L1 F    while A_i<=30 do begin1 M4 T0 I$ M/ j0 s. L
        travel to pickaisle.con(A_i)
7 h6 P& x3 E* p0 @" U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ }' L. q! k1 [/ S0 ]        else wait for 10 sec
) v& a6 S3 q, r3 K% [, k        if A_i=A_leave then send to die* r3 }! O" r( s# j! Z
        else inc A_i by 1
3 `' r) O. b3 t0 J. O1 a% E    end
- G' d: n" v+ P0 t& x. send
9 H: c# |' q% F* ^& {3 L; Q- b# K& A" q# Q% ?* S& N
begin P_pick2 arriving3 e# T$ e6 k$ }2 W
    set A_i to 11
* P8 ], i5 ~6 b! \0 A6 d    move into Q_induct2' H- }" T8 @( a# u, v5 `' E
    move into pickaisle.induct2. m3 s$ E1 A  H6 f$ b* p* f+ s# z" m
    while A_i<=30 do begin9 w8 F- Y) p4 b; h
        travel to pickaisle.con(A_i)
8 o9 |2 [5 m$ n8 c8 b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 W6 [7 }$ k0 u5 ~: e; `+ G        else wait for 10 sec! ], J7 q8 O$ e' X3 N+ n/ L; q
        if A_i=A_leave then send to die
! X  S6 y; P3 d# h        else inc A_i by 1
/ n6 q. J6 {5 e" P1 i    end
: `4 u/ O/ _7 H5 }+ `end
$ E) Y" {2 V1 w0 t* a9 b0 L# O2 ~2 Y3 |( w4 I& q
begin P_pick3 arriving! r' ]; O$ L0 o' G& ]9 W- N, M
    set A_i to 21
# R& T5 v, w/ x1 a    move into Q_induct3+ G- ~" ^; d' P
    move into pickaisle.induct3
& T% f/ u' k* D    while A_i<=30 do begin. u0 l4 w$ N& M) j: v- W
        travel to pickaisle.con(A_i)2 E# d' w  O+ Q2 [# T& P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 v* |7 ~3 X( p% \& T; N9 r
        else wait for 10 sec
) G  F* M8 I" ^/ d7 a9 T0 q  M: l        if A_i=A_leave then send to die0 f- ?! R% j% M" m+ z
        else inc A_i by 1
+ V% z! T7 W2 W5 j4 V; i9 ]    end+ E# C( O) M. k8 A
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 ?7 t7 ]: B3 h7 I! I, _, s. j+ Umove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ }. P8 e: @6 t8 ?9 U7 j" u

) M: `& N( W! Z6 L& @AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) V. d  }4 ?2 E' t7 l. T  m* u  x  C9 x8 r! U4 g! [  b  l
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:3 O# C! P8 K% b7 h
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. P% T0 Y" E* m- d1 j5 ]* g# Y& l
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, ]2 J6 P& V5 k+ @! m3 A
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& j6 q9 p7 Z9 B/ m5 O" h9 dbegin P_induction arriving
/ w& M: C4 f$ w4 v$ n    clone 1 load to P_pick(A_induct)
! X, W" a, q7 D0 e6 Aend最大的系
% {) b1 U) y' ~2 Y8 ~2 z2 q5 D1 y
+ ]8 E0 V2 T5 N, ~. a3 ebegin P_pick arriving
% J; @& k! S( a: s) X& @9 R    set A_i to procindex * 10 + 1
3 p2 i' U& _( u3 B    move into Q_induct(procindex)
: @4 x6 p1 {3 l: ]' D+ I) o/ h    move into pickaisle.induct(procindex)
9 C2 S% a0 y3 g1 q, f    /*check the type of pickaisle.induct(i), for your last problem.*/
. D* J$ @5 H1 r! r7 e6 @- ?0 t, F
    while A_i<=30 do begin
7 @1 v- T0 O' Q7 z        travel to pickaisle.con(A_i)1 E' o4 P8 k2 f! I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ G' x* T3 n$ m# {1 Q
        else wait for 10 sec( y4 h, N, j3 v. h8 h% _) y
        if A_i=A_leave then send to die
  y- T) }* C8 c& C! l        else inc A_i by 1
8 f. s! _7 p0 {* k    end7 g$ l" ^2 I, Q) ?
end+ ]: m. x( G! Q9 Y- I
1 ]' L0 O4 R7 o9 K* J$ ?
其中的procindex为整形,代表当前process的序号。
3 Z8 w" y2 a5 q0 P- {. i& istation和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-8-29 13:12 , Processed in 0.014926 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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