设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14896|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 y1 a/ \, |* L! m" R( |9 I& g. g! c5 R+ V4 v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) s1 `. a" I# r' u  i5 b. k5 u( `9 `0 N5 D8 P: D7 x
begin P_read arriving
/ ~. i/ i1 j! M9 s' G    while 1=1 do begin
& l/ k1 w0 [' K) n' J' ^2 k! B$ N" G        read A_tote from "data.txt" with delimiter "\n"
! e! m) M" H8 m, I/ @& P4 C0 s        read A_time from "data.txt" with delimiter "\n"
, M4 I: S" S9 c8 F  U; L        read A_leave from "data.txt" with delimiter "\n"- u. G% X3 D8 w: f5 ?! p8 z
        read A_picks from "data.txt" with delimiter "\n"
3 @+ Y# L% S, m8 p* N1 o        set load type to A_tote# K8 p6 {5 p4 A  o5 ?2 a, z  v1 e2 i4 r
        if A_tote="tote 1" then set A_induct to 15 {7 T; y6 ]" ~5 y( o: J
        else if A_tote="tote 2" then set A_induct to 2: [8 T; L; q& V7 `. m
            else set A_induct to 3   
) u+ [6 b; q: T* M0 ]" m2 _4 g1 e        set A_i to 0
  ~3 l4 x. k# c( Z" Y" D  _: B        clone 1 load to P_induction
* L9 Z+ y9 \" [        wait for A_time sec
) H- ?$ F) s$ o    end# G. \  f1 J% J( _& q' e# j" E: L
end" W2 W$ s: W2 m7 L: c3 Y/ Z
6 i/ k. \5 T+ ~% e3 O
begin P_induction arriving
) {0 t+ |$ g/ V% [2 N" T3 E5 D+ \. g    if A_induct=1 then clone 1 load to P_pick1" b& q! |. X2 a! _
    else if A_induct=2 then clone 1 load to P_pick20 h5 l+ G3 J0 ?
        else clone 1 load to P_pick3
: o! c% M5 B5 |1 K  C# ^end! I0 o0 B* k* z  k5 H& M: S; B

4 _. U4 T- v9 V( m: zbegin P_pick1 arriving- b" y% B' c. k: ]% y
    set A_i to 1
1 ~  d7 R, I9 j# s    move into Q_induct1
+ o4 t8 N- ]. H/ t9 n% J0 h+ h& c    move into pickaisle.induct1
5 E. p/ p7 C% b& w4 ]    while A_i<=30 do begin: A% ?0 m, l, ?1 f
        travel to pickaisle.con(A_i)/ \/ _4 e9 a, {2 X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' h( v8 v, }# O) R        else wait for 10 sec
* j! N- g9 [& u- x# Y' ]8 \6 F        if A_i=A_leave then send to die* H9 N0 T* J  f% n; |8 q
        else inc A_i by 14 s+ R7 r9 C; j' y; t7 O
    end
4 t. _# \7 y* k( K$ _2 l+ ?end8 n2 d' e; L0 l

/ t$ q9 K1 y+ D3 S0 v( J6 ^+ G" cbegin P_pick2 arriving$ y1 u6 J8 V0 x8 ?2 I9 u; o
    set A_i to 11$ C4 x9 @6 y# u6 n% R8 j" m4 T. P
    move into Q_induct2' \" C5 a4 R5 r4 h  w0 q$ ]2 Y) V
    move into pickaisle.induct2# v# n; S3 ]2 Z! G7 l: q* J* f" ^
    while A_i<=30 do begin/ g" Q- ]3 Q3 Z; p+ R
        travel to pickaisle.con(A_i)  E) K' x! T% K# E! [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 K- z4 \+ x3 Z! j5 [
        else wait for 10 sec( D6 l# W  s8 u
        if A_i=A_leave then send to die3 e! W, ^  z  a' J- ?
        else inc A_i by 1* D1 b# H- R% ^2 S  \7 ]
    end  a, A$ s4 v* x4 _; o9 i  q
end$ |5 v# r% v+ M& O. b

& R3 |* Y. p) x2 F( Gbegin P_pick3 arriving
# |/ ?$ r! i% @% }    set A_i to 21
' }  Q7 k1 Q& n- Q    move into Q_induct3/ v; I6 i- I( [7 d4 ~* o
    move into pickaisle.induct3% @) o  g% P# O  L, c
    while A_i<=30 do begin
0 \" @# v) [4 v0 H/ v  ^        travel to pickaisle.con(A_i)
' H$ c0 `( O! L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! |2 p. p9 o- Z8 r% o: S* C
        else wait for 10 sec: h+ X# ]0 D# U" H- ]  T' P
        if A_i=A_leave then send to die
8 ~; w4 d3 j, n3 ?        else inc A_i by 1. ^  r- ^- z6 m& j! I
    end
+ o2 ~- o: @1 d% I: Hend

最佳答案

查看完整内容

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 ]- u; P; g, I* h4 B* t9 h
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' I9 K; A  r2 o) F
1 V7 Z  g" J& lAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 z0 v- Q6 F7 k& s
( p: a- D2 S0 D0 s/ n5 ~* |7 u$ W( c
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
6 o' D( H2 o' H9 O7 b! f& y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! t6 u$ C5 u8 q% L- U" {# J# Q( |2 q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 ]( A" y, i5 G6 J' {4 B, _1 M% D
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 K. a- G' h( [6 c. t# hbegin P_induction arriving
0 ^% G* ~/ M( s8 ]# c& {    clone 1 load to P_pick(A_induct)( P, J$ a9 L8 ~& l1 `
end最大的系7 n. t* d$ u, g! F( u8 n5 B5 y1 I1 n
* l* g( ?0 U2 s$ F6 R# W/ b/ b
begin P_pick arriving
4 V' P; X, `$ k7 h8 o  X6 W    set A_i to procindex * 10 + 1
! k" }. q0 [; Q; G$ `4 ]6 x7 {    move into Q_induct(procindex); n4 f' X! Z; y  l1 u; y
    move into pickaisle.induct(procindex)" F% [! v2 @' O6 M+ k+ }3 ]
    /*check the type of pickaisle.induct(i), for your last problem.*/
" H2 u$ J( R9 O- C) t/ b% D9 D, A: t
- {& p+ U, `; \6 z4 u    while A_i<=30 do begin4 i7 W, i: ]$ `* z* f$ ]) R4 Y0 ?
        travel to pickaisle.con(A_i)
3 y' T' K! L  u( n! }1 g  o) [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. z; \0 U& Y9 O( q
        else wait for 10 sec# ?6 s: w' _0 }) p, w  \
        if A_i=A_leave then send to die
  G. }# t+ X$ n. ^8 H/ \        else inc A_i by 1
' t8 k% `( Z4 {$ v8 g5 l; A; E    end' R$ w0 I4 C+ U1 M, v
end
/ u; \  I# j1 `& V. s6 `1 ^
& i2 V$ r- W5 Q* }其中的procindex为整形,代表当前process的序号。/ `6 S5 k' K$ ^1 h$ S# Q
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-30 05:50 , Processed in 0.013944 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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