设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11938|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. q4 f( T: J. R2 R% X$ p- c6 [' R  h8 Y7 A% `( @$ D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 l* ^5 ?; }( a# f6 q# U# F
& F9 q1 |' N7 g) pbegin P_read arriving9 g# @1 n, C5 z5 |
    while 1=1 do begin
/ ^* {7 {2 U5 q5 s) T, i8 ^6 t* ~9 t        read A_tote from "data.txt" with delimiter "\n". f) E; S% ]8 e
        read A_time from "data.txt" with delimiter "\n"' y0 b/ K3 @0 @: R# L  H; v
        read A_leave from "data.txt" with delimiter "\n"+ T' u) Q. ~6 \1 a  {
        read A_picks from "data.txt" with delimiter "\n"
2 h7 R6 n0 X- o        set load type to A_tote# L: o# {( b" ]4 m+ ?
        if A_tote="tote 1" then set A_induct to 1! Y- p7 B' G$ R/ ~
        else if A_tote="tote 2" then set A_induct to 2* i+ c) [+ J' c$ l( B$ @
            else set A_induct to 3   
# T; V+ k$ P, Y1 G        set A_i to 0
: a- R" R$ \  w8 Z        clone 1 load to P_induction
$ u) j( _5 I5 _" R        wait for A_time sec3 y' ]8 D0 K, t0 @& ]
    end
3 A/ n# ?8 y. P: n* Jend0 y7 Q2 E7 m& f/ m/ S5 }& L2 q

5 r3 t& ]: `8 ^; f' R" Ubegin P_induction arriving
  O4 {' M9 }. V& U7 j    if A_induct=1 then clone 1 load to P_pick1* _3 L( t) v. e
    else if A_induct=2 then clone 1 load to P_pick2
) ^, i. w' [- Y% r& D0 Z$ Q        else clone 1 load to P_pick35 ~9 J  r; v" j9 [( Y
end; a1 i1 l3 D; W0 }
  W3 ]6 k, {% s- d0 }5 T
begin P_pick1 arriving
$ ?8 s8 J4 m$ e7 R& ^  }7 }    set A_i to 1" u8 i  \* p- B  S2 |1 O3 }( h7 \
    move into Q_induct1/ f) I5 i3 L8 ^+ b9 F7 d8 z$ e
    move into pickaisle.induct1
" V+ X$ y" b/ O    while A_i<=30 do begin3 h, z7 I' Y0 [8 l9 v; a5 U# M
        travel to pickaisle.con(A_i)# S# \% h7 q7 w" N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 x$ K8 v7 M$ D7 Q* H! B7 l        else wait for 10 sec$ `6 T+ |0 e* W; }8 a
        if A_i=A_leave then send to die
* X. c6 {4 [# P8 b) z0 g        else inc A_i by 1
4 E" a- k7 C2 K! [2 @    end
9 n/ ^5 V9 ~2 v% B" z0 f4 Uend6 v; Y9 i# z, g+ x. a4 [! j

. ]1 L$ ~( Y0 N: a+ e6 zbegin P_pick2 arriving) N; b" D- t" E
    set A_i to 11
. ~. C' k- n% O0 g3 E    move into Q_induct2* M$ I2 o4 x/ q1 L5 j; T1 C8 ~5 e
    move into pickaisle.induct26 B- {4 ?$ O5 V# f  F
    while A_i<=30 do begin: N! g: l7 g+ C( m4 V
        travel to pickaisle.con(A_i)" z" m# y: X1 ]5 g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ q* K" i2 P1 u6 W' l        else wait for 10 sec4 j% W, d6 r. Q8 S5 W. Y
        if A_i=A_leave then send to die1 u4 @9 ^# R% ~7 p0 ^9 A7 B' [
        else inc A_i by 1
( I- {* _4 y2 R    end, X6 s- X! p) {! J0 q- r" y
end$ O- Z1 Y$ {" v4 ~) b

* F  G* G" }7 K" \9 zbegin P_pick3 arriving& e2 |9 a# {8 v. ~
    set A_i to 21( @: U$ ?+ ~2 ?2 n
    move into Q_induct3
& U7 {  k# e  T  ]8 n2 P    move into pickaisle.induct3
2 o" `. e" E: M( A' I  @    while A_i<=30 do begin& V/ b1 r4 j+ ^4 z+ T
        travel to pickaisle.con(A_i)% ^  W) c4 b+ P; r& K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* G: o1 d# R3 w3 M  Z0 x% x/ x        else wait for 10 sec
- B/ S  Z5 B0 p        if A_i=A_leave then send to die+ l7 s- n/ Y1 h( e7 ^2 \
        else inc A_i by 1
, S! i! l. u4 z# `- h    end
0 m7 p! h8 N3 y& Mend

最佳答案

查看完整内容

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 S4 m2 [# p) ~  C) C
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  p" ~& d! x# [; {
% r/ A* P+ O6 @( d. BAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) ]# u! U4 k& n, g" b: r. W% j" F
! L0 j+ ~$ n) I9 ?- p, ~* }另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 \; _8 h9 ^' G2 @, R1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# l) T: }4 |  R" s2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 j9 ~& D" A' p; v4 U* _/ ]
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 B. J" A: S' d; m: qbegin P_induction arriving- K& \; M; F& }2 V7 Q
    clone 1 load to P_pick(A_induct)
: F! C6 Y% p7 W7 x/ ^, F: _1 N' cend最大的系
! Y7 c! l) |1 G- i. y5 p: R/ L% k9 z7 @  \) x! ]) w4 |! N
begin P_pick arriving
) P- i& Y7 u6 V3 x& V    set A_i to procindex * 10 + 10 c& L  a+ m! G
    move into Q_induct(procindex)3 x5 u4 Z) x2 S% k" c
    move into pickaisle.induct(procindex)* P+ c; b: Q* W; U4 Z0 i: f3 z
    /*check the type of pickaisle.induct(i), for your last problem.*/
2 d4 N! H2 m0 C% f4 r
' N! a0 Y) V. W# D+ t, a( u, x    while A_i<=30 do begin
$ P2 _- D0 M1 |' Z+ F        travel to pickaisle.con(A_i)
- S' c* `1 v  e  H. K9 m3 |* E+ u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' {. l: ]' m( q3 d2 [        else wait for 10 sec
  F/ ^6 W+ c2 h9 d( s8 j        if A_i=A_leave then send to die
, P& I1 T' `6 y! Z* N- L3 h# [* A        else inc A_i by 1
+ }& [2 p+ y! L, x, g! u9 O" {    end
& A' w( R5 m6 ?* r6 {end" \/ ?" `, i0 _% A8 {
6 p& Z0 w: z7 m+ I- u* Y) V
其中的procindex为整形,代表当前process的序号。% u! ?6 H6 \& x1 r
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, 2025-12-16 14:57 , Processed in 0.023719 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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