设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11611|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" I1 q* j" Y3 @, G$ B

2 E  P( O& @/ C+ i" W我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& A7 P  r! h- s
, T1 l  O: |5 [. ]( hbegin P_read arriving3 j) c% Y2 t& w- t9 L0 U" A
    while 1=1 do begin0 @& Y2 h) K, c9 `1 j* Y
        read A_tote from "data.txt" with delimiter "\n"
2 }5 S, s' f$ R# Y6 R" H        read A_time from "data.txt" with delimiter "\n"
% S" s/ t: F/ L! ^        read A_leave from "data.txt" with delimiter "\n"
, Z3 M; o- ?( H+ }. _        read A_picks from "data.txt" with delimiter "\n"8 L+ m6 }% w' x
        set load type to A_tote
0 ^4 e- ?! p9 _        if A_tote="tote 1" then set A_induct to 16 G/ A1 J  j  G
        else if A_tote="tote 2" then set A_induct to 2
  f- s, U, i: T2 K' ]            else set A_induct to 3    / K- v7 o# |6 F$ V2 K9 F
        set A_i to 0
" J- t+ K8 ?# l        clone 1 load to P_induction( w. q( W4 {$ n
        wait for A_time sec$ f$ z: F$ N  L9 J) v- X! y
    end* |& Z, m1 t9 b* c8 Q" Z
end# l2 K, y* |5 g6 a6 x7 W
8 p* c( V& ~  y3 m/ G2 n& |
begin P_induction arriving
2 ?7 _! c/ j; l3 k    if A_induct=1 then clone 1 load to P_pick1) U" @- ^8 p8 x8 K4 r1 G! E
    else if A_induct=2 then clone 1 load to P_pick2
4 j' H( o( J3 ?        else clone 1 load to P_pick3
4 g7 y! i+ M6 r8 G3 r; v: Pend
' T1 i1 }0 h- N8 @" r' a1 ?2 J1 z( h! e2 n
begin P_pick1 arriving/ }: ^0 |& B' F0 K) `
    set A_i to 1
! Y* j9 Q" x7 t6 Y6 n, h2 ?    move into Q_induct11 u- c$ g) t3 j/ D
    move into pickaisle.induct1
- G8 f5 j3 o( O9 ?6 L    while A_i<=30 do begin
2 X& x6 C) W: J" ]; M        travel to pickaisle.con(A_i)
7 i) [! F. W( B( F! L8 y9 h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' Y, ~/ [: R& f. i        else wait for 10 sec- w- K0 \6 u4 @0 k+ }- C2 O
        if A_i=A_leave then send to die
9 {% j8 I5 |0 D0 b+ L% K- s; E0 z  w        else inc A_i by 1" l* j( |6 ^- S9 E4 o. R
    end
* L' g* G! m4 S! E+ V8 }end
: z) g6 M/ x, K, x( z5 K$ j# ^% E& w4 ~# |5 b5 J  b! h  p
begin P_pick2 arriving
+ x6 P+ x/ M4 ~+ t% K% p6 T% D    set A_i to 113 x) a2 f' T% R$ N3 r: U% d
    move into Q_induct2! q1 |: g* ^5 S0 Z7 _: t$ g& A
    move into pickaisle.induct2- V" z# ~3 f5 O- g8 G
    while A_i<=30 do begin! S1 c3 s6 S; ?+ L1 S
        travel to pickaisle.con(A_i)/ l1 ~9 F& S  k* S+ w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 I# t+ B: \" I* E
        else wait for 10 sec
5 C6 d3 S9 L9 Z4 v3 s2 y! B        if A_i=A_leave then send to die1 Y7 [: Z* a+ V/ l  k* S' {
        else inc A_i by 1
+ K7 ^( A( }4 {/ g6 C    end
3 M0 ^7 F% Z5 L' Q0 p. ^end
$ q  N6 m# t* q: ?$ _* ?' {
- r  a; c) d2 Jbegin P_pick3 arriving
$ Z3 D. h2 b" |) S9 f, J$ R& q    set A_i to 21, I8 k! S3 L5 |& P  U( I7 D
    move into Q_induct3
/ ~+ Z9 @3 m4 D+ T9 X0 w$ S    move into pickaisle.induct3
2 {- L1 {6 k2 j9 Q3 K/ W! r    while A_i<=30 do begin
3 W4 p7 [5 I6 T3 H5 O        travel to pickaisle.con(A_i)
+ ~# k* T" O1 Y, T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 C9 L3 `4 i. B9 W/ [1 _) ^' b        else wait for 10 sec  `+ c) h9 T0 g0 i! w1 U4 K
        if A_i=A_leave then send to die# |& k* r' s; e7 }! p* K
        else inc A_i by 1% c' @- a" {7 e3 m0 j) T/ O8 A
    end
% b# b9 b" }. e+ n4 e6 `  Dend

最佳答案

查看完整内容

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是个什么东东?. \; E7 m4 }4 m( A6 |, |
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! I" @! `; i- k: Y" t, X
/ W' Q8 o9 D, s& O, ]5 _
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 x# y" M, Y7 p) \' O$ J) |- p; l' `! v& Z+ W  i
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 u/ z" [9 ?7 P: _$ [( @1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;6 R& W' T7 W! M
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
* `2 ]2 g1 Q/ I; @3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" U0 u0 N6 ~+ E6 Y6 ^
begin P_induction arriving$ D2 J$ b: P$ R
    clone 1 load to P_pick(A_induct)# P& d7 R# e7 j/ k6 v
end最大的系/ l8 l( M: B4 Q0 B: ^+ [3 m& h7 j
1 o4 ^1 z4 t; [; |- S6 y
begin P_pick arriving) G$ ^/ t- i4 U( A6 Q1 v
    set A_i to procindex * 10 + 1$ H1 k2 ~! ?* [% ]
    move into Q_induct(procindex)
) B6 Y* I! {' T% O: \! W( {    move into pickaisle.induct(procindex)
  Y8 S5 b6 Z1 ~. h1 M# m2 Z    /*check the type of pickaisle.induct(i), for your last problem.*// o3 r' F& F9 m* C6 w
1 H0 ^( f% W: d$ S% |
    while A_i<=30 do begin9 ]& O. M) q0 \, U8 }6 M
        travel to pickaisle.con(A_i)- t. M8 T5 A: Q, [( G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) @- e$ N5 K! A9 `) W% F# u        else wait for 10 sec
( F1 E! [9 t0 T        if A_i=A_leave then send to die" P# a6 N: w1 _, B9 J
        else inc A_i by 1
2 V+ c! i5 a: {0 s' O    end
- V4 H9 _7 _+ d# vend, {3 @( F7 C6 D' q

* e; |3 m% t% v, q1 G/ f0 L其中的procindex为整形,代表当前process的序号。& X8 l) i/ p. H" |8 w* G
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-11-23 12:38 , Processed in 0.032199 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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