设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14532|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% J# R* T" i, c4 {7 e9 C! \0 f" Y" \4 z0 F  k7 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中的数值,不知道会不会有什么不妥。. v$ S; }0 @. j+ v. ?4 ~( D

; ]8 M9 j9 y: D$ o0 B$ Dbegin P_read arriving: }9 J8 A8 {, C" w8 I' W
    while 1=1 do begin8 Q4 ~) ~3 _0 J! V2 x
        read A_tote from "data.txt" with delimiter "\n"# \0 m6 P6 f9 M5 ]8 p6 _! i
        read A_time from "data.txt" with delimiter "\n"
! }. ]- I* M  g& [+ h        read A_leave from "data.txt" with delimiter "\n"
$ s, z0 Q0 l9 |5 Y# P7 {9 {        read A_picks from "data.txt" with delimiter "\n"# [" e3 {, k% ]6 `. S% I$ `
        set load type to A_tote
+ i" m- ]+ j* w& z. Z        if A_tote="tote 1" then set A_induct to 1; }; U, C9 ?. m) r" T5 d
        else if A_tote="tote 2" then set A_induct to 26 `8 g0 e6 z" H7 d7 F4 z( `/ g
            else set A_induct to 3    # c+ _, O1 ?& x2 ]% \) {+ Y
        set A_i to 0
9 |0 Z+ G% e! }3 M8 G2 {' J* h        clone 1 load to P_induction
9 ]8 z5 N  ?& j8 _% Z" d7 _& m0 S        wait for A_time sec0 m  e7 G1 y; q4 m/ j6 p2 |
    end; ]; }+ ^! i, C9 n* B0 b$ p
end! P$ p$ b0 O$ S* {, s( M1 t( f

. Q$ B9 j9 V& i) Y7 ^8 Wbegin P_induction arriving& ]( E1 V8 y9 G' }. `
    if A_induct=1 then clone 1 load to P_pick1: \1 \& `# s/ V; K9 z5 ]$ E
    else if A_induct=2 then clone 1 load to P_pick2
  \2 h# M+ m7 q        else clone 1 load to P_pick39 P2 z9 J- y8 ~& C
end
$ A. _- e; d- \2 D7 h* V  P# Q% i; z. B" c6 ]# ?+ E4 [! z4 \
begin P_pick1 arriving+ d0 w+ H. u& D- P/ k: a
    set A_i to 10 S& P( G, y* l+ i
    move into Q_induct1
, P# R- C8 p) {$ C5 {/ W" z- n    move into pickaisle.induct14 S8 m9 q$ B8 A# ?+ D! S
    while A_i<=30 do begin( ~; q  I" K* w3 h2 p
        travel to pickaisle.con(A_i); |9 t- k8 S0 R6 F6 [" L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 B; P; _( A0 s( b5 F' ^        else wait for 10 sec& X1 t# b9 V: {; s3 V' G
        if A_i=A_leave then send to die
* M# Z6 [# W3 D  w        else inc A_i by 1) H* @& a% X) m9 @8 h+ {' |2 N
    end
; U9 D$ p, [6 ^$ J4 [9 S+ n0 u% [+ mend
. f4 i! ]$ g# a& w, {' B2 L& B4 r) |- g- d' {$ ~9 h/ s3 U' ]7 R
begin P_pick2 arriving
7 Z& Q7 k" S: U1 j" U2 g% f    set A_i to 11+ v7 a; R- ?6 _6 v- U4 v' h* P+ i
    move into Q_induct2: Y6 |8 d/ W: E0 F' R
    move into pickaisle.induct2
. t3 T$ N: ^) y    while A_i<=30 do begin
# \( {, B4 C+ H1 J        travel to pickaisle.con(A_i)! ?2 n9 I) F4 N' h4 J& N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 }* n" \& B9 ?( n% Z
        else wait for 10 sec' Z( A# v+ r& V' D- |; z
        if A_i=A_leave then send to die4 v& U2 \6 p- [: z) H
        else inc A_i by 13 U" i0 r/ X6 J2 h
    end
* i0 ^+ N4 s4 {0 rend" W4 h- {2 j6 P! i/ w
. D6 x% ~) z& R0 B
begin P_pick3 arriving9 g: v. r8 ~- k
    set A_i to 21
2 ]; _* g/ ?0 T. F, s; |, s$ l    move into Q_induct3
* C& |" {3 q% M8 r    move into pickaisle.induct30 Q/ @3 Q+ B  n
    while A_i<=30 do begin- {3 y5 |( b, S
        travel to pickaisle.con(A_i)
* {: X0 K$ T. d4 ]/ k* G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 _0 x- ]/ b7 a# C; b' K
        else wait for 10 sec7 h! v1 L  b4 C7 U8 X0 c& C
        if A_i=A_leave then send to die% R& R6 A2 E( w* P- e
        else inc A_i by 1
5 U5 x3 B$ O6 P3 R+ p* h    end! F* K+ X' t: @: w1 W3 w1 Q  M* V
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是个什么东东?5 h6 N8 o% |; M0 s! f, Q' f
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% \2 `) s6 v* F/ D) H1 j# x
% N3 i" ]/ ]0 M/ j; y0 w6 ?- F* k& w1 eAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% d0 K* D/ M- u" a: b5 I3 L

4 ]5 @0 P- `" ^7 m" V# N& H5 t另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 h  _0 f9 a! y6 c1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! u+ ]( g" ]! d- e; I& R- o
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. z  L' E& Z: K! n: G9 l0 k3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 d. R& }6 R' R) a$ x/ D
begin P_induction arriving
* l0 Z: {* b2 B% K    clone 1 load to P_pick(A_induct)& `* W; y: c/ @: a
end最大的系4 R& d/ A& N; W4 M; p7 c

5 k  C/ o& S/ ]" P8 h% g! bbegin P_pick arriving% K8 w6 z' O: t; @0 u( t
    set A_i to procindex * 10 + 13 B" M7 e2 X+ `+ N( |
    move into Q_induct(procindex)
  ]8 B+ p3 u2 h3 D8 w/ K, z    move into pickaisle.induct(procindex)/ t; {0 r0 M8 C5 t6 h2 q. V8 E
    /*check the type of pickaisle.induct(i), for your last problem.*/
# z  \, P: ?6 s$ Y' E3 [- x: Z/ p4 h6 E: v' z) W% n' W
    while A_i<=30 do begin
& X% D) x% l* b' c& \5 j& K3 `& m7 r        travel to pickaisle.con(A_i)* v% V9 A7 N/ B0 k2 [- C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 a! d4 H( K& g7 G8 }& Y! F4 `5 o        else wait for 10 sec
1 N* F, C( e$ K3 _3 Z        if A_i=A_leave then send to die/ [) ~2 g" ]7 C% e% F6 d! X! `
        else inc A_i by 1
8 @' P# N  m- t+ A& |. Z: a$ \    end: Z# b1 F5 _( g& x+ M' Z/ S; ?
end
5 w  q/ Y, n9 B: M0 o4 i  V
. S/ |5 ]  R/ I" I' q4 Q; b1 p& c其中的procindex为整形,代表当前process的序号。4 Y4 L$ w* }4 S# x
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-7-15 14:22 , Processed in 0.016018 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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