设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13460|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 a2 ]9 a  Q. K: u- {' u

! q9 S! D" i. Y1 a- c我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 T: ?* V3 a" L" Z0 G/ m+ @* z9 A

  A; H( [  s/ l# p7 S6 f6 Rbegin P_read arriving
( T" G, N6 E: I: {/ ^    while 1=1 do begin; {6 F  H6 W  G9 O/ G4 K% n
        read A_tote from "data.txt" with delimiter "\n"
7 o# S' Q& T3 T0 W6 S/ X6 p        read A_time from "data.txt" with delimiter "\n"
: ^" e7 P; l5 Y1 I# q        read A_leave from "data.txt" with delimiter "\n"0 O3 a" ]0 w. b( Y; V
        read A_picks from "data.txt" with delimiter "\n") t2 ^4 y& V4 F1 E' A8 H! e
        set load type to A_tote' p$ x: S  X" h! q% A4 z
        if A_tote="tote 1" then set A_induct to 19 S$ A' m6 |: v8 R$ G6 m
        else if A_tote="tote 2" then set A_induct to 2& E: V9 z2 I  L, m! ~: k( X
            else set A_induct to 3   
% C; k  y6 ?1 w        set A_i to 0
- O+ l4 c) G$ b" i8 z& w# V        clone 1 load to P_induction( v9 c$ Z" o6 t# V4 k5 a
        wait for A_time sec( P9 s# O( N/ ?2 B0 ]" u: ^
    end! J' a8 U5 b) g! k0 o+ M
end; q, L0 B3 }0 Z' v
! n# L  }) B& R& I7 m- {1 p+ ~3 [
begin P_induction arriving
  _. x& F; q5 t& x' h& a  o0 t    if A_induct=1 then clone 1 load to P_pick1- j$ l6 |, l; E9 `
    else if A_induct=2 then clone 1 load to P_pick2$ O) [+ A  ]( k1 @, P" C
        else clone 1 load to P_pick3& I7 S+ z6 ]8 k( f
end9 {# y. _  F  s# j( n

. W, j* K/ @5 V" S) T$ a3 Abegin P_pick1 arriving: i# ^8 n0 I$ a( ^
    set A_i to 1# }( s  z6 \& j) ^
    move into Q_induct1
8 Z; T7 S% d9 ]7 o    move into pickaisle.induct1
6 q  }4 o0 A7 Q2 Q- {    while A_i<=30 do begin- \& [4 {; l/ p! j! g
        travel to pickaisle.con(A_i)
1 _+ r# t6 p$ u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ b3 q5 Z% |/ Q, v2 y( s5 u7 f
        else wait for 10 sec9 I/ m4 ]7 H8 F$ M! j6 W
        if A_i=A_leave then send to die
+ z$ v0 \4 q) V, X        else inc A_i by 1
0 ^& g& W, k' b' k    end  q5 h  m8 x  B! i: [; n  @4 O
end
$ {) H8 v2 L8 L# H2 c  f
; f/ @/ P: n+ A" c: zbegin P_pick2 arriving: p0 c$ |0 m, }
    set A_i to 11
" m! B5 P5 Y" r    move into Q_induct2
1 |, g. h9 z* K  M; K6 ^6 L5 ^0 F0 ?    move into pickaisle.induct2
2 Y2 Q3 k* T4 _+ Q7 @4 p) L0 l; Q    while A_i<=30 do begin/ ?$ ]7 v8 J) [- C
        travel to pickaisle.con(A_i)9 @, r) Z+ J6 S( [, C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 q( p% _8 O5 a! q3 K        else wait for 10 sec
. f2 P1 V9 c0 w% a" i        if A_i=A_leave then send to die
8 z* X' u( u0 s% z6 K8 ~" [3 i1 [        else inc A_i by 1& [& ^& D) H" i8 s( J' \& Q
    end$ K$ w, L& R% k' K* H4 e% _- |
end# w" g3 S3 n( S$ [* f
1 U4 P2 g" M) q9 O0 r6 j3 }% s
begin P_pick3 arriving
; ~7 ~7 y3 G. y: T% s8 X    set A_i to 21
) N% l4 K. S9 J5 Z6 D2 z" z    move into Q_induct3, P8 F( w0 t7 S6 ^! m# L# \
    move into pickaisle.induct3
  x8 D6 G6 x* V! G8 V* S    while A_i<=30 do begin0 T, E" E$ H4 A& J5 t2 ?- Z  j, }
        travel to pickaisle.con(A_i)
& H2 \( f. \4 v) z; P2 d" H) [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 K4 c0 E3 f1 v: e' g5 n        else wait for 10 sec6 C+ a* g" e. K( k, A' g
        if A_i=A_leave then send to die
- e* x) j! K( f# t        else inc A_i by 1! l; g' @# X2 A) d: E2 }
    end
% p3 M) Z* Q) y; L. B4 Bend

最佳答案

查看完整内容

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是个什么东东?) I. a; ~- c  P1 f, }
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 `" ~/ W3 c6 z
6 @, f! c# @. `( ^- N  \0 DAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。# H- T7 O1 s7 t" j/ E$ x" W  H7 U

# f9 M# L+ D9 \9 T8 Q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* e3 ^) Y7 M: J6 G1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 p3 \$ z, ?' M! F, n
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' b1 K& n" x% V6 F9 X
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ `% ]" n# e& E4 r9 H8 r9 Abegin P_induction arriving
7 b" t9 `) D' d3 Q9 Y7 l& g/ @. J    clone 1 load to P_pick(A_induct)2 Z  t, M+ _6 F6 b3 q
end最大的系$ J* d6 M8 ^5 A% m( X

; G/ ]0 H3 b  p6 ybegin P_pick arriving; o  }) {  j, I7 J- }
    set A_i to procindex * 10 + 1
( D! B! d% M7 _$ M* }% L5 n8 R    move into Q_induct(procindex)/ I* \/ C! X( U4 D8 ^
    move into pickaisle.induct(procindex)
$ F: B5 }7 ~- o4 k, E& @    /*check the type of pickaisle.induct(i), for your last problem.*/
/ Q  ~* i4 Q* h8 C7 |: U
, M  J: @  ~- U6 }    while A_i<=30 do begin0 z9 j% I; ]( J) s+ w
        travel to pickaisle.con(A_i)6 T9 p+ O/ p, W) s( [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' Z4 l; V0 N% D. \2 c- d
        else wait for 10 sec- A+ P; c/ ^8 _
        if A_i=A_leave then send to die5 J  K1 I  Q4 {4 u0 h% z
        else inc A_i by 1
0 E6 ]) }. I2 B, ^4 `. }, s    end
+ ?# l* G9 n  |  j6 w3 g/ dend
$ \: F. e) m0 l0 A9 z" y: x/ O6 j- Z' x9 k5 M' d2 A/ b1 @& O: T
其中的procindex为整形,代表当前process的序号。
* q+ k. w2 Z+ J! estation和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-16 01:00 , Processed in 0.014895 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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