设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14373|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* K' x8 \( X8 }9 Q* Y* z9 ~+ {! l* G7 O5 W, 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中的数值,不知道会不会有什么不妥。5 Z' i0 b3 E8 I/ }
0 l, j; A0 b. ~8 b
begin P_read arriving
  u# G" `* m- |: O    while 1=1 do begin: L) g8 ]8 \" N. t; ^' t/ F
        read A_tote from "data.txt" with delimiter "\n"
$ O' e0 h+ T- V0 f$ U4 i1 K+ _7 \        read A_time from "data.txt" with delimiter "\n"3 [9 M. n2 n$ e- M. q
        read A_leave from "data.txt" with delimiter "\n"
2 x* o4 K3 Y) \9 s        read A_picks from "data.txt" with delimiter "\n"
* j1 T8 Z; w1 _' k7 h) |        set load type to A_tote0 f  s6 d) P- T% f
        if A_tote="tote 1" then set A_induct to 1& F+ G, X5 |. E2 y& o8 S
        else if A_tote="tote 2" then set A_induct to 2
! C; A+ ], u( }0 R- J, ^/ @            else set A_induct to 3   
/ j. d9 a& m; A: c( h        set A_i to 0
* l5 n0 p1 ~" ?! u. y/ z7 u        clone 1 load to P_induction
9 w# A- v$ }8 W4 G        wait for A_time sec
# p3 o% [3 g4 \" h3 Y/ I$ |/ G$ U    end# ]& o3 n$ ^  l- z7 N
end
) e8 ?5 H" }5 ~/ m  L' L# k7 y; G3 U' [6 X
begin P_induction arriving/ J( x+ ~0 o) r, G6 b# r  K
    if A_induct=1 then clone 1 load to P_pick1
8 c- g+ e& {- s7 r1 s% W% Y3 P( M    else if A_induct=2 then clone 1 load to P_pick2
# x- e# q  E6 d! L  U1 ?        else clone 1 load to P_pick3
" }, N/ I9 t5 B- aend* y$ A4 w; K3 N! c  I

: f/ K; ^7 k/ `) Mbegin P_pick1 arriving  v; I6 ^: _% ], ^3 C' j
    set A_i to 1- @3 X/ ]; I& M' e  g/ E7 \
    move into Q_induct1% `- |& i& u/ Y. Q4 U* S1 i3 B% h
    move into pickaisle.induct17 N. ?1 c3 y  j. b' b: m" \
    while A_i<=30 do begin) |# |# u. [- O2 y) W6 W
        travel to pickaisle.con(A_i)8 h- U' o, @5 q5 D( r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 s9 t, M' K* X. T
        else wait for 10 sec  {- S- v. D  L/ [/ U0 Y
        if A_i=A_leave then send to die# }2 z5 E3 A/ _# h
        else inc A_i by 1. Y6 G  ~/ l* _) P- B* {1 m
    end
- n' D5 t  ~: I; M- ^/ V% o" Tend
+ j( B$ J+ L: U% q& o8 y4 U! Q; t) f6 u. c7 c6 F
begin P_pick2 arriving3 Y6 z. A* [7 J, C
    set A_i to 11
# E$ |, h0 G+ }5 U+ @* a    move into Q_induct2
1 w, p2 Q# l7 v    move into pickaisle.induct29 G1 Q$ M( O, {9 c- F8 U1 I4 g
    while A_i<=30 do begin
: L5 o: C* k/ j/ T- v9 u8 f        travel to pickaisle.con(A_i)  _2 S0 [8 x0 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 q) N$ [2 q% N% i
        else wait for 10 sec. D( L3 ~0 ~$ D
        if A_i=A_leave then send to die0 I; E7 Z% x* Q, {" W
        else inc A_i by 1
6 F' f; y! i: o) R, i    end
# I9 c2 M3 e, Send: t& m# _; |# s( R$ C0 [9 p
0 O) R! d+ D7 A5 P7 X
begin P_pick3 arriving! S* Q6 F" {/ m! e
    set A_i to 211 {1 L1 n, {% u
    move into Q_induct3
' }! g* ]+ A9 ~    move into pickaisle.induct3) p' ~7 S- u6 y& I5 c1 }
    while A_i<=30 do begin
& ?! B5 u# n% A& {        travel to pickaisle.con(A_i)* W8 q( F4 ?3 }  l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' {. ?' h% t0 P- F2 K- y2 [: n
        else wait for 10 sec
5 N( @$ ~8 Y$ K        if A_i=A_leave then send to die( M. ^/ a, \4 ~5 b1 X6 n
        else inc A_i by 19 D9 g  v7 G6 g
    end  _( ]$ c6 q: [6 x) r
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是个什么东东?7 v$ E- B. d8 g% u8 Q) T$ }
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: Z( R4 G  @! u( ]$ o! B8 h& W6 n% P6 R* v& U
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 N1 H& S1 y4 j& o2 O5 |0 d! F8 v# {. ^) P, q0 Q$ N& \
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
& f2 S/ Z! J" H1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 H0 q& L4 `4 V3 w) f2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;# I7 p7 `, h$ p
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ m6 i8 r8 Y- u9 n$ n  N
begin P_induction arriving
) |( v% l9 \1 \5 v    clone 1 load to P_pick(A_induct)
( ^8 C% D( v8 Zend最大的系
# y. c! C" T* g/ b- u; l3 w" ?% {
  q. h( Q' Y1 N: Q$ lbegin P_pick arriving
+ E& E. B: B$ i& x5 Z- |    set A_i to procindex * 10 + 1
7 y0 ^5 x% @+ a( e( }4 d    move into Q_induct(procindex)
9 ~4 Q- i) C$ ~" s1 E% T  k    move into pickaisle.induct(procindex)
# u1 r! y6 z% w    /*check the type of pickaisle.induct(i), for your last problem.*/
6 x/ |" b, L2 ]' w6 t
1 H. K- V+ ?: g3 C    while A_i<=30 do begin
- _. s2 c# m% ]  i' u1 {; M        travel to pickaisle.con(A_i)
3 g3 I4 y5 g/ p/ J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ c& R( Z' S7 r: }
        else wait for 10 sec
+ n+ R/ w) `- v1 i: ?/ h% r        if A_i=A_leave then send to die) {& ?$ n$ t/ D" U2 Q1 R
        else inc A_i by 1
/ Z6 Z8 a4 y- q- C" ]) Y/ X    end
3 s9 H4 q" Q  M; d4 q' z  pend/ o3 C7 U% T" k" T( W7 y$ d& R; p

+ h8 j; ^' ]" i7 g  X  L5 r4 `, T其中的procindex为整形,代表当前process的序号。
) @" a3 `" }8 R) f& N4 _& Tstation和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-7-8 08:31 , Processed in 0.014218 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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