设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14502|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, a! ?$ ]) Z( `) l) }0 A: ^( U4 h5 t- B
我的问题是,在每个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中的数值,不知道会不会有什么不妥。0 s2 S8 }# C  w" G( J% n0 L1 w* m0 g

: ]3 P7 j* F+ |/ a+ h  }0 b+ d8 Abegin P_read arriving) _0 y0 n9 S1 y( }' ?- s. s
    while 1=1 do begin* |) w' }+ p8 F7 n# e
        read A_tote from "data.txt" with delimiter "\n"' c+ l" C3 V! F/ |
        read A_time from "data.txt" with delimiter "\n"$ S* ^# z2 f# i( i( U
        read A_leave from "data.txt" with delimiter "\n") z& O! @6 K2 t5 K4 J1 z
        read A_picks from "data.txt" with delimiter "\n"; V5 q+ c: }! i9 T% @# _
        set load type to A_tote
5 c" Y) @2 S& ?* J/ a0 F4 S        if A_tote="tote 1" then set A_induct to 1- S+ x' B" D. j2 @& U4 R; `- H) R
        else if A_tote="tote 2" then set A_induct to 25 O7 i, u/ E$ k0 `
            else set A_induct to 3   
: n, c9 t# [- Q3 W/ w8 E1 O        set A_i to 0
. i: t& P/ I" m  m! H: y0 L& V        clone 1 load to P_induction9 Y( ]& k6 m# d. c0 O* ]  N
        wait for A_time sec
0 C% [2 n* T( q7 z) l" m5 D- o    end
* g4 s8 B7 }# z/ B8 cend
3 B3 N" l7 A  p4 {$ y8 B8 m" ]3 @" O. U7 ~! s' R
begin P_induction arriving8 q0 P# h0 D7 Q- _
    if A_induct=1 then clone 1 load to P_pick1. ^% j9 Z" M7 W" o1 g
    else if A_induct=2 then clone 1 load to P_pick2
: \0 s! n9 |" A        else clone 1 load to P_pick3
: f* J; B  }1 c* @0 z* \9 ~end
( |$ y  n, e0 a( T! d
' q7 R  f2 R0 Ubegin P_pick1 arriving' _/ h2 m' n! ~/ w+ l  W& S
    set A_i to 1
" x. l# }' T4 q% y6 ^, c    move into Q_induct15 g- C) k& c( u% o
    move into pickaisle.induct1$ V! }4 Q7 D# C( p$ u; i3 j) ^1 {
    while A_i<=30 do begin0 q% a% Y/ l* ~, Z% d7 M" s7 M
        travel to pickaisle.con(A_i)
4 \  H: O% h: c) x% l" g* b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: |/ R) `7 p' G: ^/ D
        else wait for 10 sec( @& i4 i5 Q2 d; ~+ J3 }
        if A_i=A_leave then send to die
' U+ k! `1 C8 o% Z        else inc A_i by 15 f7 l7 T$ J7 L1 r
    end0 y' a, w  [- K
end
4 b. O& n  q, s  `- C3 v- @3 p2 P
% v" v6 a3 K! x' W) X( B, A5 Lbegin P_pick2 arriving/ F* q2 {- A( U8 ?4 }
    set A_i to 11
+ `6 e8 B/ V1 |    move into Q_induct2
$ j; @- G5 n& x% m    move into pickaisle.induct2
& L/ l3 c' L# ?! ]- @( H; D    while A_i<=30 do begin
$ S1 Y' z% ~+ R/ ^* B+ K3 m1 S+ W# j        travel to pickaisle.con(A_i), N4 C( K% ]1 ~$ d8 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 w9 O4 A; K2 m8 _+ w6 L
        else wait for 10 sec( J  v! ^; z0 L4 |4 t3 [
        if A_i=A_leave then send to die3 r4 N6 b" z4 F0 p+ v% Q% l
        else inc A_i by 1
. Q8 t3 @8 C$ z; t2 ~: _! y    end2 j% h8 w2 @& M, M. n' ^
end7 J# |  |$ u9 T9 u! w

# t6 k0 Q. [4 c% u. l& {begin P_pick3 arriving, d+ a7 X; [4 h! y" c- H6 Q9 L  f
    set A_i to 21/ \* X$ b% c$ w7 V
    move into Q_induct34 A* v9 v, Y) L' x! m9 J0 k+ u
    move into pickaisle.induct3
/ F; r: n; o) {4 Z, R    while A_i<=30 do begin' f2 c9 }$ b; W$ n4 o8 _; P
        travel to pickaisle.con(A_i)
5 M" R0 q: v( I2 M# w5 o2 x: S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 z! Y/ \( X+ |& m+ x; }
        else wait for 10 sec6 @- b3 ~$ g) x2 u- S' x, f
        if A_i=A_leave then send to die1 G( E; ]+ S- Y& c
        else inc A_i by 1, ?9 t# U% ?& ?2 s
    end
% l& d2 E# a' P( B6 ~6 s7 ~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 W+ ]6 [) f' U& A7 d
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  N  j: }/ Y/ `# x$ l
+ m5 w% X0 V5 X- wAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) P  ?# }0 M; w) i
2 Q  ]- ^# C5 B' g3 B( L/ g另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 @8 Z: U4 ~0 y3 r  }# a  P, k' j1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, }; x4 N3 H+ l% z1 u% c- D
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: X2 [) y' ^' N+ A' E8 s- a3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 @& l. x3 Z) P& e; u4 Qbegin P_induction arriving
* D/ \  r3 O/ F8 i6 @0 I    clone 1 load to P_pick(A_induct)
0 ?5 v! z8 o' X# l+ tend最大的系+ Z9 g3 ?! y- a' A! e4 U% J* ]

$ T& c2 x4 J# X* x+ B6 H; ebegin P_pick arriving
- f* f# Y8 v9 P, U    set A_i to procindex * 10 + 1
/ O/ Z* o6 c0 {  r. M    move into Q_induct(procindex)
/ ?/ m% @3 o: }, n5 m6 O1 I; `2 s    move into pickaisle.induct(procindex)3 ~1 W3 j: A! s5 L1 K
    /*check the type of pickaisle.induct(i), for your last problem.*/
3 Z2 S4 Z- ]+ n1 y& f
. K: j  w6 Q/ E  N1 O* q& N    while A_i<=30 do begin
# B  V6 m7 q9 Q! |7 W9 w        travel to pickaisle.con(A_i)6 \& ^$ g) X2 D' l& m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% _, ?7 ^4 \7 S: S( x4 A  P5 ?' O
        else wait for 10 sec, W. o6 w# {7 w% c
        if A_i=A_leave then send to die) M( v# Y% _/ \1 o  D4 @2 w% l% T
        else inc A_i by 1
8 \. w! P8 M9 [. Q' e6 X    end3 j, R. P1 F8 x  v* O; n9 O
end: }7 |9 U4 o) [- ?  Z& ]1 E8 \
7 }) i% }% Q9 l* P! e/ d, e' f, }
其中的procindex为整形,代表当前process的序号。) ]& Q* d* j; Q+ v3 }) z6 u% g
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-7-14 17:47 , Processed in 0.014774 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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