设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7795|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 U. J' d1 j; C

0 B+ T% z# d; ]  _/ ]我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 P5 Z! x7 a! R" z6 l' i0 A& q
3 ~5 n  b; G: _5 j& V; Fbegin P_read arriving
/ ?) J0 N- |1 }; W    while 1=1 do begin
" r3 c* U8 x+ w  u        read A_tote from "data.txt" with delimiter "\n"! Z- v* y% W. w
        read A_time from "data.txt" with delimiter "\n"8 ]! h, U0 _$ s  d$ @% c' i, j3 U
        read A_leave from "data.txt" with delimiter "\n"
2 r1 N: ]9 n1 @        read A_picks from "data.txt" with delimiter "\n"& `5 l. M" D2 o8 I
        set load type to A_tote
) P$ Y& M1 r* ~) u) O        if A_tote="tote 1" then set A_induct to 1
( {3 _5 b4 t9 V3 X9 y, B$ J        else if A_tote="tote 2" then set A_induct to 2
' p) l: j4 i& t2 V- ?            else set A_induct to 3    + [. D. W- |. ?( d
        set A_i to 02 W* Q; B2 d+ t$ A
        clone 1 load to P_induction
- B6 v0 s1 s! @. D$ V        wait for A_time sec! T" Y" Y3 v% n5 ]; H7 Y
    end0 N) W/ |% P+ q' g, m4 L
end
0 |: ^# C% o2 Q2 `4 j& O
0 P4 ?: h& p2 Ebegin P_induction arriving4 J) Q; d' x5 g* u2 F$ t( P
    if A_induct=1 then clone 1 load to P_pick13 {0 n8 o) {9 C
    else if A_induct=2 then clone 1 load to P_pick2% k1 c  _( _: `! f1 G
        else clone 1 load to P_pick3
! j7 c* h2 I4 u% u0 uend6 S8 b( i" ?4 \6 V! u
3 i) Y$ ~7 p3 p0 n4 m* W2 {9 b
begin P_pick1 arriving
! C! x5 O8 e: f    set A_i to 1
% ~# e1 ?+ v. i( R* u  Q    move into Q_induct16 L. Q  y" K; N
    move into pickaisle.induct1
" L( v6 I. w9 j/ l6 n    while A_i<=30 do begin
2 ?9 C, e  P) D" E1 F: m/ V1 \        travel to pickaisle.con(A_i)5 b6 R3 X  H# i& z% G) a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" d: i9 F8 c# ~, e4 S        else wait for 10 sec
! }; v, T* t- M1 G( c; ]3 i        if A_i=A_leave then send to die/ I2 x/ g7 C$ s! W0 c
        else inc A_i by 1, _* r* b+ i9 r' {" k( |# l
    end
9 Q! |( @( j: g3 t: t1 zend
' \" u* F9 p+ z5 z$ C5 U# |
( X' j* v) H* `: ebegin P_pick2 arriving6 W" @/ B; F; ?  }# C6 x& t
    set A_i to 11
& f' {  R0 p$ Q4 l& A. d    move into Q_induct2
2 M) a8 S+ b' I0 \, u$ Q0 K/ H    move into pickaisle.induct2/ M% O0 W- y6 h' g: }
    while A_i<=30 do begin% u4 x! U0 w0 H4 P# u% N6 T# d1 Z7 R
        travel to pickaisle.con(A_i)+ B; a5 q: V* i& E9 U7 F# X$ m1 L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 Y# C8 a6 \, Z  X8 r0 ?5 g
        else wait for 10 sec
3 ~6 s3 M, F& c4 j( y        if A_i=A_leave then send to die8 e5 T4 S" R3 y* S
        else inc A_i by 1* Y5 W% M7 W* y% G& k' k, |
    end7 J" ]: A$ b3 C2 f6 N
end
: N- N; y+ F& t( a
1 A2 `# k$ r; {+ r. n4 Ibegin P_pick3 arriving
3 r! W; z; ]/ j2 E2 i    set A_i to 21
- L$ I+ Z/ N  V/ w3 i" {    move into Q_induct3$ M  E# M8 A+ T9 k6 C
    move into pickaisle.induct3
, e+ L+ @' {5 I, Q6 u+ I    while A_i<=30 do begin
7 c& r+ c& k! u( y        travel to pickaisle.con(A_i)5 I* [$ ]9 ]/ y) S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( g+ e$ p, o$ k( f, k4 S! W
        else wait for 10 sec; M( A5 b) Q2 `
        if A_i=A_leave then send to die' Q( C) w- p# u; N! r3 u% K* @
        else inc A_i by 12 {( C$ ^  a* [4 _- t' C
    end9 d0 U; y* |: m! k7 R4 {
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是个什么东东?
# N4 {  x. \( \% f) k0 f! _move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 f' Q$ V9 B: q5 B9 I" l
6 d) A. x7 q# N1 R0 [* l
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 ~4 e! r7 b. H; `6 v( S7 l: b/ e0 p& B" r* R
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ d' \) q5 \! O$ n/ d$ r# P1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 ^2 j7 Z& U" r
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! l5 f+ v9 k6 z3 M3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 s1 W/ y4 J+ }8 B; X, e& n: ibegin P_induction arriving
7 i, r' V" `2 E9 Q    clone 1 load to P_pick(A_induct)0 W( @. {8 I# L6 m6 x
end最大的系
) U8 q/ a' {; k! A& S( K9 V; V" U! s
6 R% Z% S6 s% y- ]) U  @9 gbegin P_pick arriving
2 q! X+ ~" ~& S" T' {; m    set A_i to procindex * 10 + 1, |# t8 k1 Q8 ?" }
    move into Q_induct(procindex)
6 J* N/ o6 z. f7 v) i    move into pickaisle.induct(procindex), Y+ h  y! K  A# r. I
    /*check the type of pickaisle.induct(i), for your last problem.*/( q! h8 {; X2 g2 ]) {2 y

' W: n8 j1 j' H3 s5 a9 ~    while A_i<=30 do begin' ^7 A- i. y# j) Q) f
        travel to pickaisle.con(A_i)
8 m/ o) c7 p: ?: Q: Q# r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 G6 h  ^: r9 P1 g# K" Y3 S/ @4 m
        else wait for 10 sec( |( m$ x# p- c8 }- F( H; A& W8 w
        if A_i=A_leave then send to die
: E& K; Z% r2 F        else inc A_i by 1
: l, s0 E3 R5 B' y. E7 h2 W$ e    end
. D5 r1 {8 q/ ~! `& I. [end  z$ V  b- Q: P: u3 x" V8 Y

3 `7 I% x  \  x( H其中的procindex为整形,代表当前process的序号。
% a( C  V6 P& K1 q9 |# astation和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-2-2 01:06 , Processed in 0.013126 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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