设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13062|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' q( i* q5 \  p- W! J8 S! r9 s
1 n6 W; y+ \6 J* }1 A2 G我的问题是,在每个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中的数值,不知道会不会有什么不妥。
0 b( H8 j" H7 z/ [1 L- M* S+ t3 ?' K/ a* e/ M
begin P_read arriving
7 Q! o& ~% H: y- y5 ~( L    while 1=1 do begin
6 Z" S( b& A* t; u- l$ @, Y5 I        read A_tote from "data.txt" with delimiter "\n"
: K6 r7 H+ J' w, ~& S2 ?& F        read A_time from "data.txt" with delimiter "\n"  o" p" ~3 N' W! U  G
        read A_leave from "data.txt" with delimiter "\n"
7 w& p7 W) x$ o& _* U+ b        read A_picks from "data.txt" with delimiter "\n"
, @- V; E) x5 ~" t' R( ?        set load type to A_tote7 w  g* y# q3 |
        if A_tote="tote 1" then set A_induct to 1
# b6 s- ^! ]+ e        else if A_tote="tote 2" then set A_induct to 2
$ g1 E+ w+ y/ e) Y$ v4 z3 J& h            else set A_induct to 3    % y, [4 b) o) r
        set A_i to 04 [- _$ K4 C; ]. j! K1 x  s& u
        clone 1 load to P_induction" C  q9 o; `0 }  x
        wait for A_time sec
4 d, o/ ^- |! `1 v/ j$ O    end
3 t" g4 W5 q  `* k! B. h$ Gend
5 u3 R% N  w+ b) p9 y9 |9 r2 f7 [4 U8 q  I/ ~0 c( P* b& U1 }" @
begin P_induction arriving% v4 I) c" B/ `, x+ p
    if A_induct=1 then clone 1 load to P_pick1
3 z' @4 k) A* |- C' X( B9 b0 y    else if A_induct=2 then clone 1 load to P_pick2
" X' S. W+ ?0 o6 |        else clone 1 load to P_pick3
5 `5 Q; `' D; v3 c* g; hend5 F% {9 v2 B# E; Y/ o3 j/ G
0 S5 c+ o6 v( ~& C( C% L- ]
begin P_pick1 arriving
* {, H2 d% g+ b- d+ W    set A_i to 1, F) F. A5 w4 c* w! U
    move into Q_induct1; r  X. D; q5 f/ o4 K% L/ {
    move into pickaisle.induct1
2 p7 q5 G' e/ b  z; i, F, N$ O9 R    while A_i<=30 do begin
* m/ o, e9 w5 W        travel to pickaisle.con(A_i)
& u8 D! t6 ]3 l+ ?+ R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( W. H& w2 `8 f2 ~1 h        else wait for 10 sec: f( f+ ~- L; c3 F2 T
        if A_i=A_leave then send to die( C- }, ~$ e& Q
        else inc A_i by 1
( C9 e. h- t. {7 b6 n4 A    end2 X1 S$ A- v% l- K/ S
end# i  E9 M, a+ @; k% ]$ ~' ^
$ U2 ~6 c. a8 q+ [2 h. z
begin P_pick2 arriving5 C& \; m6 ]* V# o, s
    set A_i to 113 w4 M. c$ Q% F* v2 h( ?7 N6 N
    move into Q_induct2# T1 y+ Q0 A2 ]( S4 y; x$ b' x0 W. J
    move into pickaisle.induct2
2 v* w% K, o7 {1 d3 y9 r    while A_i<=30 do begin  l* m- \+ c! j  ~/ a
        travel to pickaisle.con(A_i)* F! P+ g$ a. ^* Y+ \# j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- Z4 u" b% ^. T& c7 A        else wait for 10 sec) M3 `1 l. c  F! [; P& X1 a
        if A_i=A_leave then send to die7 ~1 n( Z, P! f, R- G, A% b( \! V7 c
        else inc A_i by 1
0 j# K3 o, L: H    end
( _- T, R6 {' kend5 r- f! u% {6 F& P

3 G* K) Y. K; ~8 H& ebegin P_pick3 arriving
$ k: ]: L. J3 W    set A_i to 21' @2 B* _2 E6 V8 k& |! Z
    move into Q_induct3
: a$ }& x7 F( m  f8 I8 f, |    move into pickaisle.induct3. G- d  w- ]: j- P
    while A_i<=30 do begin
- P: p2 A/ Z9 e8 P        travel to pickaisle.con(A_i)0 A+ n; C2 D' `: O$ ]  T7 o+ ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 ~) r! T2 A5 z/ j" O  ^! B        else wait for 10 sec  m& y& L0 ?  V5 b# v% S8 }  p
        if A_i=A_leave then send to die
" v" H4 S, {: y2 q# H        else inc A_i by 1, a4 U5 C) W3 G& v
    end8 s) A( c- E& ?* T# ]- H8 u0 b
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是个什么东东?
3 w) A0 q9 }  w8 lmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) [1 s8 l$ q# V1 w0 i

7 {- G1 q& r2 t' }! Z- K& w3 JAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 B' L. k; ?) G8 F) p: o/ M: M5 E
( N- c$ e2 K( ^另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. z6 G) Z8 l) N# }( E% ?1 \# g7 q
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 r! q( V4 s" ?1 f4 Q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 n1 l3 q9 G7 g3 H: G! J: [* ?3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) Q1 I1 f( a" ~* n+ Z0 a9 Vbegin P_induction arriving
$ x! `. S, l# i/ E& M$ v. M( |4 p    clone 1 load to P_pick(A_induct)7 ~) }% r: N) a: X
end最大的系3 y- B. Y$ p1 |8 D; n. C

, @; i2 [6 \3 J2 Dbegin P_pick arriving, a: |  L( E, t3 g. _
    set A_i to procindex * 10 + 17 x4 k! C1 j) i0 f
    move into Q_induct(procindex)
# x" k% M2 t8 E) h- _0 Y/ _    move into pickaisle.induct(procindex)9 [9 e. f( T) X' a
    /*check the type of pickaisle.induct(i), for your last problem.*/1 L5 l% x3 w- N

* b, F/ c3 L6 W    while A_i<=30 do begin$ `4 l9 J* _/ Q: J
        travel to pickaisle.con(A_i)0 h6 g/ k+ c: w& V4 k6 T8 g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 u0 V# W. w6 E2 A, y
        else wait for 10 sec
9 _9 M" S& Z9 Q* j        if A_i=A_leave then send to die
' W7 n8 z5 ~) Z1 B: Y" T0 Y$ [6 }        else inc A_i by 1
$ Z3 r$ }) m+ I! @    end
) I" l- K. x/ q4 W* B& h$ Wend; v! `+ B4 x! {& Z6 \
0 Q1 C  F+ ^) S/ e6 u% n
其中的procindex为整形,代表当前process的序号。
. L* B/ U6 U$ D; Q* y  _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-3-14 18:52 , Processed in 0.018413 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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