设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13570|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) G0 ?5 }5 }% E! w$ N

' o$ S$ I. s+ N我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 V8 L, _! M( g8 F
5 V$ P2 h3 `1 h8 {begin P_read arriving, V1 z+ ]3 `* i/ M
    while 1=1 do begin' ^* R2 m. Q  k3 n7 ^6 f
        read A_tote from "data.txt" with delimiter "\n"+ U) D% A" C2 D6 D* T& \
        read A_time from "data.txt" with delimiter "\n"
, v1 l8 j; {, c! j  N' Y        read A_leave from "data.txt" with delimiter "\n"8 h+ j5 v0 ?( u1 i
        read A_picks from "data.txt" with delimiter "\n"
- f- }" o2 F  z2 O, |( k        set load type to A_tote& q8 h4 D4 _( X
        if A_tote="tote 1" then set A_induct to 1) m0 M8 f3 J/ ]9 J6 K
        else if A_tote="tote 2" then set A_induct to 2# C1 K# F* p! Q7 @) u4 x5 _4 w
            else set A_induct to 3   
5 j+ N  p# h8 H; y        set A_i to 0
. z6 L) j' p0 j/ H8 A1 m        clone 1 load to P_induction& b. x( Y5 o! X- j8 Z
        wait for A_time sec
: L3 |: F3 J) w    end
" \% x! G. K6 y& w  n6 k( Dend; P1 F6 P; z' e
' N2 N" t) `- h4 F3 c
begin P_induction arriving
% n- u% X& c# a  _, p  v    if A_induct=1 then clone 1 load to P_pick1
; q* Z3 q7 I- m) ~    else if A_induct=2 then clone 1 load to P_pick2+ f' l( y% K, e! B; j/ P( g
        else clone 1 load to P_pick35 @" A8 i+ ?9 u" j7 j
end
. c7 e$ Y/ H8 S# z( K" p* [- F9 ?$ {1 K
begin P_pick1 arriving6 c/ Y5 {9 y6 a9 h
    set A_i to 1; y% X8 B" `% `; u: a
    move into Q_induct1
) Z. j" q2 O8 ]9 [1 J* I    move into pickaisle.induct1% b# R, s& v+ M% z: r" ^+ T$ l$ T
    while A_i<=30 do begin$ w6 d& y- T& Q5 ?1 K8 d$ d" i( A
        travel to pickaisle.con(A_i). Y1 F- l/ U+ ?9 \4 Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 M3 L7 ]" m/ Y4 D  u        else wait for 10 sec
" E7 ]3 _+ B! O8 A$ m+ v9 p" D        if A_i=A_leave then send to die$ C- E, p8 m! e' S# b7 ?
        else inc A_i by 16 b' E1 Q% [( u3 L) Z% G8 G8 v: ~
    end3 j; }+ W  A1 Y! k  b2 l) J
end2 y" I0 g0 a! K6 x

1 E6 p1 i5 @& h9 V- _begin P_pick2 arriving2 {. @  d( ]% u9 t  p, v
    set A_i to 11
/ ^: b$ z6 ~& V; A: k* B    move into Q_induct2, f  ^+ |5 i( w4 Y% d
    move into pickaisle.induct24 U4 B* j6 z5 d! S
    while A_i<=30 do begin
; e) Z: O" p1 t        travel to pickaisle.con(A_i)
6 |( r  E* z; e5 t9 Q% V: b3 s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ m; W! F+ k4 o) Q
        else wait for 10 sec
5 k5 N, u$ E8 W, z; f: m; \9 L) N        if A_i=A_leave then send to die
: T- M6 o" `; f# T- e; O2 r( k% B        else inc A_i by 1
: ~6 {: `- X; I* {# l    end
6 d8 e5 ^3 W: l8 o( I5 tend
2 H( B/ }6 I! i: o* ]/ H
3 A  p# v7 Z  w4 jbegin P_pick3 arriving
% g; e( r, P* g& x( P% T' j( z    set A_i to 21
  z1 o( d* h' e, u  m    move into Q_induct3
) Z  S; _* L% d    move into pickaisle.induct3' x6 H6 e$ k$ X7 g
    while A_i<=30 do begin
6 @/ r# W! ]6 y* _" V        travel to pickaisle.con(A_i)
' K: z1 n  I, f! v; M0 s# L0 L  w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 l7 d7 ^' [( x8 P3 f8 f
        else wait for 10 sec
* A( }& p0 k3 A7 a* P        if A_i=A_leave then send to die3 C3 L& }( t* o1 Y! |9 u
        else inc A_i by 12 b+ _) o1 P, M1 n3 k* l4 Q
    end* x" w$ t! I9 `, ]  L' w
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是个什么东东?
$ [; P- e% R  t( l. u0 Amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& I- z( a, b$ `5 m7 y
3 r& O. H) Y/ [: Y) J1 C  l5 |
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& W0 r0 S8 }" l8 p! O* s

7 k0 `8 ?! g1 K3 ~' Z, ~另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ c6 K4 h( \) [. u! U+ k
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& V  u, @) [7 P2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- w' u! K# @: i' d! l2 w2 c3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 ^3 P& C) N5 y- Ubegin P_induction arriving
' c5 V8 x4 d3 A8 p    clone 1 load to P_pick(A_induct)
0 H1 x7 X& D8 o$ Nend最大的系6 G5 ?9 j* a- i' h3 @- u0 f
+ q% D4 Q6 u. A" g, @
begin P_pick arriving
9 D- |+ N, \  {+ a    set A_i to procindex * 10 + 1
! X0 W7 }8 A2 U    move into Q_induct(procindex)3 r: U, F8 `( I8 \1 b1 X( R/ \( a
    move into pickaisle.induct(procindex)
( f" x9 l- T  N" p: `& t! d7 ?8 k    /*check the type of pickaisle.induct(i), for your last problem.*/
6 e$ P3 F. Z, g8 c( Y  M5 L; y
& l- Y) C4 E4 a( L+ c    while A_i<=30 do begin% D  c1 [* L# S# u3 w: ~
        travel to pickaisle.con(A_i)
! a* i# B  T+ Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: P+ [; r- t& y( v4 y  ~
        else wait for 10 sec
5 W: M7 s" ]; A3 |        if A_i=A_leave then send to die
, M9 k$ Y4 _  E7 |9 r        else inc A_i by 1+ N* M; o" u  a9 R( p' W
    end. Y+ Q  m! I  }4 g
end
1 ~' ~3 ]$ u1 s$ R1 B; {+ c5 E% [! Z
其中的procindex为整形,代表当前process的序号。
/ v. k' s  f+ V0 l: estation和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-4-22 00:24 , Processed in 0.014714 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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