设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13134|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% U+ j; u% M: ]- Z  ~& J
+ M/ F1 ]+ X+ ^, G9 H
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 h2 K* e) E5 g6 Q/ n, B
: r" z. M8 `# xbegin P_read arriving! L/ r2 J7 ~$ A% Z" q, F
    while 1=1 do begin
9 S  Q5 \+ @+ o2 @        read A_tote from "data.txt" with delimiter "\n"
; d6 f9 `- X6 q  F3 [: g        read A_time from "data.txt" with delimiter "\n"7 N7 V/ Q  _# o) z' m& K
        read A_leave from "data.txt" with delimiter "\n"; e5 M  z/ U1 u9 X% S2 q
        read A_picks from "data.txt" with delimiter "\n"
4 Q* J. v/ n/ I9 t; X4 S; e        set load type to A_tote
  q/ X# l, w% i8 |# H8 N        if A_tote="tote 1" then set A_induct to 1; l, ?/ E" {! f7 C
        else if A_tote="tote 2" then set A_induct to 2
% L' Q1 ]- _$ b4 Z            else set A_induct to 3   
3 K! V5 W& k- Q        set A_i to 09 k: S0 q& ^2 Y9 C; y8 t
        clone 1 load to P_induction
. {5 q6 g- [' K: G) q; p        wait for A_time sec
& Z5 G4 E: v9 p# T. R& u& e! k# K    end" D, a! e  P* x2 }0 N/ Y4 ?
end
% W" Y! P; V" ]3 @! E2 q" M3 F9 x3 @
begin P_induction arriving, T5 C, j& n  j3 K. Y
    if A_induct=1 then clone 1 load to P_pick1
9 m$ E7 F1 [4 m# t# D. A) ^    else if A_induct=2 then clone 1 load to P_pick2' r/ {; d" [7 ~5 E' V: s) i$ M: n
        else clone 1 load to P_pick34 V! A/ q/ |' g2 Q, W# w
end1 @, I+ c$ y+ F5 q' o. @' A1 V$ t

+ y6 Q7 J) A8 A; n! b$ A5 g% tbegin P_pick1 arriving: G) K2 w% Y: k
    set A_i to 1" X" N4 [) \9 s( }( ?
    move into Q_induct1
8 }5 d+ [7 p( f8 f( \5 I" a3 W    move into pickaisle.induct1
  t! m5 Y6 Z1 b! A! r) `    while A_i<=30 do begin1 `+ k$ v7 @$ b) @' m% s- z/ n) j
        travel to pickaisle.con(A_i)
5 \, }8 l9 _6 c5 O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  P4 x) Z1 S: @# j% H* U( i% h
        else wait for 10 sec
+ b0 o! E  q  k        if A_i=A_leave then send to die
! N! u: v2 r( u4 V- u        else inc A_i by 1
& z5 s( o6 m, R$ J% S7 }) i4 E    end
) o5 |/ {1 a9 K, a. ~) Y9 p) V1 [end
1 l7 V' \) B( H# Z) U
# h# q' d2 i- f: q( r3 y1 Cbegin P_pick2 arriving3 U; N+ Q5 k; |
    set A_i to 110 Q- `' x' d# d/ J8 f9 h( A
    move into Q_induct2
! D( ]0 e8 K; E7 }) o    move into pickaisle.induct2
' x. \( X: J* u* E& j% S    while A_i<=30 do begin0 e1 t/ o  _% i) D) g; J  L; G* M  o
        travel to pickaisle.con(A_i)
! O3 H4 ~! a9 h( ?+ z' k# t( s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& D, s* [4 x- J& i# w5 G7 q
        else wait for 10 sec; e7 N: {+ S( A/ o+ ~: P$ v
        if A_i=A_leave then send to die9 n! j9 D% M* W5 w& o7 y
        else inc A_i by 1
/ P+ l4 y7 `2 @$ v: p    end6 Y/ n3 a; N0 }; P
end$ X- [7 t& f! J. V6 |0 W+ t( M: ?
9 j- d$ [1 X! s8 C% J+ P
begin P_pick3 arriving
9 [& n4 \0 T, m" n    set A_i to 21! o/ ?: p5 W# I6 c
    move into Q_induct3! d2 p& L. \+ H/ t3 F0 [
    move into pickaisle.induct3
! Y# ~7 c2 @1 c    while A_i<=30 do begin3 G4 Z/ s- h9 E0 b4 I& Q, k
        travel to pickaisle.con(A_i)
0 z+ u/ q! u: l/ l$ q7 h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: p7 i1 B) D/ Q( T7 D, J
        else wait for 10 sec  Z8 w: i* L$ ^
        if A_i=A_leave then send to die
$ J8 V: }9 c$ T$ G1 V2 E        else inc A_i by 1
9 T, ^% g6 [% n& F( @    end
* P! y+ |6 x! `. U7 dend

最佳答案

查看完整内容

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是个什么东东?
8 I1 \9 x9 z/ d/ ]. d6 c5 smove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 G  o: V# e( X9 C0 Q/ g8 N9 T/ S% X& _5 E% Y# e, n7 I+ H. m6 F
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。6 y  _7 a3 H( ]$ v# F0 y

/ c4 M, W- c- @& l4 q/ ]另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:; b  i; o$ i" i( @( D/ t4 j
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 K0 Y' z  e" j. C/ b( X( x
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 @( G. o5 U4 m0 s7 W- \$ F: S4 Z& K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; `9 M( Y5 n0 h  a! x
begin P_induction arriving
4 t. f4 {. o7 |. h% \6 e4 ^    clone 1 load to P_pick(A_induct)$ c5 i" K. G: q; K0 G# R6 I
end最大的系
' a: N/ S' c  q- m$ P9 }
& G1 I$ X* u6 Ybegin P_pick arriving3 D) N6 ?; U4 E. r
    set A_i to procindex * 10 + 1& R  q) S7 U  p# b6 ]
    move into Q_induct(procindex)0 z/ k( o, h0 l" y- B
    move into pickaisle.induct(procindex)
6 W* B( ^0 ?1 L" g( K) `    /*check the type of pickaisle.induct(i), for your last problem.*/
, `6 o& J7 u! ?6 s3 h0 w$ l
! k' i( c. k' ^1 }$ B% g7 j4 C: Z    while A_i<=30 do begin" |* @& r: M5 s5 m- i3 k
        travel to pickaisle.con(A_i)4 U; `, `, e. R/ M% F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 q7 [* I  H  n& z# U, i4 M$ ~+ {        else wait for 10 sec+ g3 N6 y3 Y0 r+ ~: L4 F4 {$ U
        if A_i=A_leave then send to die
: Q" i0 d1 q' H7 t        else inc A_i by 1) M' t; S. G1 ^8 O; V2 }3 y; C
    end
( @4 S' S+ k) S5 aend
( z/ R0 {) a8 v3 h5 t( k3 l
" |  V; c# ~7 B1 O2 c& F其中的procindex为整形,代表当前process的序号。0 m) H0 C, I- d  F- N
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-21 12:52 , Processed in 0.017959 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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