设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13251|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# K" f$ h4 @/ O8 t5 F6 v# h+ L5 {# Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 r" k1 l7 k) \( p- K2 N* _/ K/ u# V2 l
begin P_read arriving: V2 t# k8 L0 R$ I3 k/ o
    while 1=1 do begin
& ~- _( K# M; \1 q' i, _+ a9 Z        read A_tote from "data.txt" with delimiter "\n"' [: i3 }! p; x' `( f
        read A_time from "data.txt" with delimiter "\n"
, \0 U+ h3 J8 @) T( x  t. B5 A        read A_leave from "data.txt" with delimiter "\n"
" B) N: C  X6 N7 ?+ K. ~        read A_picks from "data.txt" with delimiter "\n"' @1 d, N" K" Z; i
        set load type to A_tote
% E# F+ H" \# K5 }2 i* s        if A_tote="tote 1" then set A_induct to 1& e8 v- L6 b+ M) J! _
        else if A_tote="tote 2" then set A_induct to 2: ]4 o7 J3 Y; P3 \1 k2 X0 E
            else set A_induct to 3    ' \& b2 }7 Q% L9 K$ z
        set A_i to 0
6 u3 D: O0 e! ~, g! c, D        clone 1 load to P_induction
3 g7 u( a- A6 i- w        wait for A_time sec3 O' A* v& O: r! a; z' g  y
    end
2 E* Z# r+ j; X) zend
6 h# C7 Y) Z# ?! ~9 u1 ^' C; T7 ~" p/ V# H( j
begin P_induction arriving- D4 b4 w$ E( G6 a  f7 a3 c
    if A_induct=1 then clone 1 load to P_pick1
! b8 z" ~3 _' O( G& _! u# L    else if A_induct=2 then clone 1 load to P_pick2
; j5 w) f9 k* A2 M        else clone 1 load to P_pick3( Z( r0 n/ `6 K& g! L  p% z
end
" }1 U, {2 `4 E, m* {
2 k4 E  h& V0 b6 `( n, ]begin P_pick1 arriving8 z) n9 n4 Q3 l2 D% G6 Y
    set A_i to 1
! I9 p9 D: @0 X+ g5 G8 r3 [7 A  m  D    move into Q_induct1
( k: k, d3 T+ D, E. N' K    move into pickaisle.induct1
$ v7 e3 I- o% S) T, g% b    while A_i<=30 do begin# t7 u2 G+ v( n  H8 N* `
        travel to pickaisle.con(A_i)  d# |: w1 V; h) i, |7 b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 V2 P8 ~4 s! t& X
        else wait for 10 sec
6 z1 Q, ?3 l$ v4 q6 B6 i        if A_i=A_leave then send to die
1 w; f+ A; x! ?* n! P2 u7 [        else inc A_i by 1+ N, _6 V. _+ H; k8 b
    end: \4 v4 f5 B& k6 _: G2 c
end* W( [9 H& N2 _+ V  s# H  U
1 Q' x$ w( j0 C0 }6 B1 I3 O
begin P_pick2 arriving$ F, |) A, ^( r3 V2 l; ~$ u
    set A_i to 11
+ L. c4 u% j( g5 x/ d    move into Q_induct2
, j0 z+ f; O( o- [* ?, V4 L5 J; o    move into pickaisle.induct2
8 z( {* j: w, C    while A_i<=30 do begin! S. ~- \! F% N3 p3 E$ Q
        travel to pickaisle.con(A_i): Y7 G$ b/ `7 h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; G* B. |( S! y  E( {
        else wait for 10 sec1 o1 t: L2 B4 C' O# p
        if A_i=A_leave then send to die
5 R2 L1 R/ M  }; r4 u/ w        else inc A_i by 13 ]0 s9 z9 f* [! d: Z$ ^1 a$ F
    end6 u; b7 ?1 N; l. E, a9 z
end
# x2 _0 O9 @/ N9 k/ O- ]' P# U( a7 W
begin P_pick3 arriving
- v, e4 O. ~6 A: x; J- B7 i    set A_i to 21
2 x0 M$ X  o/ f' Z, A7 `, V    move into Q_induct3
) ?7 B3 \" w% S2 u) Z8 y2 J' |    move into pickaisle.induct39 ]1 L- j6 @( Y1 y
    while A_i<=30 do begin# q) q, _# Y7 M; i$ w& b& \9 N
        travel to pickaisle.con(A_i)
  e, x- y' W; t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' W' _* n, p+ A; w        else wait for 10 sec
( j/ q3 y9 j/ j( A, c/ k: h  R        if A_i=A_leave then send to die
4 J% A% W/ y  a, t2 a        else inc A_i by 1
- w4 u/ @7 T+ Z. u2 R" \+ |    end
$ I  |; V3 p- \" Vend

最佳答案

查看完整内容

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是个什么东东?
0 [7 q. @% P' b6 ?& i2 F/ I1 o! Mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( X" u5 x( k# N0 L- V0 H6 s% P' q" q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% z' a4 M; p5 n# w! f

/ {* E1 j3 b! F2 H3 R% H. z' V3 W另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 r# c/ N& I* y5 O
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- z( t6 B8 U  G* m4 P2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) ]) O4 Y  z4 j3 z! Q$ B7 ~3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. Z; A7 c3 w7 X. r9 P9 `
begin P_induction arriving$ h4 S+ m- u& v* J
    clone 1 load to P_pick(A_induct)3 x/ \% j9 S- [+ Y! u! m7 D+ I4 G
end最大的系3 _) F- m5 i  P' Z
! M7 [; J# F* N3 o, o
begin P_pick arriving
6 ]& G1 x$ Z+ ]. F3 a& y& d    set A_i to procindex * 10 + 1
6 D$ W1 H$ v6 A9 A+ }    move into Q_induct(procindex)! {# l$ ^3 i; m
    move into pickaisle.induct(procindex)% \& x- A. w5 e1 l- T/ p
    /*check the type of pickaisle.induct(i), for your last problem.*/, D( x  N' K; [
8 c( \! j5 i! u9 R, ~& {$ f0 g: J7 R
    while A_i<=30 do begin) W  C! ^: j7 Q6 g: P" F
        travel to pickaisle.con(A_i)
2 T4 E6 e$ h7 m* f( ^: A( S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 o2 o' e' ^! ?0 m; q
        else wait for 10 sec  T7 v7 T: n/ I6 u; M
        if A_i=A_leave then send to die
; o1 a$ D! L5 T7 D        else inc A_i by 1
& q# c  p; V" l/ e, m% U4 W    end2 Y3 s) A( J# ^/ [9 A
end
8 b, V$ q4 r, G. K( s8 c
1 Q1 E8 C3 t! l2 ^4 X1 E' ^其中的procindex为整形,代表当前process的序号。8 Z6 b' ~! g! X/ Y5 Z( I$ `
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-30 07:21 , Processed in 0.017371 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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