设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13832|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% [: w% Z& z  w6 [3 M8 h/ c" I
  ~3 g0 W2 q( ]6 ~/ ~我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 q% C7 u2 X2 U. N! O2 F) M

* }4 u6 w0 N4 r7 {begin P_read arriving! E4 Z6 l5 v1 n7 q1 h+ b# x! b
    while 1=1 do begin
3 Q8 Y4 L  `9 E  ~/ y, [        read A_tote from "data.txt" with delimiter "\n"- P+ A4 x  q. N+ Y3 ~
        read A_time from "data.txt" with delimiter "\n"+ z0 ?5 C+ V: k( o
        read A_leave from "data.txt" with delimiter "\n"+ n  ?3 I' i; ~
        read A_picks from "data.txt" with delimiter "\n"
' l* x. M5 r) t" v1 G        set load type to A_tote
# i# v+ l, ?2 M; M: K* A; `7 y        if A_tote="tote 1" then set A_induct to 1
5 Z6 z& f, ]7 F: F. B        else if A_tote="tote 2" then set A_induct to 2
( P6 d' r' F/ c0 w4 H5 J7 e            else set A_induct to 3    / C3 b& U: \7 c9 V4 Y  F! U0 v- G' \
        set A_i to 09 q  [; ^$ g. b! J
        clone 1 load to P_induction" S5 `; N* [- ^3 t1 {7 n; \0 t  {6 ]
        wait for A_time sec! U9 l0 g* e5 Z; R
    end
4 s- J; r: r1 l) m" L  {end
# I5 o# Z% ~+ o- r7 D& T5 V
2 A8 W  S; h3 j% p0 y3 q! Tbegin P_induction arriving
# U5 l; \: X* J, _2 T    if A_induct=1 then clone 1 load to P_pick1
" H! p5 x% Z4 e- e, j3 C    else if A_induct=2 then clone 1 load to P_pick2
" x  N3 v* S8 x: `: b- h        else clone 1 load to P_pick3
* p- ~; L7 I4 Nend$ }! _8 N9 m! V) H
: U- O! I4 a( I5 _9 }' ?0 J  w
begin P_pick1 arriving
& v$ v. f5 q2 I; p3 b    set A_i to 1
) B7 l+ U/ t! s5 q' a    move into Q_induct1
# r$ z4 ~5 ~( q    move into pickaisle.induct13 j+ Q4 y$ s9 P- D+ J
    while A_i<=30 do begin
2 F/ K* F* S/ R: b6 v# R9 m4 X% Y        travel to pickaisle.con(A_i)% k; E# e; ]) u( w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ h0 m6 A. }9 j
        else wait for 10 sec
3 J% S# g& g- U: S        if A_i=A_leave then send to die
. |! H6 v. O- w" E/ a        else inc A_i by 1
' s. x: ^4 ?) G. w" ]& O2 g1 j! K    end" u9 }9 t1 M8 F3 Q  w( ]  j
end0 o" {) A* Z+ f
) ~3 p: g5 {8 R; ^' P! Z$ H
begin P_pick2 arriving
3 d8 T) ^# h* R, }    set A_i to 11; v" S: |9 R: i: z
    move into Q_induct2
# W0 @5 H! l) R    move into pickaisle.induct2
, D  g: G3 ?( o' l    while A_i<=30 do begin
! b3 X: s$ l6 D        travel to pickaisle.con(A_i)9 ], U2 a6 u& Z% Z& V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, j. U9 M5 \8 |2 [/ J. Q0 t* t        else wait for 10 sec5 F3 q: h2 `9 [1 o( N
        if A_i=A_leave then send to die$ ]( X- y) v% H: C; W* P* s" J+ V! C
        else inc A_i by 1) [5 `# ^; ]* W% V+ i
    end
# C( v/ I1 ?  `) Y! ?1 B: {) C* qend
  j; l* u# d+ U! u
/ B  k8 _5 n  U& M" z1 ebegin P_pick3 arriving+ r: c) l2 K6 ^4 U6 [0 n! X
    set A_i to 21
% l4 ~8 \  x; C& s2 y8 `# ?    move into Q_induct3
5 a" Y" a7 _/ \    move into pickaisle.induct3
# E8 s; i- n; d) v9 q( v+ Y    while A_i<=30 do begin' S0 ~- U+ w, O7 [, e- r, L8 U0 k
        travel to pickaisle.con(A_i)
6 f' J6 [) i( E5 W0 t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 |: r" J1 l* G/ ^8 U
        else wait for 10 sec
  f. y/ \( U% j9 ]0 {        if A_i=A_leave then send to die
6 c+ n4 P& b; _        else inc A_i by 1
. M9 _% h) r) ?7 K/ C% O5 u/ e* ?    end" Q3 L9 G' `' Y4 w# C
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是个什么东东?% O. R7 f8 p" i. j! l! S8 r
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% }8 i. S6 e% e9 Z7 V" d
" i: O' }2 f2 d3 U) h7 \AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% k- y2 W$ Z9 ~( y  P. T5 Y% `2 F# d7 e( M
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ J# V* K( v+ S  d* i4 X
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ A9 P4 w8 J1 h1 x! F2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& G/ b. ?+ A; @( f6 J3 X3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( }' {) z% y. ~% H, Sbegin P_induction arriving7 X) }. V1 m5 |( ^3 q
    clone 1 load to P_pick(A_induct)" ?* k. b  y7 x# H5 d) r6 k& c. }( S
end最大的系$ w  U( w. Y& g7 y

% v' ]  p5 n0 [! {begin P_pick arriving
& n! v0 A$ y$ t* ~7 d    set A_i to procindex * 10 + 1) E* t% X. x' Q
    move into Q_induct(procindex)
% [5 g+ t8 u- }/ W( N# Q3 Y    move into pickaisle.induct(procindex)
# F& v7 `: P0 [( ]* v2 I1 _) m5 G    /*check the type of pickaisle.induct(i), for your last problem.*/
( s; T& q' u3 w3 k& D- k4 I5 s' T' b4 @3 x1 H/ \- p+ l+ b0 E
    while A_i<=30 do begin0 x4 U1 Q, X3 _: F# c1 E1 R, L* n
        travel to pickaisle.con(A_i)
( O5 Z- k" y3 o8 `+ C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; d4 Q. m( _0 C( ]
        else wait for 10 sec' J) |2 V  \" E$ B% n" w8 m
        if A_i=A_leave then send to die
0 `& d& }% o" Z1 o        else inc A_i by 1
9 a- r& O7 j' ?( J. N, g; h. j3 N    end/ Q; b* |7 q" z: u
end. A" s* l, T3 o0 \. m

% K+ \( o2 ]2 T. ^5 w. ?其中的procindex为整形,代表当前process的序号。& e4 k  g. t# w6 |, x4 h  B/ ]
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-5-10 04:56 , Processed in 0.025480 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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