设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12589|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! T, k2 J9 S! y. v: l) f5 v+ H0 t* q8 f+ Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ M- a3 t2 w! W
. v: d6 f  c$ V( u; zbegin P_read arriving
' U, C1 t( _0 J, @2 w  P/ P    while 1=1 do begin
7 f# r8 A. A. }% c2 _4 R6 F2 B        read A_tote from "data.txt" with delimiter "\n". C) Q$ @) l0 G& u+ Y- l, j3 P+ O
        read A_time from "data.txt" with delimiter "\n"
1 D3 T7 f; o+ }% V4 \/ H+ v        read A_leave from "data.txt" with delimiter "\n"; I9 D3 |2 N+ R( n) x% `
        read A_picks from "data.txt" with delimiter "\n"- N' h1 ~9 @4 \4 f/ Z  B" @
        set load type to A_tote) j: t: j7 m* N6 X
        if A_tote="tote 1" then set A_induct to 1, C+ R) V  w/ k
        else if A_tote="tote 2" then set A_induct to 23 g4 H4 j$ b# J, Q; n, x
            else set A_induct to 3   
1 S8 G, E* J+ ]7 ]: s: z        set A_i to 0. I% l# s4 v3 x5 D
        clone 1 load to P_induction
3 `5 r$ |$ `2 w5 L5 g) S8 |8 Q( v        wait for A_time sec/ Y1 r; @# s0 e6 ^8 ]! x$ V% z
    end4 f# x% w5 C$ q2 P: f" @
end' C) C6 `* `6 I0 d" B/ a; x2 d
0 r. Y& C3 ~  K
begin P_induction arriving, r  A# y9 b: M7 W* O8 d
    if A_induct=1 then clone 1 load to P_pick10 Z" {& D2 X+ h+ O
    else if A_induct=2 then clone 1 load to P_pick2) w* _1 {- A# y
        else clone 1 load to P_pick3) Y  I& J% ~& D0 b, O- g; L
end
  b# f7 J+ X* `0 y" a
# Y  \( _% m6 e+ @0 R4 o, Jbegin P_pick1 arriving7 ]% c( v1 a5 ^' a
    set A_i to 1
$ R, g, G: c  c; R0 {- P. v8 G    move into Q_induct1: x9 [# o4 D* Q# g
    move into pickaisle.induct1
- m& l+ L0 j0 j6 j: k9 g/ M  G    while A_i<=30 do begin
6 ^  w1 b+ C) z5 h: T+ c        travel to pickaisle.con(A_i): y( Q9 [& ^/ W! }, Z$ W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 K) I' x1 {  s7 g6 U        else wait for 10 sec
8 H: E& i5 }1 j+ N# ~8 Y) E        if A_i=A_leave then send to die. q* u3 ^9 [. u3 _6 n: O8 U
        else inc A_i by 1
$ J% s: v; y3 s: {* F- U    end
: ~  y3 d; d1 u* @& e+ h  Cend/ M0 I& M# J/ L4 f

+ C" G  ^9 \* J$ Wbegin P_pick2 arriving
8 p9 K! R7 Z! n7 q: n8 P: K    set A_i to 11) \7 M- {& ^& X6 ]; `2 Y
    move into Q_induct2
2 E% l. [. E4 p% \+ F" u    move into pickaisle.induct2
  o# \- n2 b+ J, a  x    while A_i<=30 do begin6 M& k4 F" e# k: k$ D7 Z
        travel to pickaisle.con(A_i)
) r" ?; F8 u; V& `$ N! W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; N( ^; a1 `1 \! r* ?
        else wait for 10 sec. t  n- f- C& n: r% [. D+ `1 i
        if A_i=A_leave then send to die
8 c4 X9 ^. J; ]8 A8 c; C. l. _& {        else inc A_i by 1* i3 F1 p* e% v+ b+ ~
    end  ~; l0 v, K  H' V1 p
end
8 Q6 d6 ~1 M, N2 @$ u9 R) @
$ R1 }6 ^5 k, A/ u& Wbegin P_pick3 arriving# s) f; r# P$ R6 U2 _
    set A_i to 21) Z2 B; Q  X  D% ~% w, q
    move into Q_induct3
: p& n( W( U& B* K! r9 ?# V" t    move into pickaisle.induct3
( z9 R; k) Z, H% ?! c, M; b- Z/ [    while A_i<=30 do begin
3 t5 t: j9 e! p) R( b4 ~5 y        travel to pickaisle.con(A_i)) u2 S! @( j3 f* d6 O  ?* n, J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, u" R: r: i! t4 F/ n8 g, J4 H
        else wait for 10 sec. d% ?: g8 [! Q, M3 \: f; T
        if A_i=A_leave then send to die* C. M& `- |2 a0 w
        else inc A_i by 1
8 J" P" ~6 Q1 c- }' d+ z    end
  C, Z5 V7 D2 c9 Q( gend

最佳答案

查看完整内容

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是个什么东东?. i' Q) {( r' `
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. A1 [- Z$ f5 V: t) l9 S# V2 c2 m
. G8 E# b5 a. j6 d" _* v! c
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
, g4 J7 i; M/ R1 n5 F. u) b% U- V( n- e
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% d. R0 K5 g& z1 q/ w1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
7 f3 O% X' g- j3 F. C2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 G& w7 o" r1 l* b1 ^
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* w7 @+ V$ [% Sbegin P_induction arriving: b$ |3 `: l; c* C8 D# }& X% a
    clone 1 load to P_pick(A_induct)
% N$ c$ L6 O9 E+ F: P+ K% dend最大的系
5 E, V" |5 B3 y, q0 j$ {! r/ g
5 k& a4 o) X7 l6 Ubegin P_pick arriving' f# L5 G! D  y3 h/ c7 R
    set A_i to procindex * 10 + 15 v! r, h# Z( }. ]/ Z6 z) x
    move into Q_induct(procindex)# K3 r7 h2 D7 E# b- |% I' ~0 O% ]2 Y
    move into pickaisle.induct(procindex)( t' d" j( g+ X0 V) m7 e% L/ _, Q
    /*check the type of pickaisle.induct(i), for your last problem.*/7 r6 H9 N2 R% Z; @( L9 S

5 t& K4 Z* b* o2 R4 g% e    while A_i<=30 do begin" [& m2 E. m& U) }; \5 Y$ N& o
        travel to pickaisle.con(A_i)
: h7 w4 A" Q0 Q0 v, ]+ D6 l. t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ k' N/ i) g6 h/ O  F2 z        else wait for 10 sec5 u7 i" m. z( l+ k
        if A_i=A_leave then send to die6 Y5 s. b7 n( j2 c. k1 Y
        else inc A_i by 1) g' O! y$ S3 B/ L' v
    end
  O1 G4 N% ?5 \. J1 |, Rend
7 H  X# h) ?0 P6 ]6 a
3 Y" u# |, E3 @0 j' L其中的procindex为整形,代表当前process的序号。
8 S0 J! f* D* s' E. [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-2-2 23:26 , Processed in 0.019049 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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