设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13051|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! B5 ^* z5 ^4 H& w9 }
9 E+ i3 M7 B$ B9 q4 q' z我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& G! p8 |1 e5 }. S( V6 C0 b9 x+ h$ O" r) I. P5 \& X" _# F
begin P_read arriving0 P7 ~( z, t6 b  N# ~, M5 o) W
    while 1=1 do begin
) ]( P) E: K5 n. b% \7 _- v        read A_tote from "data.txt" with delimiter "\n"( a2 H& D- ^* W4 q" p
        read A_time from "data.txt" with delimiter "\n"
' U' d' E; E( z        read A_leave from "data.txt" with delimiter "\n"
6 D$ h3 _. F, J! e% x( l2 X4 b: J        read A_picks from "data.txt" with delimiter "\n"6 N7 _* [/ K' b3 H$ s1 l
        set load type to A_tote2 k+ N3 [3 \! {/ G, [2 x$ c! Y
        if A_tote="tote 1" then set A_induct to 1
8 X' X- i" |2 g! ~        else if A_tote="tote 2" then set A_induct to 20 v: w9 s: S9 {- s: H
            else set A_induct to 3   
+ z$ C6 E% `& V* X' ?8 P: X* _$ f( x        set A_i to 03 x4 i% T9 x) G0 _
        clone 1 load to P_induction& {: d4 P% R% W, |
        wait for A_time sec2 t9 W& N7 }/ P& F) y" ^7 |# ^/ L. A
    end; O0 c4 _) q. w0 O2 j' X
end# b( L8 N7 Z: P0 i

: M' K; |/ ^3 Z0 H" x2 zbegin P_induction arriving
. S# q$ L2 _0 m" A8 X2 A* R8 E6 g    if A_induct=1 then clone 1 load to P_pick1
7 A  L% U. K% X1 h5 e. e    else if A_induct=2 then clone 1 load to P_pick2/ {0 n3 f1 p$ D) `+ Y9 Z; j, K5 T
        else clone 1 load to P_pick3
; u9 B- ^1 u1 j# D) f* H+ cend
1 A: ^# \8 U! w9 ]/ K" S$ K9 a8 i: y; `/ ?; g2 Y
begin P_pick1 arriving
7 \5 x' _% ^4 n    set A_i to 1) l% w& O! [( ?* `1 Q
    move into Q_induct1
8 C( i. u  @% z/ Q. G, C7 h1 c    move into pickaisle.induct1
* L' C, r7 C' i$ F( V2 S    while A_i<=30 do begin
, R! x  U6 G# i4 i1 P        travel to pickaisle.con(A_i)7 G" y$ Z) h0 a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ B8 ]' w& [# f# M4 e8 \( w
        else wait for 10 sec& \4 X/ M: X3 ~3 V. P
        if A_i=A_leave then send to die: Z  F( V0 J, L* P
        else inc A_i by 1! b% v7 M. C8 s: ?4 Y4 }1 v1 }: Y
    end% D, s% v" i( r; _; Q2 u
end$ e6 @; y$ ?! y) f- U6 Z2 R
4 ?) I( O, R$ S# N8 s! {4 K5 D% D
begin P_pick2 arriving
$ S7 G! x4 x- E; j7 u+ T. i# G9 w. X    set A_i to 11
" X; Q; [& c) z+ n3 U8 }; C    move into Q_induct2/ n  J# M% N; y7 {- U$ K! O: `
    move into pickaisle.induct2
8 {* `) a- m6 d0 I    while A_i<=30 do begin0 W& j+ j- [' u6 q
        travel to pickaisle.con(A_i)
1 K( w: i+ G* L0 T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& D% Z7 H9 \( t2 n% A9 I
        else wait for 10 sec- \: w( A( V  Y; d( u0 O8 l
        if A_i=A_leave then send to die; `  V, s& ^8 r, j5 D
        else inc A_i by 1
$ \. Z( r, ]! {- C    end: \  x' _6 Z1 Q5 Q$ ^! T4 N# n
end
% r  ]9 v7 s$ L6 C8 T& J0 e+ D7 C5 ~3 H( `( q/ ]1 D* q  W& b) h
begin P_pick3 arriving
6 U% y7 w1 P; e    set A_i to 21  c5 c7 w& ?4 |: j3 a
    move into Q_induct3
& u; C0 i9 E1 n- M5 f9 T4 n4 `" L    move into pickaisle.induct3+ F0 k2 [  F' d" p
    while A_i<=30 do begin9 }0 Z5 ]' q4 _) z9 u7 C6 g
        travel to pickaisle.con(A_i)0 g6 h6 v8 P& ^' I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* p- G- T1 I& D; E$ h
        else wait for 10 sec2 n' Z9 [4 g6 j$ S
        if A_i=A_leave then send to die+ ]* t! z6 T1 r
        else inc A_i by 1) `+ b( m- K% K& Y, F5 ^
    end
6 m+ B- F7 R- ^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是个什么东东?" e8 w/ |$ z: x
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?0 y4 A# |- M3 D

. a# H3 R: L/ t2 MAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ E5 ^9 A5 T+ m% v9 P: u
! G2 ^0 y* G1 I1 D+ r8 W$ W另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 M+ U  e( Y# ^$ B3 F; O  z1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' f8 f6 J: b# c7 a* v& k4 d- n2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" o$ z2 V, |. d5 x3 a5 z$ o
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:3 }  s& f  `  R) P% w$ z
begin P_induction arriving6 w( @/ k% H7 i0 E5 a
    clone 1 load to P_pick(A_induct)
0 R7 `  D5 T: b) n& Aend最大的系3 [9 M* t* a+ ~" }

& A% X8 [! X$ z# @0 Qbegin P_pick arriving4 p# }8 O! Q5 j3 H9 y
    set A_i to procindex * 10 + 1
) D. r0 N# r8 I! b7 S& Z7 e0 }: F    move into Q_induct(procindex)# |1 k, @+ T3 t1 f' v7 [8 @
    move into pickaisle.induct(procindex)
3 w- [5 K% v+ J9 U' W: G    /*check the type of pickaisle.induct(i), for your last problem.*/
3 v" g5 N7 G& g/ J* R$ J) J9 K! A. Q$ b5 K8 t+ b/ _8 T5 w
    while A_i<=30 do begin: d! i1 x8 S1 m; l5 i, {' M6 l
        travel to pickaisle.con(A_i)- P$ U/ t4 y" I- S$ G( r9 A7 ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- E* B; @7 F) I  K. ~8 Q9 I
        else wait for 10 sec
; c; K; X$ p: S! V9 M4 J        if A_i=A_leave then send to die* A! [  P: n; x# @
        else inc A_i by 1
" a2 x* x2 X$ r( ^# j/ b5 K    end
6 @2 d0 m9 a+ O) C; zend; K1 D5 r7 V/ U+ e( i% }& [/ L# r

& J, C, v7 ?" T其中的procindex为整形,代表当前process的序号。  z; m- F( @  w& e" m; _) n
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-3-13 19:00 , Processed in 0.018244 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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