设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13749|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' v- D# v- f; Z: N/ ]. p1 f: G* q4 x
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, V/ P) t5 R! e3 j( \% q; z; j5 e3 D1 S. y
begin P_read arriving) o/ ?7 i6 n4 {2 A7 ~! F
    while 1=1 do begin6 |5 X( K* F6 q' S+ R9 v
        read A_tote from "data.txt" with delimiter "\n"
& `* {. a1 ]% y6 p4 y9 v( a        read A_time from "data.txt" with delimiter "\n"" y  r2 _5 j+ r. s, _5 C( G
        read A_leave from "data.txt" with delimiter "\n"
: `7 d% e; l2 _# \0 p        read A_picks from "data.txt" with delimiter "\n"
' P! ]: G4 i8 [5 b3 w, a! B- u        set load type to A_tote+ w! _" ]6 G+ }
        if A_tote="tote 1" then set A_induct to 1
5 |" F* t# H0 N: b& x4 Z" u: V        else if A_tote="tote 2" then set A_induct to 2
( e# C3 u, v  z+ D" S. h$ F4 |  w            else set A_induct to 3    : ?: u- X9 X5 I
        set A_i to 0; H+ M3 l6 q4 C& u6 Q
        clone 1 load to P_induction
2 a6 I- H$ A# Y2 D+ [        wait for A_time sec
2 \" i. U/ `9 |    end
9 ]8 Z& `3 t) J  i+ q' T" G% iend
/ K  g9 {5 J& h+ s4 q- |% q. n; C8 G9 Y* k' z' F1 c
begin P_induction arriving
% j5 F: b) O, b1 p! F    if A_induct=1 then clone 1 load to P_pick1: o4 {; [+ b" ?, d( E1 u. k% V4 g- n
    else if A_induct=2 then clone 1 load to P_pick2" \4 @/ r/ e2 _( ^! V
        else clone 1 load to P_pick3* v" M; ]# k$ g0 `  {
end
7 r/ ]& k/ C* ~# f/ V% j  B( ?9 R& T" b& v, o
begin P_pick1 arriving7 d. ?) e# v5 ^! M
    set A_i to 1
7 G# E+ M% U" |. P* A9 @$ r    move into Q_induct18 \% U. E4 D2 w& Z7 z) ]$ Z
    move into pickaisle.induct1. w# _* x( L' L- u5 L" K8 X( v7 h
    while A_i<=30 do begin. T: T. ~9 K* z* n- v2 S# a! G% k
        travel to pickaisle.con(A_i)
& L# B8 R7 |! }( U7 D6 G$ P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! K* v% c; p2 k' ?' c
        else wait for 10 sec0 C; P4 y& X! E, r) v; Y- M- ?2 W
        if A_i=A_leave then send to die( G  i4 b% Q; \  h3 |1 `
        else inc A_i by 1" j# w5 Q( l# v" k. w3 m4 Y
    end
7 e. y( ?0 k) e$ J- z3 uend
" g9 q' Y5 c, U6 E! y2 b
  u; l/ n+ ]7 d9 O4 d7 A) Tbegin P_pick2 arriving
- ]6 o% v: _; i  M" @    set A_i to 11
# q3 J: u/ V+ O! `& e    move into Q_induct2' i7 j4 s% w& M- g5 G) g, I4 U2 b# g
    move into pickaisle.induct2$ y0 T7 e( W* @' F( N: [
    while A_i<=30 do begin
! r1 x8 a; Z- t5 x) N" I3 F% t5 N        travel to pickaisle.con(A_i)& k: m8 R0 i2 a# C" h- k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. M  `  p9 t: s6 ]1 |9 m9 W        else wait for 10 sec
& a4 O1 B5 S9 v# y5 Z        if A_i=A_leave then send to die
6 \1 \$ ?4 T3 Z        else inc A_i by 1
3 F- U1 t! C* @" s' b9 S    end  r' _- P# K5 R" E1 G/ C
end7 _; W* D+ r3 M* q8 Y

  B0 Y8 v5 s* z4 ~* K1 D8 [begin P_pick3 arriving
8 S4 J3 e2 d7 B# V% \: r( D    set A_i to 21
  j8 u: M+ h0 s    move into Q_induct3
5 W( W+ Z4 c4 C7 o, U    move into pickaisle.induct3
* o. Z! _2 O  k! Y    while A_i<=30 do begin8 _7 k1 r  @6 f3 t
        travel to pickaisle.con(A_i)6 i* R" A& S; t+ t+ W  V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 b' p7 j* Y! \# z6 q/ v. h
        else wait for 10 sec% i  b2 N5 l( e( Z4 W
        if A_i=A_leave then send to die0 f5 w. Z/ i8 v, S, Y
        else inc A_i by 1' m# ^2 j1 K* H# q1 G
    end
9 q0 E! i$ ~% ^% \8 ]. ?$ [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是个什么东东?
9 G* J5 M! p" p  {1 T) Tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ p) Z) w0 O  V/ X9 ?

9 g0 E1 y' d$ b5 fAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* B5 J( p$ r; D2 l) Q
+ V, [5 e  o  p% F9 {另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" ]# b4 N8 h5 {& H: h1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 i% ]$ f/ [' q! I. E7 j$ [- g* F
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
2 }6 P/ i5 r9 p3 h. J1 e: C3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( k+ M$ y' @( P- z- b) Kbegin P_induction arriving- q: h$ g, e  u/ V! A- z
    clone 1 load to P_pick(A_induct)0 W- C' U3 C7 {4 o, a
end最大的系- z7 g5 W: C5 b2 U9 m" b$ W. F
, u: Q; N% X9 K* I8 }
begin P_pick arriving8 y5 ]' [0 Q( F( d
    set A_i to procindex * 10 + 1
7 y/ ~4 }) Q4 m+ ~  @( f% H    move into Q_induct(procindex)
9 Z; D$ f' V+ c; f7 V+ ?% q9 u    move into pickaisle.induct(procindex)
/ {" T. |/ h- W; e$ M8 n3 N2 F    /*check the type of pickaisle.induct(i), for your last problem.*/
3 Y) Z- L2 K- ^5 z, }
  X$ I3 }7 s2 n3 g/ Q    while A_i<=30 do begin$ y4 S* w- a. Z8 r+ l
        travel to pickaisle.con(A_i)
* h& I7 f% p# q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ s0 C' |+ `6 H: f4 E
        else wait for 10 sec
0 m) r3 ^: b4 y  Q        if A_i=A_leave then send to die
- o  g; }# J0 r+ W) C; [$ j; \1 ]        else inc A_i by 1
- C* x  A7 r7 h' _    end: K* \3 y- P" s$ F% i
end
/ w+ V/ ^; Z: b0 e% W+ b2 N# n( f* a  [/ o6 r
其中的procindex为整形,代表当前process的序号。+ `& s1 ?% [  j( T3 P1 ]' G1 |
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-5-2 20:38 , Processed in 0.017122 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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