设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11618|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" C" l/ {; R3 \  {8 n! R, a) t. W
. j) f7 b$ `# 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中的数值,不知道会不会有什么不妥。
+ }1 h8 k8 f2 g" d. A/ R7 B" p
' J  {6 T, E3 i2 ^. l9 p, ]begin P_read arriving
2 O. M8 g; X3 K& z, P: C    while 1=1 do begin
* Q4 J  z- s  l        read A_tote from "data.txt" with delimiter "\n"* Q1 U3 {' ~% ~2 Y
        read A_time from "data.txt" with delimiter "\n"
( \8 A! g8 r0 y+ R$ y6 t        read A_leave from "data.txt" with delimiter "\n"+ i' B$ b7 C" g( p# i: g
        read A_picks from "data.txt" with delimiter "\n"
: X. x0 H! u. s! {8 {        set load type to A_tote8 |4 {$ d7 Z) y5 m7 Y2 j; \
        if A_tote="tote 1" then set A_induct to 13 x+ o8 E) V' q% e
        else if A_tote="tote 2" then set A_induct to 24 `) B& k/ {7 n5 w
            else set A_induct to 3   
) {8 v) g6 \2 z        set A_i to 0! q' j+ g$ m: E" h* T! h$ |
        clone 1 load to P_induction" i; M. M3 f4 j) Z! o
        wait for A_time sec
! v5 _- r$ l$ W7 e6 j3 N% S    end$ E( a* D7 B$ F! h* Z+ W# w
end
( C) b1 |  l3 l8 c2 X3 h% }# P
5 A! {* ~& z* r: l  }- C1 {) zbegin P_induction arriving
! s: {! G2 K' ^4 I5 j$ M    if A_induct=1 then clone 1 load to P_pick1
+ [$ S  w: E% o+ }! w9 Y7 C' h    else if A_induct=2 then clone 1 load to P_pick24 ~7 g+ y% s; I) y! h3 N
        else clone 1 load to P_pick39 J$ W1 `5 r* h4 `/ ?( a
end
( u/ @; w& k1 L+ _5 ]/ z8 `1 B
* Q1 N7 Z( M' C) |- e) x% g/ kbegin P_pick1 arriving
& v4 g0 }3 t4 O0 W    set A_i to 1
0 m! `0 |: S4 Z' ]( c& \+ x    move into Q_induct1  D8 X, j- ^+ H* ]9 E
    move into pickaisle.induct1
5 `& }) L& ~5 N) J$ C    while A_i<=30 do begin. i8 h, b0 v1 u
        travel to pickaisle.con(A_i)
" B! `- ]" g$ W1 D' `. g/ c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 {3 S  N/ {5 c, o: @3 @        else wait for 10 sec
0 F' |  `: o' L7 Q- u1 x. g- M        if A_i=A_leave then send to die
3 u; X* x2 q( U! w        else inc A_i by 12 V2 V, f- @) z' x
    end" ]3 X- J1 Y" n; I
end/ @, T1 V; A& V) D
4 I# \  Z8 j7 Y" g' Z$ _
begin P_pick2 arriving
6 D% o# c& ?& }2 s+ u* m5 ]    set A_i to 11
; a! L( I( p% X/ h% Y; _    move into Q_induct2
) |- z$ y% v: e* j) b! H0 e9 q    move into pickaisle.induct2
: I/ O2 `) ~2 [! B    while A_i<=30 do begin! A! E& _" b  j) X' @7 g
        travel to pickaisle.con(A_i)5 M6 M! a3 C5 `9 z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 U' K+ `1 V# A$ l/ B" O" p( e7 Q9 }
        else wait for 10 sec* m* x% g4 U3 @- Y
        if A_i=A_leave then send to die" k, T" S! H' O* i5 C3 k9 O0 I8 l
        else inc A_i by 1
5 ]1 L. w4 f4 t/ R& x/ R; c' C    end6 J" V2 V4 Z" c9 U, h
end# }* W- h5 I) G5 ]1 w, `1 @4 a) c
  T; ]: m; A0 d
begin P_pick3 arriving
7 Y/ T6 n) B+ i$ E' p' p- D5 i9 |    set A_i to 21
& C" D! V- b4 z0 ^1 L    move into Q_induct3) S  l' e) R# L; w3 }
    move into pickaisle.induct3- N6 {$ G- Q! G$ l" `
    while A_i<=30 do begin
6 ]! k2 C) j8 {' `; ?7 r' ^7 N/ @5 M        travel to pickaisle.con(A_i)
1 q4 L& u; P0 l% _  u5 Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 {: N8 [1 s. o* K- v+ I3 a
        else wait for 10 sec
' G/ ]7 R3 e9 R& r        if A_i=A_leave then send to die7 r) S7 ?% C. X1 z
        else inc A_i by 1$ S4 C6 E9 O! @  C+ d9 W) _
    end' d  r( _" G3 v* \0 s
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是个什么东东?
' N$ `9 Z& ]# L( |. G/ Umove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ a% ?+ ^, [7 g. c( ^
( x! \# s" `! l1 ~1 B# m, k) mAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。# H/ Z$ n; Q& U: p) v
' ~9 u( [* D! d5 \7 |  c
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- A  t* U& T/ R: I' f
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
: G( s  s5 f6 V4 A& |3 Q' @# R( [1 H2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ L8 w9 a( \& M# M: q# u3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: t0 l0 [( Q+ d0 B2 j
begin P_induction arriving
! o( Z  Q2 ^: }: z9 ^6 n    clone 1 load to P_pick(A_induct)+ i8 t: S1 A6 U9 k) ?
end最大的系; \# T. ~" ^) T( M$ t4 B1 S' C8 X; W
8 o' ~$ x: w/ ]# [: F
begin P_pick arriving
, q0 {$ R6 v6 j8 Z    set A_i to procindex * 10 + 14 y& D$ C  {  T7 p- s
    move into Q_induct(procindex)3 F- i8 H9 x0 e  e: @( A; Y
    move into pickaisle.induct(procindex)
: F6 a% `- U6 X& g4 I5 ?, c2 u    /*check the type of pickaisle.induct(i), for your last problem.*/
$ @/ m- j: k1 B: f0 I3 @+ k# d  e, R8 J% B4 c6 l) E4 |# \3 s7 k5 s* E
    while A_i<=30 do begin
* m7 o$ C, ]* ~' {$ Y4 ^) p. n        travel to pickaisle.con(A_i)) `0 ?, c$ [' a+ c% D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- o- T  O  y& ~1 x/ E* {+ F2 b
        else wait for 10 sec, s& I" {6 z* y0 ^* ]
        if A_i=A_leave then send to die
4 r) C- q% j6 R  H        else inc A_i by 1& J# v' g" O1 h8 \$ D
    end% [/ p" h3 s2 ]) u" }+ t
end+ p, h0 ^$ o* w$ g7 u+ V
; d6 c' B! Z6 v5 R. @
其中的procindex为整形,代表当前process的序号。
/ n- o  M* e1 c; h2 x* P& G8 rstation和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-11-23 20:53 , Processed in 0.018633 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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