设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14349|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' c2 R' y% _; }# h
' h/ k7 v8 E+ G$ f
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 |$ N+ C" h& ~- ~) C! C/ B* p7 q) @
- A2 q+ D0 K: F9 l& x0 G! A
begin P_read arriving
( A- e. }; }) T- \* N+ V    while 1=1 do begin8 N7 y; c  U3 ]9 E. X
        read A_tote from "data.txt" with delimiter "\n"9 f+ r- p, C0 B. n. K
        read A_time from "data.txt" with delimiter "\n"
3 l3 L% e! B  Z" n9 q4 W  N* c        read A_leave from "data.txt" with delimiter "\n"# `% u4 V' M: q1 T+ R$ |
        read A_picks from "data.txt" with delimiter "\n"
' Y2 ]; ]! Q1 B: s- t0 A8 [        set load type to A_tote; s; L; f/ }. {8 k
        if A_tote="tote 1" then set A_induct to 1
' L9 e) N( A/ x7 n% G# v; R* U        else if A_tote="tote 2" then set A_induct to 2
+ Y8 M7 ~: |7 q# x            else set A_induct to 3    ; ?2 v+ b  d  M3 t
        set A_i to 05 M  S2 ?9 ?3 ^0 f8 l: |/ t
        clone 1 load to P_induction  H  L! U6 I! z
        wait for A_time sec
! _3 D7 e% B7 ]- g    end
8 d0 Y3 m5 b, r2 @' Cend
4 r& M& F& A3 t  [) d5 T
6 T; d' a  m) N% ebegin P_induction arriving9 I9 ?0 G$ O4 X
    if A_induct=1 then clone 1 load to P_pick1! @" P" W+ w0 W# g4 M
    else if A_induct=2 then clone 1 load to P_pick2
/ s" z/ C6 t& ^$ q, ~" M        else clone 1 load to P_pick3
9 f7 W9 z0 z) v& |end
  {7 o. k4 H. O+ b, y1 m6 l1 w6 {6 E
begin P_pick1 arriving* ^" Z" X; s; ]  e$ z- y3 T
    set A_i to 1
9 L' u# T7 p$ _8 X    move into Q_induct1: n4 T% q; O# Q; E- H
    move into pickaisle.induct1% h( n, e8 @4 M0 Z. T8 ]+ v! @
    while A_i<=30 do begin6 n! @* D9 C! x, b- ~
        travel to pickaisle.con(A_i): R( f, p! \+ f( V. T5 ~" h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ Z! c# U9 \* D; M
        else wait for 10 sec( t( Q+ v4 ~3 q
        if A_i=A_leave then send to die9 O  n: }3 A' V4 E$ [
        else inc A_i by 1
, s6 V' ]9 Q+ p    end
% D6 Q- F- Z: r' X1 Nend
9 F4 B7 p6 t1 u% R" w3 `" P  H+ _* {4 ~
begin P_pick2 arriving
5 f( j( P1 q& O% s    set A_i to 11' [; S6 S' N& Y
    move into Q_induct2
$ ]& G1 {: l4 p5 i    move into pickaisle.induct2! `6 \6 a5 X+ l7 A2 q. O9 G
    while A_i<=30 do begin
( a; @, ^2 }1 B" I, K$ S' ^  H* d        travel to pickaisle.con(A_i)
& h. s5 C# p3 Q) P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) u6 L' F1 q+ f! K( n  p
        else wait for 10 sec
9 E5 B7 z9 S  z) `: X6 l        if A_i=A_leave then send to die
- S! T7 M, c  T( g" U        else inc A_i by 1
' T3 P6 A3 B$ {" B* U+ c/ o    end
0 R3 I# Q! r, aend# w* x3 E$ \1 U

- c, B8 [! q6 I( w8 tbegin P_pick3 arriving  I+ A% J  f! T) E* t0 v! z
    set A_i to 21
5 [' n8 S3 Q& ~) s    move into Q_induct3$ }$ f' E8 l  Y: S
    move into pickaisle.induct3
4 n5 @! I+ R' s( w    while A_i<=30 do begin
) |) e" a6 m' ]        travel to pickaisle.con(A_i); K7 Q+ z4 V' @5 X0 a4 o9 {: S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 _: G/ m  ~- _6 u+ ]; z        else wait for 10 sec
3 S9 m# l3 l6 n, N5 ]8 }- C( i3 J        if A_i=A_leave then send to die
! s* L: a  {8 B" a        else inc A_i by 1
; g* h6 @) o, @3 ?' f2 B5 x) [    end
% ]' r8 D# E0 Nend

最佳答案

查看完整内容

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是个什么东东?- ^5 w4 }. z$ @9 m
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ x5 j9 }; h/ N: j
0 `$ Y7 N7 t& Y* g9 NAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# n1 |: p) g% Y& x" T7 Q( Q0 F1 k3 l  k" ?3 |
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ }( h9 Z: m0 r) J8 @: \
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, }& Q- w! A$ N; b% u+ T3 N/ E; v% K
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) H" e( _+ \' V8 G: @9 x
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! z) S( \1 j8 xbegin P_induction arriving
' Z4 Q. y% o8 g- G: w    clone 1 load to P_pick(A_induct)* A4 v4 s2 u" |: J1 _
end最大的系( S  _8 U0 }/ d. V0 W' W( C  T2 U3 A
2 I( V8 W$ b! w# q8 w
begin P_pick arriving5 h6 e' O: S  s# c7 ~5 N8 ?
    set A_i to procindex * 10 + 1! M" [; h, m0 n
    move into Q_induct(procindex)7 _0 ]) j( H- R) p7 p4 e/ T' v$ W# G
    move into pickaisle.induct(procindex)& H: R3 c" B7 z" X  O7 d
    /*check the type of pickaisle.induct(i), for your last problem.*/
& l- C6 \9 O+ I! {: O$ G. O; |8 S' L* Z! |0 I
    while A_i<=30 do begin2 h5 X5 I: [& F# g* `7 n& G
        travel to pickaisle.con(A_i)
/ [' d4 e9 h, v: D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: i* I1 e; i& \2 M9 ?& ]( ~
        else wait for 10 sec
: i; n/ l; t9 e        if A_i=A_leave then send to die: u2 w2 T! {2 l; K7 \/ T5 d
        else inc A_i by 14 |. [" p5 E: R/ o0 f$ X" ?
    end
( b) j5 W- }& J2 ~end  o8 X2 E: L: k1 u% j6 u

* p% F9 p2 S2 A: ^1 ?5 U其中的procindex为整形,代表当前process的序号。- L. f6 N) V  S8 P
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-5 07:40 , Processed in 0.015330 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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