设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10577|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  B! `& w( h% l
: o7 s/ A& r; U5 N8 l, Q
我的问题是,在每个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/ d0 H* ]. {/ G- G. ], q1 s9 M4 y& m- Q3 o/ k' |
begin P_read arriving
) N. s' Q: B( O) ^2 J    while 1=1 do begin
3 ?3 S% t2 ]* y- ]- b; i' w        read A_tote from "data.txt" with delimiter "\n"
5 ^/ {9 F5 Q! ~# t& h" X        read A_time from "data.txt" with delimiter "\n"
! k$ Z' ^3 ~" ~) z        read A_leave from "data.txt" with delimiter "\n"5 q' A$ _0 o# d% L% r& v
        read A_picks from "data.txt" with delimiter "\n"
- d( R2 }, V- J        set load type to A_tote. b! @! g% V8 r9 `+ n, A
        if A_tote="tote 1" then set A_induct to 1
$ D9 Y& u+ |" F% P+ A' P+ |        else if A_tote="tote 2" then set A_induct to 21 p6 }5 r# }  B7 G. J$ \3 n
            else set A_induct to 3    & h/ A0 a% o$ _, ?$ ?
        set A_i to 0) [% o& h- I$ h$ W$ E0 B
        clone 1 load to P_induction
2 p- L5 Z4 h$ t* ?8 ^- f6 L: P; `        wait for A_time sec/ l  M# B, s  z6 [
    end
" M* d  V4 a/ j; h# |9 gend
' [/ i" ^% x2 N0 }0 T* v' I4 f+ }& Y5 G8 O5 N* f
begin P_induction arriving
" |* u: U- c/ r$ t    if A_induct=1 then clone 1 load to P_pick13 a' u  c' w; D" Z1 C, p
    else if A_induct=2 then clone 1 load to P_pick2: E3 K  v5 M* X0 N& W- p
        else clone 1 load to P_pick3+ i; u9 y3 o- A6 w+ P) T: F/ K* `+ ^
end; \0 }( Z* B1 `6 ?

% F8 b* u, @. Rbegin P_pick1 arriving: {3 G7 u( D$ L; r. e6 @  o0 R
    set A_i to 1. @5 d9 X! C1 r8 C) N/ ^% \5 u( e$ Z
    move into Q_induct1. ]! v3 ~& S7 c& T: b; l' \& b
    move into pickaisle.induct1
- A- A8 }, O1 t7 U- L    while A_i<=30 do begin# _8 e- L! t7 t+ v* N) @
        travel to pickaisle.con(A_i)6 h. k# P6 G2 ?+ [8 v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& }+ X/ u) E$ R6 q) ?3 ]
        else wait for 10 sec+ V, b+ I/ s; i0 I8 ~) l. @
        if A_i=A_leave then send to die5 Y. s, C' i) l  P
        else inc A_i by 1
1 p3 w/ L+ q: A    end
2 v9 q5 \1 j9 l# ^% Wend5 ?% M( K: y$ Z

- ]& f3 q$ J) T$ Fbegin P_pick2 arriving
6 C/ E7 F# l9 H    set A_i to 114 |/ d8 B* ?5 ]2 p* T3 |3 {( E
    move into Q_induct2
5 a' K( M* C' N  O" C. r. W    move into pickaisle.induct2! _' u7 V' C4 D
    while A_i<=30 do begin
& D! x& S/ U+ C, L        travel to pickaisle.con(A_i)
, |* }9 v5 h4 Z/ C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) P  x6 J0 p6 G9 D+ H  d        else wait for 10 sec
0 B. |: t2 b$ g" Y5 A5 h        if A_i=A_leave then send to die; ]) D/ t! H2 A* a% k
        else inc A_i by 1
/ d( C. m  F% E) I! M    end
& B9 Y: @3 q7 send7 }6 Z7 L9 x( d5 w) z

  }2 P, d: t$ c5 M7 F* E, F2 h& ?begin P_pick3 arriving
, N, G0 i) ~! [/ J    set A_i to 21
+ G, N2 p# |8 [2 f! N% `( R    move into Q_induct3
# K7 v2 s. R4 F" K    move into pickaisle.induct3  l, R6 w, `# D$ B5 C- |: I  t
    while A_i<=30 do begin0 M" {5 t1 o1 g) h! ^, A/ U; i
        travel to pickaisle.con(A_i)
& q  u1 U9 J, B" H% G/ j6 ^. o3 E- S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! J: @5 m' S- r* Y* b: P        else wait for 10 sec
& s  r3 c* u8 y        if A_i=A_leave then send to die
( P; k; S2 `: r. Q) j8 R        else inc A_i by 15 o! q. \' k% o7 h
    end
% C' T9 L* C# p; V. k' fend

最佳答案

查看完整内容

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是个什么东东?$ M3 F( o7 K$ P6 q$ j( p
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?0 M( p: d. Y% |6 d7 ]8 a1 m
' A/ P( g1 B9 J- E4 {2 H; `( ]
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! @' `/ P/ e* d  h3 h8 y4 p
, [" Q; X1 G5 m$ ?另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 r9 j, _' x- R( f& |& T( P
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 \2 J5 M: g. v" @% ]2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 D  z6 |7 Y9 S. ]4 {6 d3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 u1 h5 A$ e/ O  k: p( k. [, _& jbegin P_induction arriving
  r2 V( J. y) j3 Z/ W" i( L% p    clone 1 load to P_pick(A_induct), e! _, H. J" v$ B: a; Z
end最大的系
' E: i7 c0 r" K+ Y2 u. `' W! k* U; j8 S+ i* e- J3 a
begin P_pick arriving
8 t$ P" o& u) H) C2 K% I    set A_i to procindex * 10 + 1
4 w; t* k9 [" i- |& C* w( O3 A    move into Q_induct(procindex)
  U+ J" P. I' m/ _$ [7 F  z2 h    move into pickaisle.induct(procindex)* G7 A# a4 c6 q# B
    /*check the type of pickaisle.induct(i), for your last problem.*/
# c7 S2 |: L5 ~) H
4 y8 g9 [; W1 t4 T/ j    while A_i<=30 do begin
# x$ y; ]6 ]/ A. w! `        travel to pickaisle.con(A_i)2 Z6 U! R, ]; t3 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 d+ ~- i  M; t9 C) K. A/ f
        else wait for 10 sec: M6 _- h' G9 j
        if A_i=A_leave then send to die* T- ?( D. x; d& u) g( ^" T7 s
        else inc A_i by 1
1 e8 F; C; m3 I; L# I; x2 ?    end% r0 g3 i  s% @3 Z' u" [
end
2 R" i5 v: C9 E: Q( N+ @0 R9 b6 m0 e+ H
其中的procindex为整形,代表当前process的序号。
2 o/ W) l5 l; m: \! W. W5 Y/ E9 xstation和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, 2025-9-13 21:06 , Processed in 0.017151 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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