设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11772|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ L, I; m5 `* W2 t

- c8 G' i! ~( Z我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* J( M" \! I; L, _3 z: z2 J/ k2 s# J4 q0 n/ w2 }
begin P_read arriving
6 |" [3 z. z; g" x' i- Y1 w    while 1=1 do begin6 l! M. l% D% X. t6 z
        read A_tote from "data.txt" with delimiter "\n"% t7 x6 b4 c7 Q2 ]
        read A_time from "data.txt" with delimiter "\n"
) B+ ~; d7 Q; t& K        read A_leave from "data.txt" with delimiter "\n"8 G4 ~) Y5 y& e: c2 d( s7 W
        read A_picks from "data.txt" with delimiter "\n"
5 Q( @/ j5 o$ r5 @( x; v/ F# l& [        set load type to A_tote
- n; a. m0 g* m' J& y        if A_tote="tote 1" then set A_induct to 10 l& V0 R; G7 Z0 i
        else if A_tote="tote 2" then set A_induct to 20 `) b! y, S. y& T: n' Z$ C$ |
            else set A_induct to 3    * M  d4 i- V& f
        set A_i to 0
) ]" y: f& u2 X        clone 1 load to P_induction, E/ c) r4 x+ Z2 t9 c5 M
        wait for A_time sec8 c8 L% T& o, K) w+ w7 x
    end
3 I9 E( d6 I& _5 D" Tend7 Q3 j# J, V8 W3 B7 D! P( x
- U7 X8 E+ h5 r5 U8 z2 ]! `* x
begin P_induction arriving
2 g' t% y" l+ A2 a8 M" K: K    if A_induct=1 then clone 1 load to P_pick1
- L6 Q' D- g6 M" ^, T2 _    else if A_induct=2 then clone 1 load to P_pick26 D& I/ M9 R$ q$ p+ D/ `; ^) E
        else clone 1 load to P_pick3
. r8 p& n" Z. Lend% l3 ]8 J! |% m6 L9 g' v, k

5 s4 e% i4 b1 Y9 ^" }2 A) v0 a  Dbegin P_pick1 arriving
2 s" p# q& n7 v' u7 }  x, U    set A_i to 1! Q  \( `( t% i% s' m- _
    move into Q_induct1& ?7 }: j# ?, L( W6 u( i- x
    move into pickaisle.induct1/ a3 @# P8 i' q+ s& Q9 L; A
    while A_i<=30 do begin; S3 v* c; j( G3 @8 r
        travel to pickaisle.con(A_i)0 `& N5 o0 x2 F" J0 O, w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( h: O! r) @6 P5 N( C
        else wait for 10 sec
5 _0 d! j( s' s* ^        if A_i=A_leave then send to die
, I0 T- `( Q1 @4 n: D        else inc A_i by 1
- w) \% i0 ^- ^+ U* e4 L$ }    end
+ o( x4 o# R8 Y9 A) L4 W  Eend
: \; X6 s0 c4 z# w; [. n4 J; U9 m. K: K1 l% A
begin P_pick2 arriving* o) T7 x' x! v( L7 U5 F
    set A_i to 11
. O8 `; e: d+ h, g    move into Q_induct2
# D( N0 U9 B* ]" ~$ T    move into pickaisle.induct2
1 P; F6 _6 q1 j; Q    while A_i<=30 do begin
) D& l8 N8 B4 ?  T        travel to pickaisle.con(A_i)
6 c5 [8 I$ E: R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; {1 {8 K/ u% d" g9 g; n5 @" l        else wait for 10 sec
0 s, ?6 L4 Y3 r, s' A2 j1 s. K6 Z3 i        if A_i=A_leave then send to die
6 n( w2 V9 I( d9 x' n        else inc A_i by 1
( a( H& V2 y/ r* n( Q/ U    end
2 r( W0 n' {* j8 J8 @5 D2 l" I4 f8 lend
% {& R' v1 B. d% @+ J4 x7 K$ o1 H/ ?. Y, u; Z! p
begin P_pick3 arriving6 u; w* d; G7 a; v! A; {$ B+ U& i" l+ b
    set A_i to 21
6 s, ]1 w6 c/ ~1 b- E+ F) Z' Y    move into Q_induct3
5 c3 x: X- j% P! ]( m7 f. ^. G+ j    move into pickaisle.induct3+ y5 W! R% @4 G' N- A
    while A_i<=30 do begin8 ]# w7 ^% m% O2 a1 o! u
        travel to pickaisle.con(A_i)
+ r0 j& h2 h# j+ n4 E! U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 J' r4 v  C5 }1 W
        else wait for 10 sec
; l9 S# y$ I4 U! J9 S        if A_i=A_leave then send to die/ m3 o) Y% \: x$ j8 t) E. F
        else inc A_i by 1
, b2 W/ K9 f+ ?3 _1 d! J$ S8 |5 w8 c    end
( w9 H0 \# W8 pend

最佳答案

查看完整内容

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是个什么东东?
4 a  A- I  d$ p, H- i- h. V# q2 Omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 M1 W, Z  }8 w6 c! x

+ {3 J; h  A6 E7 q3 m* Q, s7 sAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。1 |$ W* E! F5 H3 t! p  `2 `
+ I+ Z" W( ^; w; U; z* g
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( ^. f6 b' Y. A! C3 w8 ]" e! ]1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ {( L+ q+ z% `% _9 i
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 R" A& q4 [2 g, o- M6 ]! b
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, L6 i6 n: z5 sbegin P_induction arriving
/ s! O5 b  p: c1 s' h  ~, t    clone 1 load to P_pick(A_induct)& k/ p; ?+ ^' {" L6 g7 E* t
end最大的系: X. a5 O: l7 u
: {0 R8 O  Y# ^& n
begin P_pick arriving
# x0 k4 j: V, l" \    set A_i to procindex * 10 + 16 R# C$ ~2 L5 ?* E# t! t3 x5 o
    move into Q_induct(procindex)$ V" ~/ h" o2 x# g& S
    move into pickaisle.induct(procindex)
# k/ M/ R# m2 _* i4 Z6 C    /*check the type of pickaisle.induct(i), for your last problem.*/
1 @3 n) x6 m0 R) W9 V- |- w" o) @7 y6 R) I- d5 [# W% W
    while A_i<=30 do begin
0 c; I# F2 Z5 c. @        travel to pickaisle.con(A_i)  i% P% }7 S; }$ ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! S+ Q+ @! y7 S. z! J( V* S        else wait for 10 sec$ y# Q$ p0 C% ]
        if A_i=A_leave then send to die5 X( t9 v! K" }+ H- j; u2 ~; j! a
        else inc A_i by 17 m8 L9 a( W, f! W  r' P
    end
( s5 y/ v- S: }" Yend
" S- t! v: ?" j6 S$ g
, S5 S4 q* v" w其中的procindex为整形,代表当前process的序号。/ X' t% [  h: L4 i4 Z7 u
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, 2025-12-3 18:07 , Processed in 0.018113 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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