设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13956|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* u) \, N: Y5 _. r7 {/ a
3 I+ `( P$ e3 W( 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中的数值,不知道会不会有什么不妥。
$ J& v, v4 e! m9 b  a" `7 O$ T) A* T. |7 V) r
begin P_read arriving/ `3 y1 X$ `5 K" y! v0 Y
    while 1=1 do begin% P( a" ]4 V  }( G" {7 e
        read A_tote from "data.txt" with delimiter "\n"
/ ^! t  a' z  a        read A_time from "data.txt" with delimiter "\n"
: N$ H. D; _3 I4 j4 S/ b% e% p        read A_leave from "data.txt" with delimiter "\n"
/ J' u! m7 t# {: n$ p        read A_picks from "data.txt" with delimiter "\n"8 a# L' x' w5 ^
        set load type to A_tote( u8 Z; _% B; i% ?( n5 t+ F8 q
        if A_tote="tote 1" then set A_induct to 11 |1 r  S% G* o  ^/ \. i
        else if A_tote="tote 2" then set A_induct to 2
+ z* w6 b0 ~& [3 Z            else set A_induct to 3    ; M5 U. g" M' {
        set A_i to 0
! e6 E6 s9 h1 g5 o        clone 1 load to P_induction
; ~8 s3 z! B* k: t: m  N        wait for A_time sec
4 r; b: V! `# M% m- h4 a    end+ f) P& {: k6 N" s( `& d
end
3 x- M. a4 ^# \7 B/ i$ b- P1 e) Z" J5 T  I9 V
begin P_induction arriving
* y+ X7 ]7 G9 G4 ^5 {" a3 V* U    if A_induct=1 then clone 1 load to P_pick1
2 O0 Y& }6 O( c; q+ V    else if A_induct=2 then clone 1 load to P_pick2" [& X+ a& G, h2 A
        else clone 1 load to P_pick32 B$ o* D  l, V3 x
end
& L& M, x! E9 ^; I+ e, w$ E
4 E5 T% k* a1 p  ^begin P_pick1 arriving
  r8 P8 v7 u: F8 c    set A_i to 1# f0 W$ K1 a- ^% @7 c
    move into Q_induct1; H: h4 j& V3 l7 u( N  n0 h
    move into pickaisle.induct1- p6 T6 {) p( U1 `/ J
    while A_i<=30 do begin
# r5 S0 a) Z5 X2 H: ?        travel to pickaisle.con(A_i); l% _( g* c4 g( \2 w  I+ c7 Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 M/ [; m3 |1 p6 e3 H; V. t
        else wait for 10 sec# Z, _9 U1 b# C5 l$ O& \
        if A_i=A_leave then send to die& A* K& |0 e) {$ U2 |( Z' g
        else inc A_i by 1, |3 @2 H. S  f, [; k! `! R& e
    end/ J3 J# s8 F$ g: z
end
0 O3 {( {) C& P% J# p4 R' z2 |: {! t2 C3 ?: B
begin P_pick2 arriving4 L0 K* G& l0 O) U4 Z) K6 y
    set A_i to 11
% i3 K) J0 V' v# M! K    move into Q_induct2
6 ^3 c$ H" p0 _& x% M    move into pickaisle.induct2
; y" m7 ]& k% \( ^    while A_i<=30 do begin
1 Y% m, P( T) O        travel to pickaisle.con(A_i)
# c* z  Y" B0 A, c. I8 i4 w" \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( |+ D# L7 M, w        else wait for 10 sec( }  N6 N# L8 d$ L+ [- t) F+ M6 Q
        if A_i=A_leave then send to die
4 \1 o# P* m! s0 E: p; |" D9 O        else inc A_i by 1! N) P# _6 s# W; g
    end
5 j$ i! K3 y/ H  e1 i$ n, Nend
# x7 e) P1 h% @6 n# {  t% t! B$ v, J9 L# y1 [( L% @$ K
begin P_pick3 arriving
. e& t; S$ r3 q" e  N" [3 t    set A_i to 21
% m6 Z0 o$ r3 B  u  N    move into Q_induct33 z' u& A7 F7 E% w6 \( U
    move into pickaisle.induct3
# L8 L- {/ i8 L: u    while A_i<=30 do begin: ^6 _* U5 W" Q4 B/ L
        travel to pickaisle.con(A_i)
  ^( Z& U2 j/ d5 [# c: ]- Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ G+ m" Y; Z7 `6 p+ G' k        else wait for 10 sec" _$ h/ r2 Z- ~$ D! v
        if A_i=A_leave then send to die3 o$ u0 B% M8 x; J! i  p2 |6 K
        else inc A_i by 15 p; N. ?% y6 q- I1 q9 Z1 {" v
    end
+ i! J* K3 l& k1 s2 p& lend

最佳答案

查看完整内容

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是个什么东东?
0 |  @" H7 _1 Imove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 D3 ^4 S/ D5 S( q5 X; @8 w9 R0 d! d  M) V; Y- A
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
, v: @# j. k6 Y2 I  b  L5 w2 `2 d
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ t9 ?/ _. r( N& q1 o4 ?& U
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 Z! h6 `. N* e( _3 A( Y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ @: b2 r7 D! I7 @7 G( J; q# Z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 \. i8 j- a2 X. i5 {* q
begin P_induction arriving2 E7 R" `' J6 M% X
    clone 1 load to P_pick(A_induct)  C8 D! n2 K" C4 B7 `
end最大的系
  `8 [; `4 a7 i% v) Y; F8 d) ~1 v" r) F2 K( E& G" {3 Y' @
begin P_pick arriving
& i4 j  f/ u$ f. h2 j0 _! n& F0 o. z    set A_i to procindex * 10 + 15 B4 A6 x( `3 b; J
    move into Q_induct(procindex), S1 Z( j  f; ]; B+ _2 D
    move into pickaisle.induct(procindex), j! c! b6 R  i. W' E7 i/ f
    /*check the type of pickaisle.induct(i), for your last problem.*/8 z* C2 R' t5 J/ a

5 W) N. q9 L; s, d9 ?* }    while A_i<=30 do begin2 x% g: \7 c: p) t  r, \) W# g, I* g( _
        travel to pickaisle.con(A_i)/ R4 N3 H$ a5 Q( N- ]6 O  Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& P! L+ X% ?* e' ?
        else wait for 10 sec+ d4 i- Z1 }) i/ X: A9 U
        if A_i=A_leave then send to die3 l0 J! K4 r% L9 M0 B, t$ C
        else inc A_i by 12 w( ~7 R- H# |" l" X7 p
    end# J- k: _8 P2 J
end
- s/ L# o* o1 \, X% X
* a; w; {) v" }: ^其中的procindex为整形,代表当前process的序号。) g- |. ?5 d1 D3 a% K% A) ]
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-5-24 11:11 , Processed in 0.016743 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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