设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14778|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" O' Q% ~& t8 F( g$ ^
2 X: }7 j  ~; Y* G9 g6 _/ 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中的数值,不知道会不会有什么不妥。, L( E) F% m1 r& T: K# y8 D& \

  G' X7 `9 s2 W* r# R" D% ~begin P_read arriving* A2 G# k2 O# w. Q8 J" \( {1 C5 }
    while 1=1 do begin
; I/ ], C) u) \' e2 U% p# H! k- [- a        read A_tote from "data.txt" with delimiter "\n"9 |( r! X# E" @7 d4 p; H- I! h: Z& U
        read A_time from "data.txt" with delimiter "\n"
2 o* ^: L- B5 R        read A_leave from "data.txt" with delimiter "\n"
2 d% O& ~1 j8 Q3 k& L! S  {        read A_picks from "data.txt" with delimiter "\n"
- E! c% v& `9 x* _        set load type to A_tote
4 I- |1 W; ]  R& v0 ^) |        if A_tote="tote 1" then set A_induct to 1+ [9 {0 v; t* U( f
        else if A_tote="tote 2" then set A_induct to 2$ ]+ x! a, e5 p4 a0 Y! U
            else set A_induct to 3    9 _" C0 f0 H3 \% T6 Y) j" Y
        set A_i to 0
0 H; ^; B% ?7 t  l        clone 1 load to P_induction$ J  R; Q9 B* v# G
        wait for A_time sec
$ o; [$ v& J: m7 B% O/ @& [    end
4 q, A8 R* \  U4 c# Cend
* i, v# R" R7 }! @4 V, d& W: \
begin P_induction arriving# m9 d  `; S# |" p- J4 o1 R) z
    if A_induct=1 then clone 1 load to P_pick1
/ r: }; J6 S3 }0 z    else if A_induct=2 then clone 1 load to P_pick2
5 u! h- g- B1 v4 ^1 V! P        else clone 1 load to P_pick3
" |- H+ j$ u+ iend
- u( I( L' K# ~0 \2 T2 h1 Z, N+ N1 A3 ^
begin P_pick1 arriving, z3 l- A2 N7 _, e# _# f8 x+ I
    set A_i to 1
# ^" X" k$ f/ C/ W+ W: d    move into Q_induct1
" U( |9 G$ y9 n' e$ q% W5 C    move into pickaisle.induct1  h4 ]# t: P1 |( B4 P
    while A_i<=30 do begin
; Z; x7 Q4 s: c' L  ?& y! O        travel to pickaisle.con(A_i). t9 k% A3 {6 ^# F+ |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# G+ G% l0 Q0 Y; \+ \) r        else wait for 10 sec' D& y! t! v* Q/ `1 i! U% A, x
        if A_i=A_leave then send to die
# |( W( J# K" B9 }  s: c4 l5 i        else inc A_i by 1
8 k  Q; B. `2 A    end
' c" w4 C0 _+ T6 Kend6 Z! j2 E, v! S6 r3 g! |

/ r; x. w: _5 m0 Sbegin P_pick2 arriving. O  {6 P' X! W7 [, v0 H  g
    set A_i to 11% E  R# A0 @5 j+ E
    move into Q_induct2
2 W1 K/ G! p6 `/ l/ ~; [    move into pickaisle.induct2
1 }1 C- G. x' F3 x3 S$ [    while A_i<=30 do begin  c# E# o" y4 q1 \
        travel to pickaisle.con(A_i)
. {8 k( D6 i0 k0 C( o3 @, I6 e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 @0 m/ C1 A) Q1 R        else wait for 10 sec
: D- z( R8 {, ^! A1 x0 r        if A_i=A_leave then send to die
, I, }2 @& \  w1 J0 N7 K1 v5 J        else inc A_i by 12 K% @# y$ f0 f2 K6 F9 T+ s' }
    end' \. S# \7 g0 U0 Y1 u
end- C2 O+ @, \$ D/ U: Z6 _

) e8 d+ Q& ]) s+ T! Z: |; fbegin P_pick3 arriving
7 f- i, h/ H% k3 Z$ s/ }    set A_i to 21- b3 U" ~# }# _$ r' X3 O
    move into Q_induct3
" o. q' f* l; Y: M    move into pickaisle.induct32 N/ {7 r. Z; E
    while A_i<=30 do begin
& h- ]  g/ l4 K) C; Z3 {! R" F        travel to pickaisle.con(A_i)
' B* k5 z  ^2 Y6 m' Y3 h; g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 J' |; A! B8 P3 I# z
        else wait for 10 sec
& D$ A1 ?  X9 D- [        if A_i=A_leave then send to die
6 `4 S' y+ R9 z0 m        else inc A_i by 1; R. B' V" `, j: [9 t
    end
9 Y! X! A- r4 v; Fend

最佳答案

查看完整内容

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是个什么东东?3 O0 o. g# z7 X' D; p0 F( Z* q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
2 f0 C' f& ]% ]) G3 _
6 D6 Q: K% y" a4 r* ~# L4 AAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* V6 D* p+ O- ~2 @8 S3 s) y

+ C2 W1 L- C2 v3 n2 T' l另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 u# K. h/ c) Y( M7 @& S
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! S) c% s; m# Y0 D6 X0 j2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- p* j8 B2 C( ~7 e8 s3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:# o, F, T: ?0 h+ N
begin P_induction arriving
" U6 U  Q  Y/ s4 v4 s: Q* g/ \0 s% I% M    clone 1 load to P_pick(A_induct)
! E: g/ h" r' pend最大的系
$ Y0 x4 X1 ~! u3 r: t5 ^
  j7 `$ b8 s+ ?6 n' cbegin P_pick arriving, \; ?9 p% X  s9 F
    set A_i to procindex * 10 + 18 h! C: ~  S$ c8 Y2 R+ O
    move into Q_induct(procindex)
' L0 d/ z" T, O    move into pickaisle.induct(procindex)
5 s+ y0 v( o4 E' A1 ?( _    /*check the type of pickaisle.induct(i), for your last problem.*/
, J! @4 D& O* ?) ^" H. Y! q% n( v) p) X0 j5 U" T
    while A_i<=30 do begin
0 q9 }$ X. s" H/ b        travel to pickaisle.con(A_i)% F* |' x) M& o" u. ?0 N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 S' a& q; }0 J/ B6 V7 B$ x
        else wait for 10 sec: F1 R% [# R" L- F5 D. l
        if A_i=A_leave then send to die  I0 g% S& }# p) O* g2 e
        else inc A_i by 1
- s' t8 w! j: _$ Z* o( l! K- k- W* T: }    end
6 R* f4 Y# h, a( Cend
/ N0 Y7 m0 l/ I6 D: B( h$ F  T, `! [" l9 O
其中的procindex为整形,代表当前process的序号。
. |; V0 f2 k2 N$ x8 O3 m& vstation和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-7-26 13:29 , Processed in 0.015344 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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