设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12935|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) s( b7 q; U) K0 V' t
5 F4 D" H4 W0 q7 B) [( e
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ m& F* v0 ]! |3 w4 ~
8 I1 e# b* s6 M4 Fbegin P_read arriving
+ @% l6 V. {) `* {* K1 r  u' s    while 1=1 do begin9 \4 j& e* Q9 ^9 i5 T5 A: G; Q
        read A_tote from "data.txt" with delimiter "\n"
, g* Z5 ^# k( h2 a. O        read A_time from "data.txt" with delimiter "\n"
/ w  u4 _" n* [3 b- c        read A_leave from "data.txt" with delimiter "\n"
1 \  z0 A7 X# c9 ^2 i* z! W        read A_picks from "data.txt" with delimiter "\n"4 }3 `* i2 J( S' |
        set load type to A_tote% X1 N# \0 p" j* t4 s( h8 N. R' X# @
        if A_tote="tote 1" then set A_induct to 1
& G" d) J( w6 I9 [2 S) G        else if A_tote="tote 2" then set A_induct to 2- p( B- v  y. O8 l% J+ K1 k; f: A
            else set A_induct to 3    0 `  v; X  v( v4 @% f; t6 Q2 A) ?$ R
        set A_i to 0
' E8 X% N. R6 \7 H5 P6 i        clone 1 load to P_induction
2 n% t  `0 U, a2 f8 y- c3 G5 b9 a! _+ C        wait for A_time sec
9 @  Y+ R. c% k) w) b- k    end
2 ^. Q( q7 O- ?( P$ I7 P5 w3 Y0 dend' [- u# e$ w& `2 O3 r7 i

* x4 a; m- X8 I9 d- G! ~. i5 [begin P_induction arriving! C9 g% o" R( }+ c
    if A_induct=1 then clone 1 load to P_pick1
& z2 g7 F; x: h" J7 k    else if A_induct=2 then clone 1 load to P_pick2) e; D' @7 H  i8 B6 ^
        else clone 1 load to P_pick3* u3 n9 {6 i. a1 ]$ ?7 L7 [" V
end
1 q* y( S- I( D- K7 h% l4 c9 s; i& v* ^0 b( r* p
begin P_pick1 arriving0 R' u9 H: D1 s
    set A_i to 1* R2 l2 V1 G5 d+ s3 q
    move into Q_induct1
, z# [) i% B) G0 k    move into pickaisle.induct1; {6 u3 }5 R, A  Y2 r: `' h
    while A_i<=30 do begin  N  R4 `  }, |; x: H6 r& b
        travel to pickaisle.con(A_i)1 T% o9 B8 X. H) H3 W6 Z. p9 g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" a. C0 B7 S+ r0 l1 N
        else wait for 10 sec) n1 R, d4 r, C1 O
        if A_i=A_leave then send to die6 U) m  O$ _3 `1 L5 v
        else inc A_i by 1
  B( z: O# e2 b8 Z    end4 c* ?- N, A& ]  L: f/ p- n+ q
end4 \  h, r$ {7 {0 t8 V7 f* D8 [

5 P6 m# K2 n; tbegin P_pick2 arriving& R" P0 N$ U# ^% Y# p
    set A_i to 11  b- ?' p; G+ V# N
    move into Q_induct2% X* d' M2 y7 W/ O& g
    move into pickaisle.induct2
1 x3 Q* g8 |, |9 x( T! a! W    while A_i<=30 do begin
8 _& t, g9 b" J0 [* a. R2 v        travel to pickaisle.con(A_i)
: N  P% ?1 s/ M' r) ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 D9 J. U5 P; |# b( }8 U0 r        else wait for 10 sec" h1 ?( x. L9 I" x' J% |9 \+ _1 P
        if A_i=A_leave then send to die
2 ]! }3 S6 a* ]! B; a( _        else inc A_i by 1- f$ y( V- E9 Z) T! S1 {
    end2 _: V- n) i( p/ T
end
* C3 h0 T4 k( g: z
, }( r' R( g/ j  ^: ~9 a/ pbegin P_pick3 arriving7 a# {6 j1 L: F, p' q
    set A_i to 21- k5 |2 j3 \0 ?3 d
    move into Q_induct3$ e) @9 m9 R6 u; W6 Z
    move into pickaisle.induct3
3 E" W2 C( D+ r5 X* E% R8 v    while A_i<=30 do begin
. f' T, d0 G5 L8 a        travel to pickaisle.con(A_i)+ V4 {+ V7 O& Y* |3 M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* `# S3 K  L: B9 `        else wait for 10 sec7 N6 Z0 T& Y- v# M4 W+ b) e
        if A_i=A_leave then send to die
  G5 B% D$ }, [6 Q        else inc A_i by 1
6 x+ H, {# |$ T. m1 j' w6 E    end! D" S3 K% {( e8 X" y
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是个什么东东?5 P0 S) c; J  @+ g
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 [4 Y: I1 [3 v: r! w. w# O9 a( L* d; c, x. S; E
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- C: i# V3 `! W

# h3 v/ F2 O0 _3 y, m另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ s5 [' A- S' F# c( q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- J& F2 P8 S7 M2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' b6 P# Y: O8 C2 L) b% r& ~! J* ]3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& G6 h' }2 R! F1 D6 l; abegin P_induction arriving: j- F. i/ L) [' }
    clone 1 load to P_pick(A_induct)0 e& x5 ^1 |* c/ t* R. f" S3 h
end最大的系
  G7 u" Z4 t7 s$ O- W) i, T
3 ~. M8 \! W# o# @begin P_pick arriving
! B$ ^  W3 }+ ^" F! Z) {, J  U    set A_i to procindex * 10 + 17 a5 B. `* A+ D; E! r, Y# o
    move into Q_induct(procindex)' e8 j% M- d/ I7 R) `! C3 h
    move into pickaisle.induct(procindex)( m) h8 u7 {* K7 a
    /*check the type of pickaisle.induct(i), for your last problem.*/
# [6 s! {9 Y8 w5 F6 w4 P- c- k0 @& t+ p8 y: h! B! x- ~" {! x
    while A_i<=30 do begin: R3 f/ {5 f, ~$ {9 D, e5 R% q* d
        travel to pickaisle.con(A_i)
( d) g2 {7 C$ K. t+ s: y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 _9 ~) S2 T" o6 K% l3 N" a        else wait for 10 sec
! g5 v# E3 W! ^        if A_i=A_leave then send to die
- B/ c; C; Q$ m) x( b: D% e+ B        else inc A_i by 1
3 Z! F& k, V: y: E0 d    end9 f; n6 l# D* n2 `2 w/ f5 v! b6 I
end0 u# F5 v2 e4 J" G* G- X
& ^" _3 r& R9 _7 O
其中的procindex为整形,代表当前process的序号。0 c; l' |3 s8 i2 s
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-4 04:56 , Processed in 0.018115 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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