设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13902|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ ]7 d2 \$ v6 d4 J: f! Y& _2 X, e* u+ O3 Q" P+ x6 `- B  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中的数值,不知道会不会有什么不妥。4 s$ r! O6 q) ]- M7 \: k: O
; |1 i" o( _4 Y% b
begin P_read arriving
. H8 m( U6 Z; e* w5 X    while 1=1 do begin
6 f( ]5 L+ F8 T8 T5 d3 Z6 t; c        read A_tote from "data.txt" with delimiter "\n"
0 R7 |, G/ o6 g% o. }( i        read A_time from "data.txt" with delimiter "\n"
; `/ V$ {, ?, w7 v        read A_leave from "data.txt" with delimiter "\n"' F9 n/ q& ]6 V8 y/ G: P
        read A_picks from "data.txt" with delimiter "\n"
0 n' z8 e: e. b* P: f! h        set load type to A_tote
9 I- ^" U; p  X" w        if A_tote="tote 1" then set A_induct to 12 h) B; h' M: }3 K6 V$ q& j
        else if A_tote="tote 2" then set A_induct to 2
) w6 R% H6 T' U            else set A_induct to 3    ( J/ }0 h8 m" F9 w  n% l+ ]
        set A_i to 05 _+ p7 O  x8 K
        clone 1 load to P_induction
/ H0 C5 O& b# y! c        wait for A_time sec0 _" G2 x9 C0 L) x4 v9 B
    end( K7 \+ B& J$ l& w
end, L$ u2 _" S3 ~1 H  M. f' g
3 I% V8 S# {" u! e* v; T% y/ Z
begin P_induction arriving
! k& V) V; ~. ]  B3 |    if A_induct=1 then clone 1 load to P_pick1
! _. M" `2 Q" G$ q4 y" C    else if A_induct=2 then clone 1 load to P_pick2
6 S- ?: W$ G! k* Q) L! L        else clone 1 load to P_pick3+ L2 l0 f5 _4 p, U
end9 z- U) U4 O, y% e

5 Q5 A7 u( a, ~# B0 c2 @# a" I* vbegin P_pick1 arriving% I* p. B/ C9 B
    set A_i to 1  U! v, y! Z  T& e- a# [
    move into Q_induct1& S% Q( j1 |5 {3 j
    move into pickaisle.induct1
1 \8 y3 A: Y" n5 w    while A_i<=30 do begin
) w- ]9 v! }/ x: t8 k" r$ M: X. c        travel to pickaisle.con(A_i)6 h9 T: f  L3 [( `  \/ n* @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ N3 i7 J2 a4 f5 U& n" N        else wait for 10 sec
* U2 L( m* J: a* g) {        if A_i=A_leave then send to die
+ K& N" p$ D) O7 |* \4 f+ c        else inc A_i by 1
3 \; r& f% {9 X! f- Y; f8 H    end% u, j! |8 u5 J; \9 L; G3 e  u( q1 c
end
" T7 x- o% t" W) |+ C+ u4 w) t( Q! R
begin P_pick2 arriving
2 Y! e$ q- }  n: E! n5 X6 x    set A_i to 115 I( |" l/ }- m+ b7 @
    move into Q_induct2
3 R8 H& K4 R, n* Q( e    move into pickaisle.induct2
* B% m% S$ f/ _    while A_i<=30 do begin
" ]# F/ n$ b" i8 N5 Y% G        travel to pickaisle.con(A_i), A9 Q( h+ n, T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! J6 R2 O- E* {! e; I        else wait for 10 sec
1 j9 w, n6 C# P& N! }7 L        if A_i=A_leave then send to die
& u" f& s: V6 U1 c3 s        else inc A_i by 1  U; H+ d, d: A) S3 J5 }
    end$ ^- ^% ~$ ]" K" b+ }- s% @) H
end
' h" M# K: o& U; Z- ?+ {. V- B2 s) m$ U! G: r" [: v
begin P_pick3 arriving0 a; D: d# z! D) a0 U. N
    set A_i to 21
& I+ f: ]$ K( U* ]0 \4 C5 W& r% _6 e    move into Q_induct33 y7 b) ]8 O) B: m  g
    move into pickaisle.induct36 b: ]% C& x9 s: N8 h8 O
    while A_i<=30 do begin
1 q# r4 {- i. b. u. ~* R        travel to pickaisle.con(A_i)/ g" n0 G. i$ a6 {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 ]7 T. F/ ]# U' j6 K) S
        else wait for 10 sec
( G- b: e- k# O# C        if A_i=A_leave then send to die0 n/ e! H' [3 K
        else inc A_i by 1
# N+ r% p  _2 n7 @    end2 y8 G/ A; ~2 O0 O$ a) Q* n( a
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是个什么东东?
! ^6 Z& o. {4 Q  g9 pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( X/ C6 o% p5 Z: W! x. w
3 W& X1 g( @4 }: Z. U1 s+ l, C  s
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* ?/ ^) J' ~; X* M

7 n! ~9 m  q( B: Z, k9 r8 J. L, {另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: M; s- u  u/ G. B& x1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. ^' ]& n  m& [' Z% D+ P! S$ R5 g
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
1 y9 x2 k( T7 f  B) ?# y$ Q9 q3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, |( L+ T3 D/ }, u( R; e
begin P_induction arriving
+ d; z/ ^: ~+ u) `0 L% ~0 y  J: I7 T    clone 1 load to P_pick(A_induct)
( Q$ I( D2 O0 m. u4 X" gend最大的系/ C5 U0 x3 c2 d4 b+ L: N8 \* B

& q, b5 Y; N/ ~5 Nbegin P_pick arriving
9 A: X  u/ h, w- K2 ~  f, y$ e- l    set A_i to procindex * 10 + 17 M  \3 U' t# e0 F0 L! u) J: K
    move into Q_induct(procindex)9 e% d. p7 ~& M' q  n: X5 Y
    move into pickaisle.induct(procindex)6 ~5 B0 X5 j5 Q7 K& d
    /*check the type of pickaisle.induct(i), for your last problem.*/
# K% ?" Z' u0 c& B" h& S5 g% i+ r
1 [7 c& H! V$ H2 h. Q    while A_i<=30 do begin* g# a3 S) ~7 A& h/ [
        travel to pickaisle.con(A_i)
/ A* }8 N1 Z/ t3 |% t- W0 H) s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 l3 W4 k7 w1 F0 u- Y        else wait for 10 sec
# [, {8 c( Q# {! p. B: U        if A_i=A_leave then send to die
. d- r( I$ G* T  Z; ?        else inc A_i by 1( ]/ O. [  V2 g$ p
    end" I) R8 ~/ y- r% k% Z
end0 A- }+ w9 O5 n- u* ^

! d8 b7 l' T+ \9 ]+ ~: C6 B其中的procindex为整形,代表当前process的序号。! P+ I3 c" A( O5 o
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-17 06:21 , Processed in 0.020955 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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