设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14060|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 s  ?- F, T' v- K& W% F' i- ~5 f; O6 @; D, e2 [
我的问题是,在每个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中的数值,不知道会不会有什么不妥。# m, }; I/ s8 F& G6 \7 l; D
* r/ {0 c: u6 {/ m. s1 Y$ M
begin P_read arriving
2 o  s: W0 m$ b- \2 L    while 1=1 do begin
% K2 Z- o1 S" W9 {2 i: s        read A_tote from "data.txt" with delimiter "\n"; s! `# [& D: O
        read A_time from "data.txt" with delimiter "\n"6 u8 A% L. N+ B
        read A_leave from "data.txt" with delimiter "\n"+ C, U2 g5 `0 S# M; H& F' [
        read A_picks from "data.txt" with delimiter "\n". u# j+ _" C9 }* b! v
        set load type to A_tote
5 J/ U" @4 W7 H1 {        if A_tote="tote 1" then set A_induct to 1& Y2 e* Y5 V0 D2 P- d* i! \" E$ C
        else if A_tote="tote 2" then set A_induct to 2. ~/ G/ V" g( Q) \/ p
            else set A_induct to 3   
, t/ k5 L; s1 v% n+ b- c  x        set A_i to 09 A0 R, d6 N; T
        clone 1 load to P_induction) v& a$ V# ~5 f( }% T. g
        wait for A_time sec6 k0 S/ S, d) b, @( c8 ^: M. k2 C
    end" w4 k4 q$ N* L  x  a: L5 b, \" v
end2 [9 h; N- e9 d$ H' q, J  R

% D* o1 x- N8 \; j; Y% Bbegin P_induction arriving
7 w& G0 s) G% v0 E. q- u    if A_induct=1 then clone 1 load to P_pick1
( ~6 u6 z2 B. z5 t$ U, e8 Y2 j" H. Z    else if A_induct=2 then clone 1 load to P_pick2
& r8 e* Q3 c; t1 a5 y) x  o        else clone 1 load to P_pick3
, g2 w- }  }+ ~9 o5 X& i5 E: eend" v# v- W1 k. z2 E

9 f' C5 d( d8 {6 b) Dbegin P_pick1 arriving0 t+ i; _9 L6 ^6 l- y0 _
    set A_i to 1+ p( d. R- G9 j. C% L8 W
    move into Q_induct1
  G7 D( x) ?5 \1 y    move into pickaisle.induct1
) g+ \3 H6 P* L7 f    while A_i<=30 do begin
4 M% c- H' U; Y, E6 Z# E        travel to pickaisle.con(A_i)
/ X; `5 u& i  _: a* E7 I# p4 A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( d: J! B4 h6 ~) C  y2 z' y2 H
        else wait for 10 sec/ s! D; e4 g- S
        if A_i=A_leave then send to die
  @6 X! E; S( j. Q* l1 m        else inc A_i by 1
# B$ w( f  m3 x$ v    end
$ a! f# w, {& A; m& Wend4 x3 w9 G0 i& L# U/ y' p: B, G

+ C( V6 }+ }: L1 kbegin P_pick2 arriving% [; i  Z; x; i+ ?
    set A_i to 11
' `% A" X9 J, \( {    move into Q_induct28 [! A  e: n& w7 I7 K# h+ g- X$ M
    move into pickaisle.induct2. t$ F5 S( Q" N) T7 l6 q' m
    while A_i<=30 do begin
( r* i" |' t. U9 P' E        travel to pickaisle.con(A_i)
8 W# D% Z1 x/ o$ \) d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, S6 a- Q4 F0 c6 ^. d        else wait for 10 sec
9 }; y2 ~" ]7 S! h1 y        if A_i=A_leave then send to die
7 @+ Y- P8 Z/ f2 \8 |# V        else inc A_i by 1; n  l; L6 b. `; g3 d
    end
( I+ j8 `2 z/ y6 R) send
' [1 z) d' t; J3 \' P( n- i) O& ]0 \
begin P_pick3 arriving
, W: T) l2 e! S1 q  {. ]. U    set A_i to 21
6 \: @2 h. u1 v' w# L7 R2 ?    move into Q_induct3
2 N2 y- h: e; t0 G    move into pickaisle.induct3. o& N( Y1 ?+ k/ M8 B
    while A_i<=30 do begin) k3 J7 T$ o6 o+ R. u, r5 v
        travel to pickaisle.con(A_i)) h% l3 E) c  h0 m, x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! W! U7 v$ x) r$ Q8 {
        else wait for 10 sec
  d; n) O) X6 U        if A_i=A_leave then send to die
8 F% Y/ ]0 m6 i) a8 {0 {# o        else inc A_i by 1. Z( N) N6 {% A0 r- y, b, f6 B
    end. Y# b: r& E7 ~- A0 t
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% O) g; \% u/ h
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) ^' U9 a' g7 x

: W9 N- Y: [; e5 Z1 \" mAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ ?; r  m6 L% w: }" c/ _
) \* N9 u  A2 a
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" B: U) V7 j! D) u
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 R* I7 X4 h! g) i
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. X" D% G- y; B* Q3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# f$ S* l5 L0 kbegin P_induction arriving
9 Y2 q, D6 ?4 e! ?9 Z- t/ \    clone 1 load to P_pick(A_induct)
/ _1 t) W% M$ b. Yend最大的系
3 _& P* {  A7 f+ S1 R, y8 Z' b3 n( ]0 w. G
begin P_pick arriving
0 y6 K2 _6 i4 L. Z) ~" B( P    set A_i to procindex * 10 + 10 a" {7 T9 v3 i5 B" G: }4 O
    move into Q_induct(procindex)
  \, g, }4 Y. K: L  l    move into pickaisle.induct(procindex)
( l& w0 z% V) I' t8 j! F4 U1 l0 Q    /*check the type of pickaisle.induct(i), for your last problem.*/" U8 H5 V6 G7 a2 j( r
% M0 O: P( o) v( N1 k& c
    while A_i<=30 do begin
5 w& I* l# R! }. [! C0 t        travel to pickaisle.con(A_i)+ Z4 f9 h1 j# n3 W( T5 m# m7 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( M& B; T. |& `6 n/ A! T
        else wait for 10 sec8 V) I  b' D; J1 Q0 l
        if A_i=A_leave then send to die" M  f9 M- z7 C/ L  j) K
        else inc A_i by 1
% n. K6 r5 Y/ ~6 y# ]; B& p    end' n7 q: [+ e" p) }  g: N6 L
end5 ~! b/ T: G, ]! z9 f/ t7 Z6 p: o, f
: I! V# H' }, s  {
其中的procindex为整形,代表当前process的序号。
& s$ h" O0 e1 j  A7 e7 s$ q) @  sstation和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-6-4 09:40 , Processed in 0.015349 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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