设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12560|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ p) x' ~( B3 W. A! ^$ _4 E$ D$ E
) J1 @6 J" ~# T# ?
我的问题是,在每个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 k% ^1 p6 q! r/ S% \. K2 J% i' s, z# Q! K1 n, f. S3 T* ?2 x
begin P_read arriving0 z7 P* C! O/ u( N& @9 N7 T- T
    while 1=1 do begin
7 \6 G. e2 ]1 S" t) r4 S( N6 f5 m        read A_tote from "data.txt" with delimiter "\n"; e* g' n8 g' ?; K
        read A_time from "data.txt" with delimiter "\n"4 M& n. Z) ]3 E# W6 ^
        read A_leave from "data.txt" with delimiter "\n": c( @# }' \% A  o
        read A_picks from "data.txt" with delimiter "\n"# s6 U0 ?1 @1 T: F* f! W% h; X& e
        set load type to A_tote, y9 S) k% g7 |) w
        if A_tote="tote 1" then set A_induct to 1. h7 M+ Q3 H7 h0 \5 v" V. z9 _
        else if A_tote="tote 2" then set A_induct to 2  Z7 _1 F& k- T7 K( w
            else set A_induct to 3   
1 r5 q4 M6 O  [  q        set A_i to 0
9 ~5 H9 H. A( O8 b        clone 1 load to P_induction3 A: F$ ?3 Z' }; r& a+ d' u5 S
        wait for A_time sec2 d7 U4 u9 Z! m8 c: G
    end
. r6 X. U; J# a' N8 Lend
: ^4 B+ ~: e! ]# R8 Z# n. d  K4 w7 V6 D* G
begin P_induction arriving' \# Z  N$ {" f6 f7 {5 j2 w& i% Q
    if A_induct=1 then clone 1 load to P_pick1) m" E0 i7 P* A, @3 n" b( b
    else if A_induct=2 then clone 1 load to P_pick29 o% b& k1 x' w7 T) Y3 g
        else clone 1 load to P_pick3
! v4 K; [( N( w! Iend$ N- v7 D( `; V6 E

, Q/ I8 V6 \3 V! p5 z: D2 [' f1 Qbegin P_pick1 arriving
9 P0 n. d3 m3 ^7 L  v' ^    set A_i to 1
+ t" B. l, T" ^3 g' F    move into Q_induct1
$ P4 F6 l+ f" O, E2 X    move into pickaisle.induct11 i8 W$ c5 K3 E0 S  J7 c
    while A_i<=30 do begin2 A5 R4 X: r, y  c2 \% m, d* a+ I
        travel to pickaisle.con(A_i)3 T  v! x+ ?% i1 ~* T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 J7 P) M" }- Y% i6 ]
        else wait for 10 sec
! q. m* p8 J9 O        if A_i=A_leave then send to die2 j% ?3 e" Z/ V9 _2 }0 J
        else inc A_i by 1
5 Z& u- T' E6 _6 S6 ~4 J. Q    end
+ l1 Q1 c& S$ E2 Hend
0 a2 R. n9 @. l" ]( f+ E* [) F
2 }  L6 L$ f0 X5 \! {begin P_pick2 arriving( h7 a2 ]$ N( _2 b& \; O
    set A_i to 11
& y+ I) a, r2 l  v    move into Q_induct2* a( M$ m; [8 A( j0 K* }* N+ T& O
    move into pickaisle.induct2* N; [% a! @+ v: E
    while A_i<=30 do begin
0 a# W2 d$ f! [. p        travel to pickaisle.con(A_i)1 D* @8 L" F# B0 E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  E' |- [" F2 n; X
        else wait for 10 sec
7 C! d4 v& Z+ K, P/ U  w        if A_i=A_leave then send to die* U5 ]" v, v2 Y! t# A6 j% D
        else inc A_i by 1
5 ]( m, `0 [/ b% T8 L; i    end6 U8 N# M' {6 ^! s8 @# E+ G
end6 u5 F% t4 `9 K( ]6 A  @, N

4 v* I6 p" B' t8 Ubegin P_pick3 arriving) T; {" s2 W0 u/ C
    set A_i to 219 h; }: s0 g, [) }
    move into Q_induct3
3 g4 V9 G: W  N" l' ^' i! b! g    move into pickaisle.induct3* F! d! U) h  Z: K: Q$ B, B% H4 H9 }
    while A_i<=30 do begin: O4 @7 `8 g/ l  p
        travel to pickaisle.con(A_i)
& Q3 y+ V" O0 M) r& y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, X0 F8 g* ^& Z- i+ V  T        else wait for 10 sec9 y; w: S2 C& ?
        if A_i=A_leave then send to die
7 {' {! Y) U+ A5 @* R6 J        else inc A_i by 1
. p" i9 A8 v% ^8 J; C2 `    end; u3 u2 K; P3 F, ~% Z
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是个什么东东?# K8 F0 N" {& ^* t! w
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
2 {( [! d; q' X9 N
( t6 i  D3 {, T( w8 wAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 y1 ?' J: L* l6 j2 N) N1 v1 g7 M. R1 u+ ?
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ K7 S% H8 B8 e% ]1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
7 C2 T3 R' W+ \& c7 v- S+ z6 u2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: ]3 e$ t  y/ T2 ^4 o& }( v* E3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
0 l6 [/ `# {# n- f3 C5 Bbegin P_induction arriving
7 T7 C6 `6 [( j) u    clone 1 load to P_pick(A_induct)
2 r$ F: S, R/ [! C. o; B8 G, V, bend最大的系
0 n) t+ x1 r# ~& [# j
; \2 P! v  L/ ~' xbegin P_pick arriving
, z; U% L3 D3 |- O1 r  s9 H$ T! t- ]    set A_i to procindex * 10 + 1
* Y6 f& ?3 C! w8 \4 C; n    move into Q_induct(procindex)- J+ ^& A. X8 D& Q: p0 w
    move into pickaisle.induct(procindex)
& x) I3 w9 x$ N, f$ c3 V3 M) z    /*check the type of pickaisle.induct(i), for your last problem.*/
& [5 q2 u1 C8 f; X8 q7 H
. d5 ~5 {5 v* V4 J    while A_i<=30 do begin/ |8 M+ d2 i4 L2 M) q2 z
        travel to pickaisle.con(A_i)
/ s7 e6 ^" e3 K8 C5 l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; x& ?* v4 ^' r) q  o" J
        else wait for 10 sec$ h& d. P. M* H
        if A_i=A_leave then send to die
) ^( u- c" _- S5 J        else inc A_i by 1
- X: @( f+ y0 b( ~) Y    end$ V7 @5 w) i, [. {) {8 M( Z) h" q
end4 f, O: p3 X, [# y

1 K3 r7 `: K1 k: k: }- p% l其中的procindex为整形,代表当前process的序号。
' f& @4 v  o7 Q6 c) v# I0 a; p7 ~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-1 04:54 , Processed in 0.014793 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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