设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11979|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 _2 p# @) W& Y* w
1 e  F8 |" D/ \- 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中的数值,不知道会不会有什么不妥。
/ Y" H2 l- H1 l: a( {7 w: s/ Q
$ X2 X7 H: f; e. k* P& Ybegin P_read arriving
( D( c% E: V  x    while 1=1 do begin6 l1 x5 v% p' p; x& N
        read A_tote from "data.txt" with delimiter "\n"" t3 f% v1 i: G! Q9 J6 f' l
        read A_time from "data.txt" with delimiter "\n"
; e2 E+ F1 D0 h  ]        read A_leave from "data.txt" with delimiter "\n"
( S7 R$ s1 s! y/ D        read A_picks from "data.txt" with delimiter "\n"
0 a7 J) v" M, J0 r, n        set load type to A_tote, Y. e8 A* g2 V; p: b
        if A_tote="tote 1" then set A_induct to 15 H' a4 X6 `. {- ]- T$ u
        else if A_tote="tote 2" then set A_induct to 28 e* P( [0 V. r: W3 A
            else set A_induct to 3    5 v; @) q' |& E2 |
        set A_i to 0
9 C- G; U* b$ ?8 A# z        clone 1 load to P_induction. S! ]2 x  T5 @* W% j( y/ x
        wait for A_time sec
: X: ?; O1 L* A5 u0 @  v    end
# D, o* A( S" o5 ?end
7 Y5 ]& g$ b- V; I+ y$ |8 o* t" b  F$ _( W; n* \: \
begin P_induction arriving
6 N2 H3 ^$ I- n: u$ h    if A_induct=1 then clone 1 load to P_pick1
: |) ~: g( t0 U3 _    else if A_induct=2 then clone 1 load to P_pick27 ^% U. W9 w" R' r" ^
        else clone 1 load to P_pick37 D& P+ m/ x: S* T$ S
end9 P1 H) g% L$ D# e5 w$ r. k
# S2 n- F( G5 p( {. o0 v
begin P_pick1 arriving& M5 ]* [! R' `: `9 M; ]" v
    set A_i to 1$ f5 x, o# T7 l/ C: h" K
    move into Q_induct1
1 ~1 Z6 F5 J8 L- n: B) l$ e7 W    move into pickaisle.induct17 M/ f+ J. x8 ~" S* s0 K/ p% s1 c  C4 J
    while A_i<=30 do begin; P7 Y  \/ b' {( Q- o! H6 S
        travel to pickaisle.con(A_i)
& b) _0 u6 I* z2 ~4 R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- W& r% Y8 s3 D; C
        else wait for 10 sec( {' \) _; m' r( h
        if A_i=A_leave then send to die& v! q, X# U* P- [$ V
        else inc A_i by 1
; P3 [3 l5 J( U/ k; w, C    end1 T+ d/ V5 c' T( |5 {
end
8 x, t9 `# t# W7 I, O1 i( l7 J/ p  @2 K
begin P_pick2 arriving
6 X9 ~9 ~( `5 m. ?: m* |9 i, z8 [5 {    set A_i to 11  m+ q: o4 P, V) p. y0 Z7 }0 _
    move into Q_induct2
3 z0 [5 `' G0 \6 G" D    move into pickaisle.induct2( @4 n8 _* x& R1 J2 y
    while A_i<=30 do begin
$ X0 E  A' t; S5 x8 o' L        travel to pickaisle.con(A_i)1 P' T7 {; n  S9 F# N- J" L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 g4 T0 p5 m( Y% i3 _$ t$ Y/ Y        else wait for 10 sec
; D- E: J% Y' U8 e7 p2 C        if A_i=A_leave then send to die* W4 S1 x, z# b4 {2 p
        else inc A_i by 1
* S- k& E& O: N3 H* a- u    end: ^4 b9 z' |7 w; h: y1 ^  K
end
4 W9 J$ C% {2 M$ R; f, D8 {% q% G9 {9 T! Z2 k' `$ h
begin P_pick3 arriving$ t9 q2 y# \# @6 z
    set A_i to 21
+ \& h9 S  m; Z" h' B6 w$ q    move into Q_induct3, D7 C% Q6 u6 t; g9 ]- [7 O# G5 ~
    move into pickaisle.induct3
9 `% Q" r$ \( ^; Z& }& Z; c    while A_i<=30 do begin7 ?, J! [! T' u4 E3 |, T
        travel to pickaisle.con(A_i)
9 v- y( H  c3 X: r: I1 I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 ?! }: O; o$ T# ]7 I
        else wait for 10 sec+ a5 m  `3 x6 b, U( }- c
        if A_i=A_leave then send to die1 `( X8 {, m7 k; s1 A
        else inc A_i by 1
' f& @# t! ~, D8 `    end
" X( X7 [, G* ]3 ~8 r) nend

最佳答案

查看完整内容

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是个什么东东?
7 Q" I. B, v7 ^move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, J% a- `2 C& s  C& f; ~& M# `
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。1 e& M) w1 C$ S

! _0 t- u0 f, A# u4 c另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% \8 F9 L  j4 S& A7 _1 {1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, k* O% D+ I: x* A6 o9 F
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 N+ R% _. e7 N. g0 A3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 N% Q+ \6 g6 y2 H/ i& G
begin P_induction arriving6 C7 i+ N& V3 c) s: e
    clone 1 load to P_pick(A_induct)7 v  [( H6 e/ Y( p  v
end最大的系$ i- I1 S' d- y/ Q, a' M
8 p7 |/ G, H( z5 |
begin P_pick arriving5 H% u' ]. ?' ]6 Z
    set A_i to procindex * 10 + 1
! }  ?" K' c  {: D2 n    move into Q_induct(procindex)
- p4 |1 U" g) |9 K3 M8 Y* n' ?( v    move into pickaisle.induct(procindex)
6 s! n' p4 e+ |  X- S9 M    /*check the type of pickaisle.induct(i), for your last problem.*/
& {% W& l1 E9 J: r
+ ~* t! M$ J! }! a# X6 s8 V    while A_i<=30 do begin3 N7 D; l: r* x* u# ~
        travel to pickaisle.con(A_i)
, B$ I2 _1 c# N( r7 u/ h. q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 J9 S8 K. D2 X8 D
        else wait for 10 sec
1 J0 v7 X/ `$ w& Q7 v8 p% C! p        if A_i=A_leave then send to die
% [  _  P' B- }0 ^        else inc A_i by 10 y& x" y' }) X, E! q9 ~
    end
5 P9 R" V1 R5 M3 Q% F9 @. s0 Hend
3 r. f9 Y+ N6 S% z4 v/ S8 [( p; }' {2 q( d
其中的procindex为整形,代表当前process的序号。
) n7 F: \! W7 L' s9 P! kstation和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-12-18 13:50 , Processed in 0.015848 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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