设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11940|回复: 2

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

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

: b0 ~8 V  E  v5 o: h% Y; Y$ M我的问题是,在每个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 D, D! J8 Y8 D7 m7 }1 U) \0 R5 Q

; I. E- G: L* }# g3 n+ M2 w; ?" Bbegin P_read arriving# ^, K9 z0 p8 X) a
    while 1=1 do begin
8 k3 y) g$ K7 u  H        read A_tote from "data.txt" with delimiter "\n"
3 p+ w$ x5 w+ }' O& b        read A_time from "data.txt" with delimiter "\n"8 T4 [* A2 j- W5 ]' h0 U
        read A_leave from "data.txt" with delimiter "\n"& T( r; s3 x0 g7 E$ Y  U- f( N
        read A_picks from "data.txt" with delimiter "\n"
# Z) S+ L2 h2 Q        set load type to A_tote
9 n/ b# f; k* s/ ^5 X, s: Y        if A_tote="tote 1" then set A_induct to 14 L4 D; ~; H/ J. s3 S5 m
        else if A_tote="tote 2" then set A_induct to 20 U) l0 b9 s, Y1 X9 G
            else set A_induct to 3   
' [2 V8 R( p; q1 w+ ~        set A_i to 0) A6 J4 F/ n0 }- g) A! g
        clone 1 load to P_induction+ Y8 x. R0 Y( |( ?) E
        wait for A_time sec7 p3 g: E6 |$ O3 u
    end
& ~# H7 i+ [5 l7 n5 kend
9 B! S) r$ ?$ \! m0 f
+ ]- r- t6 V& v0 ?# i! e! x5 t. i8 V5 ebegin P_induction arriving1 p: C. }  _' U
    if A_induct=1 then clone 1 load to P_pick1
) z% q- }0 o0 M    else if A_induct=2 then clone 1 load to P_pick2
: k8 b; }9 H+ J0 {! o' T        else clone 1 load to P_pick3
4 C( b+ `$ w# t9 oend2 x. `: }7 y: a+ K
9 F9 P9 i  C8 I% H5 i. P
begin P_pick1 arriving# p) {% d$ T! K7 q% [* }# p
    set A_i to 1
8 B$ I6 p1 q: W( `+ y$ u    move into Q_induct1$ N( W, i) ^7 _
    move into pickaisle.induct1
- u8 B  E, f' y- u, r    while A_i<=30 do begin7 k+ o" p( h8 k" x! e
        travel to pickaisle.con(A_i)% \4 b  r3 I! j! {" }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 p6 E/ T( _' G; f. Y  t        else wait for 10 sec! ]3 E7 I/ F$ N  Y% o/ d
        if A_i=A_leave then send to die2 S0 T, R8 T+ z" U) g+ l
        else inc A_i by 1
6 r, Z4 n. a, }' S( b" N. t. R    end
6 j$ R; i: [) l- E0 ~. |end! Y, c  p8 J! |& b' x/ x) g
& \8 J7 n$ I8 O
begin P_pick2 arriving
+ x  [# p" X* v/ s( R    set A_i to 11
7 y1 m7 c1 V# ^- O1 _7 B1 Z; Y    move into Q_induct2
/ I/ _3 ]  r- P0 @    move into pickaisle.induct23 N+ y  m# m3 x0 i, o
    while A_i<=30 do begin
- D& r# p; s$ ?# Q& |        travel to pickaisle.con(A_i)
+ \! z% r0 P& J* i% h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 T9 \! |, E, O7 C, e  K) J8 ^        else wait for 10 sec4 X7 i$ E& L) b, b
        if A_i=A_leave then send to die
: G5 l. Q; K7 r; g3 P) u        else inc A_i by 1, u2 q3 b; r: k* Q0 x% q4 [" H: A  c
    end
1 i7 G2 V- o1 V+ w  aend
8 H; B0 O6 ]8 v* T# R6 e/ {1 I1 z6 c1 B5 f
begin P_pick3 arriving
; ~7 \% d- g) X    set A_i to 21
' K1 w; ~3 t# ~, `; W3 a    move into Q_induct3, F# v+ V' b' P3 U) b$ ^. G
    move into pickaisle.induct3
+ Z: }4 d$ g4 Q8 J: U    while A_i<=30 do begin* L. B3 V8 S( P% ^) F
        travel to pickaisle.con(A_i)6 J1 y0 }/ s1 r7 k' b* R  m  H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& e+ f4 I% r( \- E        else wait for 10 sec
. _% w" G9 u& b( i3 C7 k        if A_i=A_leave then send to die5 r8 f' l3 V" `! D* e- Q
        else inc A_i by 1
; Y- B: [& b. V7 _* S; L    end
" k; E3 P3 L2 r$ D3 Yend

最佳答案

查看完整内容

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是个什么东东?5 D  g8 d8 {; z6 m: E7 [% ]0 s
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?0 H5 j2 x7 X$ {6 j1 k5 t

0 V/ G; c8 M; H1 j2 p; q4 Q9 NAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& ]2 A& H- E5 C( @9 v
' B* X' q$ D3 @$ p) o另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
& w0 S! Q; w+ G! X$ H9 L' J1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; |8 h3 a) |% L
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; V; k- E/ }: O9 V( s  [
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
% Z6 R+ o" ?4 H  g( e2 obegin P_induction arriving( r% V$ |* [7 y4 w
    clone 1 load to P_pick(A_induct)6 H, I/ E$ r, }9 }2 J
end最大的系
5 t" R. D( }! `9 n* ~' B
+ L$ i) V3 |+ B$ d1 X- |begin P_pick arriving
/ {" M: g) \4 l3 V8 M+ E    set A_i to procindex * 10 + 1) Z0 K1 l, [& B% z
    move into Q_induct(procindex)
9 m7 r: ~# f) t% O" k0 Y    move into pickaisle.induct(procindex)
4 n  `2 E/ F( m" v* ?    /*check the type of pickaisle.induct(i), for your last problem.*/
, p* T8 W+ B0 N7 V. ^8 W9 Z
- v9 R+ f7 j; y$ q! W    while A_i<=30 do begin
! e/ M  I9 U) l  N        travel to pickaisle.con(A_i); W5 j5 [5 a- \( p4 M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" |, b$ p9 e% A) P4 ~' m        else wait for 10 sec6 ~6 J' F" j; w6 T& a
        if A_i=A_leave then send to die# o: F+ q. v$ a1 R+ l0 {
        else inc A_i by 1
9 S$ O' O4 j- Z1 E+ p" N" k    end5 \3 V& w% r0 A: p- j
end- r# s: u6 _4 |% F5 x% U2 U; D
. A& j2 L6 c$ q& d' w
其中的procindex为整形,代表当前process的序号。4 |7 ~0 T1 L2 p0 T; c& q
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-16 20:08 , Processed in 0.015098 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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