设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13589|回复: 2

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

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

2 Q# S/ H+ O) j我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' r* G1 c- P; t/ q9 D) }& ^, n! S, v3 K4 K
begin P_read arriving
* K5 x! P1 E# c    while 1=1 do begin
/ u, d4 q$ G* i0 x        read A_tote from "data.txt" with delimiter "\n"
% O% x( }; W2 o5 @( |        read A_time from "data.txt" with delimiter "\n"+ a: O) ~. C# X- A
        read A_leave from "data.txt" with delimiter "\n"# t, c& e) r, m" @
        read A_picks from "data.txt" with delimiter "\n"
! _' b6 ~2 H3 B        set load type to A_tote
/ q6 {' N0 q% ~6 I        if A_tote="tote 1" then set A_induct to 1
- T# O8 ?# ^2 t* [. h  J: S; H        else if A_tote="tote 2" then set A_induct to 2
: n2 U( B$ q5 D( I$ A$ {$ C            else set A_induct to 3    2 o& e( o- U/ A% z3 X4 B+ c- c
        set A_i to 0% l4 \( L/ P: f$ F( k/ A
        clone 1 load to P_induction
- J7 j" O# ^: H8 K        wait for A_time sec
) ?% \& M7 C: v: n: K    end7 f& l- s. g$ j
end9 c4 {% P7 |1 E5 ?+ a

3 p* `9 ^: r# P* u0 G/ |begin P_induction arriving
  t5 j8 O9 L+ t    if A_induct=1 then clone 1 load to P_pick1
+ a0 D" j: p/ V4 a& j+ L! u8 [# I    else if A_induct=2 then clone 1 load to P_pick2+ ^% b1 G$ d% c
        else clone 1 load to P_pick3
. t$ I- v# q6 Fend5 q9 H5 l8 j5 Z/ Y; q2 P" k- _
& T5 M/ Q/ x8 U% _5 ^) ~: j. }! U
begin P_pick1 arriving
2 K. c$ m% h3 Q    set A_i to 1
: R5 A% }8 v4 P: p5 u, J% U7 n    move into Q_induct1
9 n# K/ z0 Z* f, R    move into pickaisle.induct1
! L9 Y9 d& |0 s1 x# b+ B2 W) q    while A_i<=30 do begin
: l! @. Y0 p. d" h2 x        travel to pickaisle.con(A_i)
, I& s6 c6 T+ M, y% f( d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 H$ p( A! X( s0 z1 [
        else wait for 10 sec4 Y. x! v. R% f2 L
        if A_i=A_leave then send to die
, W5 Q3 W: Q" D* H  V        else inc A_i by 1
8 r) S3 `- C4 P$ [3 A) `8 O5 z    end
, _& ?4 Z8 ]) lend( ]4 Q5 V4 I, t5 s5 O# I

% u% T# `" M9 o' h2 G; Z! sbegin P_pick2 arriving  Q. j5 k" w! \0 E) B  ]
    set A_i to 11
  s# U# k* a+ H8 ?- T9 z- V. h    move into Q_induct2
: U3 f7 c& k, h7 a. v0 S4 X    move into pickaisle.induct2
# |/ a' d- D: L# Q# J! p    while A_i<=30 do begin0 U3 D7 U% W0 l/ C5 b& a" K2 W
        travel to pickaisle.con(A_i)
/ g; j, ?- ]( t, r8 `4 x( P5 Z/ S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ `6 }  ~) g, n. y' w
        else wait for 10 sec
2 D& ^" D+ g. b- Z        if A_i=A_leave then send to die! n* v! \, _7 `( ~
        else inc A_i by 1
- [; q8 @1 A" J    end" H- K' O  @. _8 D) r; y
end
9 Z+ I. S* e" n; W6 r- C/ u8 [) u' ]. U
begin P_pick3 arriving
, X: C% C- D) F- f- \4 _+ [    set A_i to 21
: Z5 t3 o" z8 Q. ?: R; v& S    move into Q_induct3: |" s" s1 L3 W9 }" \' w
    move into pickaisle.induct3! G% B$ N( k+ n( O% z" o
    while A_i<=30 do begin0 x2 S* Y1 S1 T5 w* Z- i& V; X
        travel to pickaisle.con(A_i)
/ t' f+ S4 G/ m% `/ u# b/ Y0 H$ ?% A1 S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" M- b. q. b$ {% i7 @' k        else wait for 10 sec
2 v+ G, [9 l% _9 T2 X6 K6 m        if A_i=A_leave then send to die
" e& q/ H, S! O. q        else inc A_i by 1
3 x( N$ ?3 P$ ]: G. U  i$ Y1 K+ U; p    end
% k" H2 S' I% A" B! s5 [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 h7 F9 ~/ h# `+ Q9 \+ Lmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& `: D& V8 @! G" m( l% i  e6 Y4 H1 k1 {/ g* T( D
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- Z- h) d* |0 _( I7 N$ k) }/ U* ]" d% q, U. N" E
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" J: ~8 F2 Z; K& I1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  N" N% Y7 u8 b$ O  r" \# m2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 ~+ l6 F) ]( n3 @8 w$ n4 m% @3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 z# ], R" U! }+ L# L2 D0 q7 e
begin P_induction arriving. P- J# L1 a8 ?; H/ r! T
    clone 1 load to P_pick(A_induct)
; Y$ x6 i1 }, c0 m- o1 d, Send最大的系
& r+ S7 k, P: \/ e/ \9 j9 z
7 u8 [) ^; U& X5 X* H0 gbegin P_pick arriving
1 E$ [% W6 n3 D; w3 [+ X/ W+ G* S    set A_i to procindex * 10 + 1
4 C. w& s  H& l! j! K! h+ @% b    move into Q_induct(procindex)" x3 |  k  r3 S2 x4 J4 |6 l: T% p
    move into pickaisle.induct(procindex)
% B9 H( Z6 {0 m* s& B5 I    /*check the type of pickaisle.induct(i), for your last problem.*/
: x, X- F# {  d6 i/ t# c
. R+ g2 y' [8 D% q8 ?0 F! F    while A_i<=30 do begin) ]0 }, k% X% }. |
        travel to pickaisle.con(A_i)% z7 Y$ C3 {0 H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: X' l+ {- M& b( v7 T
        else wait for 10 sec- A0 T# n. M0 w4 d1 h% `
        if A_i=A_leave then send to die( |- ~! g5 j3 w% w  R0 f
        else inc A_i by 12 m0 V) v. U7 T- w
    end* ]) l& n8 O( z( }! L( s
end
6 V3 F: M! f" b* i- [) T1 o+ z5 i! h" F  c, K- z  m* r* j
其中的procindex为整形,代表当前process的序号。7 H' t. F4 ~/ K) x) ^6 @
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-23 06:36 , Processed in 0.030771 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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