设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15241|回复: 2

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

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

; L% Y* _4 u# X9 K3 s2 A4 e& V我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 K( r& n2 W2 L  [
# x  _! O+ j5 m  R1 k
begin P_read arriving4 r9 k" U/ x1 d! J, X! U& r4 A
    while 1=1 do begin
' ]: V8 q& C* Z& G" M0 w6 I+ E        read A_tote from "data.txt" with delimiter "\n"' R) M2 C6 ~4 g5 k7 E- \8 \
        read A_time from "data.txt" with delimiter "\n"' w3 D2 G* c# y8 a# Z6 A
        read A_leave from "data.txt" with delimiter "\n"' s  h2 o/ g+ _3 c3 I4 s2 w
        read A_picks from "data.txt" with delimiter "\n"4 w" D3 Y8 U9 b; t
        set load type to A_tote
2 p4 v$ E9 X  `: L8 L7 O        if A_tote="tote 1" then set A_induct to 1: E# Y  Y: B* P* \
        else if A_tote="tote 2" then set A_induct to 26 _5 C4 h' d: f. U
            else set A_induct to 3    ) A* i6 e5 m3 \2 `
        set A_i to 0' t2 q) ?7 s6 r) b' L+ z
        clone 1 load to P_induction# ~( ?2 s- U; N! p9 H9 y
        wait for A_time sec/ y& \3 b: I- m6 ~7 n  J
    end0 z/ |$ D3 E) n, ^4 z! h
end
/ b: Z, c4 ^- Q
. V) b( n+ X. J$ `& G- pbegin P_induction arriving
" V( `, B8 O  R; _    if A_induct=1 then clone 1 load to P_pick1
9 ~. I$ ?3 V: ]    else if A_induct=2 then clone 1 load to P_pick2  w* p) y1 q5 k( x3 r' \
        else clone 1 load to P_pick3
4 M& P# G1 F4 a; w4 L  l" y5 S/ N" }end& {3 X5 a8 G" `- @: {5 C

/ A" S- z+ l/ q1 P% G7 A4 B! ?: h% lbegin P_pick1 arriving
0 G( W! Q1 m9 R    set A_i to 1" R  q9 w6 z, L/ _8 r; B9 y
    move into Q_induct1
! Z8 z. ~) {# K! Y    move into pickaisle.induct10 S$ I/ I( Q3 A, B, L
    while A_i<=30 do begin& c  T7 b( L1 k: b& H- _+ u
        travel to pickaisle.con(A_i)2 L1 @2 N/ ]6 N! m9 @! C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 E& ]7 c0 v) V8 C* ?
        else wait for 10 sec
) g4 z2 \/ I4 C; j        if A_i=A_leave then send to die
7 G4 c0 c8 o( f. t9 ^1 ]        else inc A_i by 1
/ o! e+ h2 Y6 C" J    end
: f5 L5 N3 P- [8 Z1 t6 a2 Rend4 ^0 O2 J: x; t, K( J. U# a
/ \* b' q. K  d. e2 R; s: x) N
begin P_pick2 arriving8 c+ q2 R( H0 K- V9 I
    set A_i to 11
: y3 x3 _: l: Q9 S    move into Q_induct2# I* W" }2 s! u3 _( K& N' p
    move into pickaisle.induct2* a8 C+ T7 f+ w* b
    while A_i<=30 do begin
# o" @& ?0 I0 |% b0 `3 x        travel to pickaisle.con(A_i)
+ P. Z5 i' E5 C' @! j, V; [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 F$ o; w# U/ e6 ]
        else wait for 10 sec
3 `; E* [1 l+ K4 T  q        if A_i=A_leave then send to die
4 s( w! s4 T: H5 t3 Y4 |        else inc A_i by 11 ~$ Q: [% C3 X  Z
    end
. e8 Z  w: v, c5 Tend! }* E1 I" a, l( v( \7 ^1 `; v
, y) [+ B6 ^: V; Y$ T
begin P_pick3 arriving9 A2 L. ?0 n2 l
    set A_i to 21
& c) s& O1 w* a8 T! _. N    move into Q_induct3
/ e( d2 F+ e7 f3 R' K, d    move into pickaisle.induct3* W% A1 r, n4 d. Q" e4 W0 T
    while A_i<=30 do begin) s; W, Z* }" A
        travel to pickaisle.con(A_i)
+ X5 m- A& M; P5 V$ i9 c2 g+ P/ v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 q* M5 u- z7 h( s4 ^) m        else wait for 10 sec* I( x. `: R' e$ l
        if A_i=A_leave then send to die
4 n% `- |, d. ~, u2 h/ {- Q' I        else inc A_i by 1
- k; q; d( F5 b    end
0 x* u- o( T2 U( n$ t' Aend

最佳答案

查看完整内容

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是个什么东东?9 C+ r3 Q' Z" O% }/ w" T6 N
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ y( w( J2 {$ v( L3 k6 ~4 W; U, [- q

1 s. k3 g4 m7 ~" I# jAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。, w' E7 s# T' V$ j

. p" \5 y! p: k  Q8 Y% x! I另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 q. s$ O7 u0 \
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" N" C' y( k/ C% k1 |  l% Z/ n+ v) @
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' f1 `# l8 l  {9 |' \3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, ?1 L9 ^$ N5 O$ H1 n9 ?begin P_induction arriving
8 p9 @; ]7 K$ s" Y. d+ F: s    clone 1 load to P_pick(A_induct)
2 A4 v% w5 I* @6 p; C) V: i' Vend最大的系
. j' p  a/ e) O0 a6 V+ Z" T
+ x: U; a& x9 x# |- g( mbegin P_pick arriving
* R8 }2 S0 J7 D, x+ j    set A_i to procindex * 10 + 1
/ [& Q( y) X% w  w% j" s* c4 E    move into Q_induct(procindex)$ @/ v! Z" C: O4 m1 j
    move into pickaisle.induct(procindex)
' J+ {; O" T0 M2 @" i9 x    /*check the type of pickaisle.induct(i), for your last problem.*/
- ^+ R$ ]1 |8 x- `' Q
, U( c  ^! F+ j  ~1 ~3 n    while A_i<=30 do begin
6 W9 P6 I6 [5 w+ h% q. G        travel to pickaisle.con(A_i)4 l! G, k" E5 @; \$ [) H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& n0 X. Y" n: |3 ~$ b6 Q        else wait for 10 sec
) S7 P7 l, Q: e; t        if A_i=A_leave then send to die
; \: D! d+ ?* a2 J, J, m& ]        else inc A_i by 1
' D7 n/ y# g% g/ b: _& Q    end
. _% A( t# x6 k. e6 o3 Nend
4 Q1 H3 L3 A# _, Q$ }; h& O( p; V
4 r* K( ]! _/ K" G  \其中的procindex为整形,代表当前process的序号。; d4 ^( G$ m; v
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-8-26 21:22 , Processed in 0.016796 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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