设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11213|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 r6 L) z! t1 L5 G' F$ E- u6 _6 |% q5 P& \( H4 a8 k+ g6 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中的数值,不知道会不会有什么不妥。9 j" @5 D: F: O$ s7 |" @9 Q- g$ x  R/ t

+ @3 n( {( n7 w4 E9 ]( }; v0 Ybegin P_read arriving  z& d  C& f. P- |9 `& {
    while 1=1 do begin
1 R: N0 Q. H( U) [1 }' w        read A_tote from "data.txt" with delimiter "\n"
/ v, [  t; o1 i* H  T! C! i& t        read A_time from "data.txt" with delimiter "\n"
3 F2 ~2 }1 H5 ^9 E1 Q        read A_leave from "data.txt" with delimiter "\n"
+ _8 {( p6 G: f  ^        read A_picks from "data.txt" with delimiter "\n"
7 b! y( W; Q7 [( Q7 T5 }        set load type to A_tote
  C2 b2 K* D: t2 }, T        if A_tote="tote 1" then set A_induct to 1
- `, [5 w$ C, U* V4 F% g$ ~$ l+ K        else if A_tote="tote 2" then set A_induct to 2! u4 {, O* ]/ K9 l& U# t& _
            else set A_induct to 3    / a* T( |3 V, t3 {7 I0 T
        set A_i to 0
8 |% D3 C/ J. D" ]  q        clone 1 load to P_induction
( i; o; `# E' L! C% o  b2 E        wait for A_time sec5 N2 N1 M- R) ~2 T$ R, p# x% P
    end. F& `4 R- Z/ A7 s0 G
end
9 s, O2 B. Z; P7 b( P" \
* t) _6 n# y0 G4 }begin P_induction arriving
8 ^4 q- Q8 [+ Z0 l- a5 `- p) p    if A_induct=1 then clone 1 load to P_pick1
% z0 j8 d0 `' r3 \9 @! H    else if A_induct=2 then clone 1 load to P_pick2
. m4 q9 W; X! l0 n0 X8 h        else clone 1 load to P_pick3
1 ]- g: C+ v4 Z' N/ z" j6 R0 ~end
" {! d0 J6 S0 @( C+ d' J6 `/ l2 W( q) \6 v6 b- b" y! D1 G, n) U) w' ?
begin P_pick1 arriving+ h5 n5 {% N0 t0 l* x
    set A_i to 12 ^" X& Y+ K) V
    move into Q_induct1
- j6 L# O, U) q+ U" N+ u. j4 C    move into pickaisle.induct1
4 `% l3 K" `# L% u, K" f    while A_i<=30 do begin
: s$ m5 n) n2 i( f9 K# L3 R) p8 G        travel to pickaisle.con(A_i)
- y. \9 |) h9 I- g7 m* t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ [+ B: B  _6 V" \" y* j
        else wait for 10 sec, b8 V; O" T9 f# t% X5 o! n
        if A_i=A_leave then send to die
9 B, Y! N5 _9 s7 v/ z        else inc A_i by 1. J+ O3 H9 d! D5 g3 a' m
    end5 _& u# p# e6 ?8 o- |
end
3 v. l8 G$ |" a) ~$ j: L9 _
' O1 y' d: F+ R8 J! i$ T2 g9 P3 dbegin P_pick2 arriving
& R. k# z9 u6 W7 D( w* ]  q8 k    set A_i to 11% v( t/ h1 ^0 M+ r# ?3 c
    move into Q_induct2
  f8 X3 T5 v" @# V% O    move into pickaisle.induct2
/ }; n1 X3 k1 K7 z" b9 K; D9 t    while A_i<=30 do begin
# ]/ R& v; Q2 B        travel to pickaisle.con(A_i)  n: g) ]6 k$ Y0 x9 l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& w1 F9 U$ W# f5 I* J
        else wait for 10 sec4 y  Z& Q' R" a9 h9 E( e( r9 f; o
        if A_i=A_leave then send to die% ]# P( E! _# K! r8 x! t) ]
        else inc A_i by 1
$ o' X* [; z' X9 y6 T8 a( E4 z" h    end+ b( R/ F' {: d# |, ^* d  A- Y
end
# ~7 b1 ?- v, ?& o
' Q6 p5 Y* ^9 D7 k" y" H! Dbegin P_pick3 arriving5 P% h2 u: K; o0 \
    set A_i to 21: B& @5 q3 m% b+ d
    move into Q_induct3
+ K6 u3 T8 o/ o; K/ {5 u* F8 Y# i    move into pickaisle.induct3
( Y# l% @! k! o: I5 d    while A_i<=30 do begin
1 {' s2 _' s5 ~: d  M8 w7 `: z" E        travel to pickaisle.con(A_i)4 N$ ?# f& e+ e8 o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 }. i& C# ?/ o# i: d% J        else wait for 10 sec
) m* Z" Z- S( ?! b        if A_i=A_leave then send to die: S, ^1 R/ I6 l' k$ b5 t! C: |
        else inc A_i by 11 M# D" N8 T4 J8 |
    end
$ e+ B5 C0 ^% O' z- w/ iend

最佳答案

查看完整内容

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是个什么东东?
) ]( m" h0 i( Nmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 h$ _! U! Q  N
* K2 a& [6 z' s0 e( w3 i
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( ~; Y# n9 \/ x+ d/ {3 `# Y0 i- y
$ x  f3 z4 e# R3 B7 Q
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:; s5 f  b# s& \8 d5 _# s
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ G& F( i) `6 a; h% R
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 X9 t/ T8 D/ i  b! Z0 X" H; X. L3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; x: _  Y: j! O8 S
begin P_induction arriving1 i8 k7 {& ^# P5 C, q0 o
    clone 1 load to P_pick(A_induct)
* x5 F( }* ]7 h7 Z, m# {end最大的系1 a7 p2 @$ p: A1 z
! G; j+ M) u& S# T
begin P_pick arriving( ^8 a1 v3 @, Z0 J1 y) n
    set A_i to procindex * 10 + 1
! d7 B* [3 i3 G1 x/ |/ l. o0 ~    move into Q_induct(procindex)4 Y& i. F/ L/ F) S* u0 T
    move into pickaisle.induct(procindex)2 t* |+ Y9 j& N4 H* G2 U% ]9 t
    /*check the type of pickaisle.induct(i), for your last problem.*/
7 A5 e8 l! d# {6 U" t2 \; }2 p" x, M
    while A_i<=30 do begin# @. u  {6 h# I' `7 z& X5 X2 ?* F
        travel to pickaisle.con(A_i)
  z. i3 F) g2 r  ?2 M% l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 p2 f  [+ B6 N; M. O. {! A        else wait for 10 sec
, Z3 Y9 ]9 x0 U* F' A. y0 C        if A_i=A_leave then send to die$ o4 ^- D; q. C+ Y4 Q3 x
        else inc A_i by 1' P& e4 ]* E. u7 G( O6 ]9 ~
    end2 J* S- H6 C! J8 `; x: M
end
- M; u' P6 ^1 U# m4 ?7 f1 \' v
) ]' K2 d4 C6 V* G$ x2 N1 x; g( k其中的procindex为整形,代表当前process的序号。
- |! c  i6 @- f; O' m5 K5 o& 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, 2025-10-31 02:08 , Processed in 0.014054 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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