设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12785|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 s) c& n. T! ~/ _0 B8 L
5 V3 H: k/ Z7 C1 Q' w4 N我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 T; ]8 C3 q! A, D( q
5 t2 g- Y+ d- ~# f
begin P_read arriving& B. ]+ b1 w' S
    while 1=1 do begin
0 K# Y% F" g- G% L        read A_tote from "data.txt" with delimiter "\n"
* D- N& U% ]1 b9 E        read A_time from "data.txt" with delimiter "\n"
- w0 x; Z8 x$ q  V        read A_leave from "data.txt" with delimiter "\n"
" N% a( ~/ e9 B" R$ o' e, F        read A_picks from "data.txt" with delimiter "\n"
# `( u* V$ p# u2 }  Z, ~        set load type to A_tote
5 d, V8 p1 k- _        if A_tote="tote 1" then set A_induct to 1. f& J5 o/ ?2 O  `
        else if A_tote="tote 2" then set A_induct to 2  Q3 I& k6 D& t
            else set A_induct to 3    1 [1 F5 k% m8 a% C8 S* p' Z
        set A_i to 0
6 s$ ^' U6 q4 T3 v        clone 1 load to P_induction
/ e; v& t: J" m8 p) `. R6 V6 H9 b6 `        wait for A_time sec
) _& P1 \- b5 f: i$ h7 p    end5 h% E5 M  J) d& U9 L% ]0 Z
end
, l6 P, S# P3 }9 W- D
- n3 S( s: |" kbegin P_induction arriving
% n4 _' F8 @) I' F9 ?  r5 I' A3 J    if A_induct=1 then clone 1 load to P_pick1. ]& |; `( ]9 O( L5 b
    else if A_induct=2 then clone 1 load to P_pick2; S+ Q- y# R4 e( U, ^# d. |
        else clone 1 load to P_pick3
* q! H- c) b' L5 wend
0 R( l( n+ ~% g0 W: ]' q+ |  j7 R6 V7 G
begin P_pick1 arriving
" I* X3 ~& |2 e, v2 |* B6 U# X' \    set A_i to 16 {  t, p4 Q: e6 j2 r! m9 M
    move into Q_induct12 a4 I) c# r/ a" Q8 j, b
    move into pickaisle.induct1! s  b# i- c( T7 b" X
    while A_i<=30 do begin
0 h, |! ^* b5 S, d$ c# Y& y6 m        travel to pickaisle.con(A_i)
) m9 E  a" a7 P8 N$ D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 A* f' G& z0 ~        else wait for 10 sec4 V7 P: @+ [7 _' a( R5 U
        if A_i=A_leave then send to die
7 r" T* q* A% G  _        else inc A_i by 14 e) q' {4 o, M0 z
    end$ u  e  g: I& ~* j: `0 A
end
; l7 B5 ^2 C' ~% r! N9 M2 G
8 M1 D0 |9 p5 q& vbegin P_pick2 arriving
" k* H1 p; @" p3 a- D7 B    set A_i to 11
1 w" c4 P/ O% b/ r5 ~9 t, I4 _) s    move into Q_induct2
1 C5 H2 z0 @9 ^, ]    move into pickaisle.induct2
9 X& e& z# {$ M$ G0 X( i/ o! m    while A_i<=30 do begin5 d1 g+ a8 a+ \4 o- U
        travel to pickaisle.con(A_i); G% R9 P, C- C$ E* W- I6 Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! Y1 f5 c- X8 H        else wait for 10 sec
5 }( ~. Y4 i3 w) U; C        if A_i=A_leave then send to die2 B5 ^6 L( w% m! D
        else inc A_i by 1  p# f* }/ _# J
    end
& V" c* {& Q+ L; T$ l+ Z+ M# Cend
% T1 T& z0 I, R3 m1 [9 R5 ?9 D! C; _, D) B/ \, q$ I' u! U
begin P_pick3 arriving& f4 |/ c' O3 R; l
    set A_i to 215 |. P' e, X" w! U
    move into Q_induct39 B; V8 x4 l. r% @8 v2 a  c+ Q7 R
    move into pickaisle.induct3( K( q/ M2 x$ D' z
    while A_i<=30 do begin
8 `$ F6 J$ u1 v3 _        travel to pickaisle.con(A_i)
# A, Z% |* [6 X4 U4 S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# ]( C) x; r, R4 @% `) n        else wait for 10 sec
2 w9 u0 i. A1 E# q& M* l        if A_i=A_leave then send to die5 s. u% c; \6 r6 N% _
        else inc A_i by 1+ i, O, x) ~9 k# Q
    end
- n- _* x/ F) Send

最佳答案

查看完整内容

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是个什么东东?- x0 h1 l) M1 U3 `  y0 T/ `
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# d% r1 C# L/ _/ e6 z. s! J

1 O  z! d2 ^) RAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 T5 [( O/ N1 m* i/ ^- l% a  \0 I" ]& \
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% f' Y* c5 S, L! a+ j0 e* K- F- s; H
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ Z7 @8 J/ P7 t: x% L9 x+ u2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
; ]( }* D$ e' g0 @- L% @3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ s/ }0 N: q* pbegin P_induction arriving
) i. Z, g0 T& o    clone 1 load to P_pick(A_induct)" M$ n  m  z9 ]) }; ^
end最大的系! _( N% ]* ?: [
8 A- H( o6 h0 n% y
begin P_pick arriving6 G( F0 L6 ?6 ?5 Q# X
    set A_i to procindex * 10 + 1
, }1 `4 k! {7 b. h3 _! O    move into Q_induct(procindex)* v, p: f% ]/ E3 M) V4 j. J
    move into pickaisle.induct(procindex)
  U. ~; u9 t$ J    /*check the type of pickaisle.induct(i), for your last problem.*/, o7 D  i' D0 ]7 _" a/ C
& r) n) i! d) f" D
    while A_i<=30 do begin
' j4 P2 E6 ^' ]2 t        travel to pickaisle.con(A_i)* V8 U/ p' X9 z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; n5 g! N( ]7 ?        else wait for 10 sec" x* _, s/ I  J8 L1 g/ g4 i- Q$ v
        if A_i=A_leave then send to die/ A% `# }3 E7 x& q2 f
        else inc A_i by 1
1 `# b: Z* L6 O: G! }" S    end( y, W. x2 m( v( X
end. n( t1 }% Z1 s& f6 Z
4 G& \/ c) S. s: e% v
其中的procindex为整形,代表当前process的序号。
$ y4 K# I( [7 t0 K3 m& {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-20 18:31 , Processed in 0.014577 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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