设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13683|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, G7 f- s/ w4 N  x4 E! h: \/ ^
3 ^4 T7 z- c' p7 ^; h2 V1 S5 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中的数值,不知道会不会有什么不妥。
( O+ t* ], P: i/ o" d
: q' Z5 q) y# abegin P_read arriving
2 [3 n5 j- p1 F1 }% S% g    while 1=1 do begin2 j0 G  O/ C' ?+ \9 w: z
        read A_tote from "data.txt" with delimiter "\n"" o# G3 }, m  t* g% l4 r
        read A_time from "data.txt" with delimiter "\n"% M4 T  @. a5 _4 r. f
        read A_leave from "data.txt" with delimiter "\n"0 T  I4 S1 m9 X, n; N% i
        read A_picks from "data.txt" with delimiter "\n"8 Q* k: V$ v4 ^
        set load type to A_tote
, X2 C! N. \1 K2 \+ X0 p        if A_tote="tote 1" then set A_induct to 1
8 P# A6 n' ]" ]$ ?/ N0 C8 G        else if A_tote="tote 2" then set A_induct to 2
/ Z" f3 j& b% f+ {  j: Q( W' {            else set A_induct to 3   
( B% e8 _, i: s        set A_i to 0
1 r) _9 V& D& B7 v/ t  b        clone 1 load to P_induction( r0 c4 E$ h1 Z7 T9 ^; w" B
        wait for A_time sec! b9 B! k4 I5 ]& Q+ t& p/ J
    end6 `" e, g& g9 ?, Z
end9 J( e7 j$ \5 p" L7 U
' F2 N8 B3 r6 X: A) t
begin P_induction arriving
8 s. j6 u: a1 t( \    if A_induct=1 then clone 1 load to P_pick1
# u% t% }. F, a' p- v4 M& i    else if A_induct=2 then clone 1 load to P_pick2
3 H7 U8 a7 e' m, E0 ]        else clone 1 load to P_pick3* h) p) |- K1 {; {4 z3 C
end
' L, R; o) [2 G, f# \
: L$ u% l* J' o8 n* Obegin P_pick1 arriving
8 B% T. B. B( i( e6 {( v: S    set A_i to 1
# H# H/ P, b# y, E' f    move into Q_induct1
' i$ c/ W2 u1 O7 a' h    move into pickaisle.induct1
3 i: k1 w. s$ D+ W' N) f    while A_i<=30 do begin
. Z- ^" Z: a: O/ _3 a/ U9 a* h        travel to pickaisle.con(A_i)
$ g3 Z" I/ U# p( F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ [/ N2 F+ M, C- x- N5 n$ v
        else wait for 10 sec
$ U( l4 _; a) y$ p        if A_i=A_leave then send to die  f$ \( p1 ?( D" U1 y
        else inc A_i by 1
9 P5 m; T8 ]! M/ m# A    end# H$ B# r2 r4 m" O7 X/ p5 Q8 u
end
2 }$ H; ]3 ^+ ]( W" e% Z
( T( I; T% Y8 X( V2 l2 ?# |begin P_pick2 arriving
* |  w2 ^4 ?' N' H: Q    set A_i to 11
- |# j0 A, @, _9 {6 r; c    move into Q_induct2
% |" ^/ h( d6 M    move into pickaisle.induct28 \- W# o2 x, h
    while A_i<=30 do begin
$ Y" C6 D4 y. X5 a  p        travel to pickaisle.con(A_i)$ i9 @3 k6 K4 A* a3 w+ Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: Q" A# Q# [  k/ p; Z
        else wait for 10 sec+ J; h4 D) x9 J
        if A_i=A_leave then send to die
2 j2 y+ T' T* s! N' I# U        else inc A_i by 1, w% A& C/ o9 \! Q9 R9 K
    end
: q  f" [5 ?% e% F2 |2 xend# \) J# A( X0 R: _3 F8 d
4 O- Y0 c/ y2 t# x+ }
begin P_pick3 arriving
. D( _9 l4 n* N) E3 O4 ]    set A_i to 21- v% s# {. d+ G& a: x
    move into Q_induct3
2 B4 t" A, J0 I6 Q' x% A    move into pickaisle.induct33 S% O# X  R; J
    while A_i<=30 do begin1 F8 `" f3 J. z
        travel to pickaisle.con(A_i)2 q7 e" L1 g4 j8 i2 F1 o; k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ e) p+ A0 e" i6 P. r
        else wait for 10 sec6 o# }/ M" \7 J8 @
        if A_i=A_leave then send to die8 ^% r3 m. C5 Q' h# M: ]) K
        else inc A_i by 1
' F2 [) V& y8 o7 V3 h. t    end% w4 u/ A3 h, b) l5 l, f  u
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是个什么东东?* \1 L1 E, T& g" W6 X  I1 }& o
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, Q4 y6 n7 L& k% {2 H

' w+ M# p9 J  YAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) o: X3 U7 a3 l" `3 p. f& P3 ~# R8 j  U; T% i# A& T: W
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: C. O1 o# \7 K5 Y% Z1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 c  z! S; M/ h) L1 G' B2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ O3 }4 m% O# ?3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 Y* H4 h1 h/ @) d4 s! c; k! u: F9 E
begin P_induction arriving& E: b% Y- O: F! Y' `1 C  z) g
    clone 1 load to P_pick(A_induct)
( I! m8 Y- x+ c' p6 Rend最大的系" u9 p9 Y* |" `1 R& D
* k8 A" E; g5 |" p
begin P_pick arriving
# x3 G* ]  X: |8 X" h$ u! ]    set A_i to procindex * 10 + 1: e( F% |1 B' j) V- j
    move into Q_induct(procindex)% A, x+ E: \9 m9 {' O- J% J" j
    move into pickaisle.induct(procindex)' f3 ]3 n- {' s2 b2 n9 P1 Y
    /*check the type of pickaisle.induct(i), for your last problem.*/
9 f# _/ n* Y) ?5 N: ^& J0 ^+ V5 n3 I$ O+ b; D
    while A_i<=30 do begin
. {- O) Z' {8 V% x  c8 `        travel to pickaisle.con(A_i)
9 e4 ?6 V% U/ o& `- R# k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' C8 o7 c( w) A( B% M# l; W- m6 i
        else wait for 10 sec
" e% x7 v2 T: C9 U; e5 B        if A_i=A_leave then send to die
$ g& w+ \. ^" M4 x* Q6 W/ s4 y* o        else inc A_i by 1
" S2 p$ e9 J3 C. ?    end
/ ^# h# A4 ^! O8 w1 {end
, ?* @$ ~5 ^. V7 X5 }: E+ Y5 `2 }7 O2 n: W
其中的procindex为整形,代表当前process的序号。3 m6 w+ B. z7 |. \, j6 t6 Y, K
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-28 16:39 , Processed in 0.015290 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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