设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12544|回复: 2

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

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

7 V2 Z( u# _. D9 u, {我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 W+ h, t" U& _6 B2 `- o% N& W7 R! V# Q; W
begin P_read arriving  a7 D: C9 ]9 L
    while 1=1 do begin
6 t" b5 _3 O  A7 ]: G        read A_tote from "data.txt" with delimiter "\n"
' K* i7 R8 A  r$ k3 C        read A_time from "data.txt" with delimiter "\n": @: Z, }  ^, N+ `! C% G
        read A_leave from "data.txt" with delimiter "\n"
2 t) [2 g" ^& F/ `( [* r4 e        read A_picks from "data.txt" with delimiter "\n"
9 u% U5 i2 F0 u  q1 g5 x        set load type to A_tote
, {" p% E& P0 j. H% \. w$ l9 W) H        if A_tote="tote 1" then set A_induct to 1
& u# e1 e8 [1 D        else if A_tote="tote 2" then set A_induct to 2
7 y1 U/ w- D: r" e            else set A_induct to 3   
/ \; j& J5 t! S1 l/ O2 y8 R        set A_i to 0
: H* I( V0 Z! s1 `9 |        clone 1 load to P_induction
* y& J5 p, U% ^1 b        wait for A_time sec) y5 P3 ~/ m3 L
    end0 z( J" V0 @: G; e8 r! O: a8 s' a# U
end
4 Q( j3 O7 j& k7 y
% C; l1 u; X' ~" i. i" u7 ?7 Gbegin P_induction arriving
3 b7 L/ L9 {8 [# n9 A    if A_induct=1 then clone 1 load to P_pick1
9 Z2 T+ `6 p; h7 N    else if A_induct=2 then clone 1 load to P_pick2
; p" Q1 |  W$ a! {/ n! t4 z        else clone 1 load to P_pick36 m1 p1 N0 s. k
end
* _  g  \. d" L& g4 a
2 C* Q" q; g2 k$ U8 tbegin P_pick1 arriving
  }+ R/ M! D6 Y% k    set A_i to 1
/ y; l2 [/ C. Y' C  a( z    move into Q_induct1
2 @! W0 a, W& w9 M    move into pickaisle.induct1
' F' M( ]$ B4 {* j    while A_i<=30 do begin4 `. }0 ^8 |& X& e
        travel to pickaisle.con(A_i)+ J1 O0 Q; X+ W. {4 \* K  _% e, Z% S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 y6 Q- K& v" \5 }+ j; H$ l6 \- `
        else wait for 10 sec
% ?/ d( A' k- j8 s: B. }8 V        if A_i=A_leave then send to die
+ s* A( ~& ]' Q' h. O8 I9 ^+ v0 o        else inc A_i by 1
% r7 }$ v& i4 Q2 Y, w    end
, B6 Q7 r) h# F% a5 fend5 N/ e( Q3 U5 i8 [0 X/ H* n

- \! L; J1 E8 o7 k/ ebegin P_pick2 arriving
3 a) c; e$ r, y    set A_i to 117 E7 x. i7 d/ ]/ H" a
    move into Q_induct2, C2 ^8 e  T% O8 R  q+ b
    move into pickaisle.induct2
3 v8 \1 t8 T* R' n9 i; S+ D    while A_i<=30 do begin
7 m3 I( i- c* U% a8 V* O        travel to pickaisle.con(A_i)) I& R' M8 p. L% p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, Y1 P: d  N3 {  A* ^: ~
        else wait for 10 sec$ k+ B" {+ x  `6 S
        if A_i=A_leave then send to die
7 |! W+ u+ S; w% v        else inc A_i by 1
. ~, Z, C: c* _# i# u    end
" q# b0 x; S1 y4 zend( w" q3 _4 |$ L1 q% Q! [/ K3 V

. C* N$ z6 V5 g3 }! Q) U& K( i+ Vbegin P_pick3 arriving0 J/ t8 B$ W3 u4 p7 ^$ Z  \
    set A_i to 214 \7 }% D3 W$ V( r  O$ b  D
    move into Q_induct3" [5 l* h* l" x  d* e0 _
    move into pickaisle.induct3" _) y7 Y8 p7 a/ v/ e% P- U! P
    while A_i<=30 do begin
, ?# H- S0 ^# {2 B3 B        travel to pickaisle.con(A_i)
8 a5 a$ Y, L$ B$ O. h  Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 N# ]- x1 C2 F7 R' E& u        else wait for 10 sec
' V8 I2 w% x) u5 J        if A_i=A_leave then send to die
, S2 F! l* q3 Q3 ^; X# Y        else inc A_i by 1. x  i6 b: @: X3 M! }& `* t# N% O
    end: Y9 d4 V, Y$ E- G0 F3 L
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是个什么东东?# ]. p1 z3 [, y# O
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! J# N5 v2 x; J" c

5 ?0 \; w: D+ d7 E9 e8 {) o& x2 LAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 b4 R) Q' w" U; N
' T# ^( N" S4 V+ z. n' n$ }+ J另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:& s/ ]: b$ j7 F
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& l% o* C$ M2 P( c" ^
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: v' X; Y- \. P+ }: C- O) f3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 g' G7 _6 B5 J1 g3 g! H0 N$ Bbegin P_induction arriving) ]$ Z$ {. _* h$ d  y. `
    clone 1 load to P_pick(A_induct)) n: h% s: b! R( {: X
end最大的系
! V  ~/ j" L2 F( {& s: k5 X+ Q5 p) U+ f4 Y) P- i1 O4 m1 J
begin P_pick arriving- [; y3 ]# S% W) Q1 X
    set A_i to procindex * 10 + 1  W' k/ s, j* x) z# r4 _
    move into Q_induct(procindex)
5 I% W) P; W& k! v5 L; K    move into pickaisle.induct(procindex)
) q9 O7 B  W' M( h( M) P. s    /*check the type of pickaisle.induct(i), for your last problem.*/& P. s6 F: ]- S8 }. v/ p
7 v0 R' N/ ~% a  v3 k  Z' i
    while A_i<=30 do begin4 s- D% Z- A  j2 b- n
        travel to pickaisle.con(A_i)3 i2 e: W; I7 p" `9 t+ _$ B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( A' J. b8 S2 _. @        else wait for 10 sec+ ~: J/ P1 w& I. I7 A7 a3 ~
        if A_i=A_leave then send to die
& z: {/ L$ f* q$ f$ P( B; O        else inc A_i by 1
$ B% l2 l8 \, ^' X    end
6 V8 S2 K+ {) g& _5 o# V% I& Xend' g4 ?8 L# X! \' t3 S

4 z& ^( a: G4 |7 t; _0 l其中的procindex为整形,代表当前process的序号。
3 n7 X  \0 H& i4 H+ ]$ U7 v6 ~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-1-31 02:29 , Processed in 0.014440 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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