设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12669|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 E& y2 [! X; ]) R+ Y+ a

0 L; ^2 N9 h' H( U) e4 n$ 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中的数值,不知道会不会有什么不妥。4 \6 ^: _. `8 O

( _0 h5 B5 a4 K. F( obegin P_read arriving
& C0 \5 `- p% E/ l% @    while 1=1 do begin
( G; U6 J8 b( S        read A_tote from "data.txt" with delimiter "\n"; z3 r' A6 n5 s* B" E
        read A_time from "data.txt" with delimiter "\n"9 t* c6 j) ]0 ^) M2 |
        read A_leave from "data.txt" with delimiter "\n"
( x! W2 l$ C% _6 t  y! K        read A_picks from "data.txt" with delimiter "\n"
0 t9 R+ \" h( p" s  u2 [% y        set load type to A_tote
0 Z9 i0 Y, v( S        if A_tote="tote 1" then set A_induct to 10 u  g+ K+ w, K
        else if A_tote="tote 2" then set A_induct to 2  C/ m' I8 h( s/ D7 a
            else set A_induct to 3   
- ^; |: G$ i/ P& U! |0 L, D) Y' Q        set A_i to 0
$ n1 D; S6 A+ O3 B$ ?! S  N5 {        clone 1 load to P_induction# l% j4 N/ P4 ~4 I& r
        wait for A_time sec2 }7 c5 m9 ]% m$ h" k
    end3 d6 |& P" }/ X2 Z
end
. h4 V$ k, |! r  l9 u8 i6 D7 g7 X2 O3 a
begin P_induction arriving" l7 V; r. o' R
    if A_induct=1 then clone 1 load to P_pick17 U# w: H6 V; V5 S& ~# T: Q
    else if A_induct=2 then clone 1 load to P_pick2
$ K2 i; R. y# I# g        else clone 1 load to P_pick3
2 s; M# e1 C  Y: x0 E% Yend
5 Z9 p2 C2 _- v6 Z
& C: E, N1 n2 ?% q4 Dbegin P_pick1 arriving
% a; y# C; e. b+ L* c' ~    set A_i to 1
: b1 P5 z% c; a    move into Q_induct1% L( w$ b4 H* j1 Z) O# l' H
    move into pickaisle.induct1
# N& P7 z+ \. }8 u! _) x    while A_i<=30 do begin
0 j; @# u$ N7 A) c& `8 r! H( X        travel to pickaisle.con(A_i)
9 y' ?. D( w, h8 ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ E1 ~4 r1 k- C        else wait for 10 sec& F8 A( B' G) K& m& Z
        if A_i=A_leave then send to die; W3 J  u* F' r! h# M* a4 Q4 y, r
        else inc A_i by 1- P" C8 a3 w- _4 q# M! O$ R
    end  f2 Q' d5 K5 h
end
9 N7 ]7 w+ B6 Y/ `3 b' T# e  ]1 u" q
begin P_pick2 arriving
* e& n( i% W0 O, a- ?7 F+ x, I0 z    set A_i to 11
2 v+ d- K+ O& w/ B; }3 C5 N1 o6 t    move into Q_induct2
& T) c. l, P# ^# U  ]% i4 ~    move into pickaisle.induct2
5 s0 E$ `; I. N  ]4 j. m    while A_i<=30 do begin( g' |) K* m+ a' o, ^
        travel to pickaisle.con(A_i)6 v( M1 p1 A0 h6 _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! q( U1 L& M& C1 D) j* j& {
        else wait for 10 sec& a8 p8 @: x5 s5 \. j
        if A_i=A_leave then send to die# O: F. g  P1 A2 E
        else inc A_i by 1
* {) \& ~, c4 n! L    end
" Y1 w* B$ M3 q0 S5 P. S8 gend1 I* h" H3 d! J) g  f

# \( M6 L# g9 p( X1 ]4 w& [" B8 qbegin P_pick3 arriving
4 L% G' o; g7 @, M* ~    set A_i to 21& H  D2 P; g9 H! e) y
    move into Q_induct34 ]% O# Z9 ]% f
    move into pickaisle.induct3
1 T) K4 @5 |1 ]# _9 P) w1 q    while A_i<=30 do begin
4 W$ q: V; }8 `1 j% U        travel to pickaisle.con(A_i)
1 U: o8 k0 e  M1 S) T' H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 J0 \+ p( P1 T        else wait for 10 sec
: D4 `8 g- |9 U* q5 U1 X- e        if A_i=A_leave then send to die
& ^7 b7 b' L) }( B5 T  O! [        else inc A_i by 1
. C6 }* K: f2 O: }    end
/ V  ~( R. \. S$ Z3 C: U; mend

最佳答案

查看完整内容

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是个什么东东?# K( H- N* K, U/ d$ ~. V5 j, m. z6 \
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ g# m5 K2 z! p. y0 ?
5 @7 q/ O, M1 r0 T
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 J9 k8 A0 i* C" o
8 v2 L: P6 U) ^  W0 [) @# L另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 Z6 F. @# B  c& n$ u' d' z* N/ O6 h
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;6 U: k! f5 X; l- P, n
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;( d! O$ V' _) D  k  ^! F
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ L" _5 o0 |4 K5 p+ Tbegin P_induction arriving; A# |' P9 k# p$ ~! D+ R4 l
    clone 1 load to P_pick(A_induct)
, b9 C% E. h6 |% Yend最大的系
- {* p6 ?7 ]( N: ^
8 P$ C+ P$ c4 K0 v/ Ebegin P_pick arriving$ F  }7 S3 \4 ~% E& z* x
    set A_i to procindex * 10 + 11 K( g+ G0 t/ P, o" |1 y5 i  S( t( B8 ^
    move into Q_induct(procindex), d1 F. ~* U2 y2 N
    move into pickaisle.induct(procindex)
3 m! w- H" v( _3 R    /*check the type of pickaisle.induct(i), for your last problem.*/
8 }7 H3 r/ b) ]; S' Y+ ^% V1 B/ i" \; w5 a! L* e" ~$ j
    while A_i<=30 do begin
1 r0 H% G4 }1 L$ z9 C( m- E2 L        travel to pickaisle.con(A_i)
; B4 u/ }1 e* s8 x" E8 Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 ]' i# U+ ]) V& c$ U        else wait for 10 sec1 f, T# A# C" {
        if A_i=A_leave then send to die( }3 h: q( ^5 `8 U( a2 x* H( q
        else inc A_i by 1
# @# o$ {/ A2 T. b    end1 M0 i% f4 b6 Q4 y6 S+ x) |1 o
end& i$ w5 b* ?8 R+ D& z) h) t; P
3 c, E6 `9 _) a2 ~& C% ?  y# I
其中的procindex为整形,代表当前process的序号。3 W2 B3 V9 R  e9 u( P/ a; [
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-2-9 15:08 , Processed in 0.020481 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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