设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14967|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 m, [3 D4 ]) `9 M# k; Q/ U0 ^
/ |3 E$ `  b! U
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 p  P- |* c; E( s5 M0 I4 Z; D2 Y) B  I6 Y" c
begin P_read arriving
3 X' k+ |! v: y, M7 g; f    while 1=1 do begin
7 c" L0 k3 K# A7 O% d" B- Y- o! u        read A_tote from "data.txt" with delimiter "\n"
7 J2 W8 k1 Q4 g3 Q( d        read A_time from "data.txt" with delimiter "\n"3 f! Q8 \  l! [. g+ _+ q
        read A_leave from "data.txt" with delimiter "\n"
5 ~  v* j4 A0 U- ~# a5 Y* o        read A_picks from "data.txt" with delimiter "\n"; ^' e0 o. _' Z+ r
        set load type to A_tote2 u* x7 j: S4 U- t$ J" Y9 Z* r7 a
        if A_tote="tote 1" then set A_induct to 11 d" r6 _7 F/ \/ t# @8 |$ q/ Y# Y
        else if A_tote="tote 2" then set A_induct to 2
5 d' T- @4 Y/ v- G. }) ^) D            else set A_induct to 3    4 b8 J  L+ |( y
        set A_i to 05 r& o+ q$ F8 e. j. O
        clone 1 load to P_induction4 E! F+ M1 n# U
        wait for A_time sec6 ~8 n) H: p6 o$ x7 D
    end
+ U: b: p% b4 c" V8 eend# c; P, A& e  c! R- d3 |
' {/ m$ e; i4 i5 f" e
begin P_induction arriving
" H7 S! @. k3 @) p. w$ p    if A_induct=1 then clone 1 load to P_pick1$ ^: J: U6 b6 I3 h' Y  l
    else if A_induct=2 then clone 1 load to P_pick2) t- \' Q, H* l4 R
        else clone 1 load to P_pick3& s* \( H/ K' w1 f0 |
end
# R: y1 ]- t5 C) N
5 `$ y9 r6 U) ebegin P_pick1 arriving6 O+ e) |0 R1 K
    set A_i to 1
& N$ L+ V3 q& B- Y) b  t  E3 j    move into Q_induct1& X1 V( g* }1 F) @2 E6 z8 S
    move into pickaisle.induct1
+ ?7 B9 j* r% q5 d$ n! S    while A_i<=30 do begin+ o  V. B, ^- _$ f8 ?
        travel to pickaisle.con(A_i)3 e9 y0 T9 b& b5 D& V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: C2 \/ n' p; t/ f* w
        else wait for 10 sec& u3 _  L% l2 }: \2 h5 J
        if A_i=A_leave then send to die5 A! l: y2 a! ]" S1 }: P0 u
        else inc A_i by 1/ B% c5 I# X2 _2 g
    end% a+ g8 o1 |2 k9 E( j0 d- x
end
! J5 G  V2 {1 J+ N- Z3 Q9 h. w
6 T9 m2 b' ]6 X6 Jbegin P_pick2 arriving
/ \0 z- h& m1 A* c! P; G    set A_i to 115 A0 y& ^$ P  ~& i' F
    move into Q_induct2
9 D/ V; Z, i; R! v' I* t    move into pickaisle.induct2) v- v7 Z! ^" i9 \8 Q2 N) W
    while A_i<=30 do begin" b4 g3 i$ |; f  o6 k" |( `0 E
        travel to pickaisle.con(A_i)
# h% Y; W& c  o( T; Q  M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* `$ V8 S' h. t+ S        else wait for 10 sec' h! s$ Y) q( ?6 q3 M. n
        if A_i=A_leave then send to die. U% z7 l% F7 E8 y3 r
        else inc A_i by 17 i/ Q) m. x" o: n, x; u
    end1 q( U) F: |" d: s
end
! B, m+ w: ^& g* Q# G) W  ]
; h  Z8 b( m1 s. fbegin P_pick3 arriving5 ~$ `# Q& j* h
    set A_i to 21( [2 N" J. v! P; F- n/ C- c
    move into Q_induct3
& D& Z2 x9 {/ b9 L% X& K5 r    move into pickaisle.induct30 V; M3 T$ q: y; I
    while A_i<=30 do begin
# M  g$ Q6 Y/ i4 q; |- h        travel to pickaisle.con(A_i)
4 w" J$ [1 \* ^1 o3 x8 ?" t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  z7 M) R9 w' Z8 F# G
        else wait for 10 sec
0 O, q' K: p# \        if A_i=A_leave then send to die
9 a5 r- [+ n$ O: G$ b        else inc A_i by 1
( j" P/ U- @* z    end
# g3 ~8 ~, l" P0 L- ]9 M4 ^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是个什么东东?# t) k. A% \" S0 z, q' {& {
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, U8 J( O6 [; S$ ~* l6 K
) j4 h, x. W  G/ K+ _" A
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 }" A$ o( k, u! e  k

/ I( A* C2 E4 D! ]* [另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 ?4 o  J& }4 h. x7 E$ L0 a
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" V7 h. `4 z% q/ d( y+ Z' r
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' {4 l9 Q( E5 A& p* [0 z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' j9 I% J; S' v3 |. c0 ^begin P_induction arriving
8 g4 ]  F$ {  G' L+ y/ M9 J    clone 1 load to P_pick(A_induct)) C; K& q" w, \$ }' J' D
end最大的系
6 `+ X- b2 Y) i8 o" J: K4 D5 u: Y" a
3 t/ v5 L7 @- _6 f0 ibegin P_pick arriving
2 n4 x* L3 K4 \2 ?9 Y4 W% {0 x    set A_i to procindex * 10 + 1) h" b3 ]$ ?2 N8 I( A
    move into Q_induct(procindex)2 W0 b! \1 G& h
    move into pickaisle.induct(procindex)$ n; x5 z+ J+ J' d  }3 D
    /*check the type of pickaisle.induct(i), for your last problem.*/7 s! N7 N' t: `6 b6 Z: w8 ?# e

/ o9 V% ]. ?% a& @7 N" m) I6 j    while A_i<=30 do begin& Z8 A$ o3 i, T
        travel to pickaisle.con(A_i)9 R, \$ X* [4 r9 A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 L/ m* T/ x* ?6 k3 Z
        else wait for 10 sec9 w& a( G, \) s- k$ h3 ~  p% T
        if A_i=A_leave then send to die+ C# b* t. F( D: f$ F" p
        else inc A_i by 12 y1 ^& L3 E  k9 t( i
    end
: |- [2 G% n5 A  F4 h+ U+ F' `! \; W2 @end' b" t/ i% H; [  o+ M% A6 x( K, B

# C' r0 O  s5 F% }2 q& b9 w' [其中的procindex为整形,代表当前process的序号。
+ J3 _4 r, G# K( _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-1 19:01 , Processed in 0.014859 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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