设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9624|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* Q' E2 o/ B( n+ z/ o, Z# [
+ u: S* z' o7 f) R我的问题是,在每个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 L/ k  c. ]' g* }" s# N. E- d
- E1 |7 x; ~# z) y! \. Qbegin P_read arriving
# r! F/ H& }: ]4 w7 S( D1 }: B4 o0 F    while 1=1 do begin
- c8 L% r! `9 {2 e+ ]- [        read A_tote from "data.txt" with delimiter "\n"
$ ~& }" A& \  N+ H/ z' H        read A_time from "data.txt" with delimiter "\n"
3 P5 Q3 [* C6 I, v- I        read A_leave from "data.txt" with delimiter "\n"
: T9 [5 h* ~, a9 E7 t  y        read A_picks from "data.txt" with delimiter "\n", h2 z0 ]+ g- i; q2 T( K
        set load type to A_tote
) @3 o# b  f( M+ M, v: e) l- P        if A_tote="tote 1" then set A_induct to 16 Q0 @1 @& {4 o: J6 U$ T, }
        else if A_tote="tote 2" then set A_induct to 2
* j6 x) P5 y. \' i) z: S! Z            else set A_induct to 3   
2 T& ?5 k, w: `" A" p  |1 W        set A_i to 0
$ W, d) q0 T; f. Q" X7 J        clone 1 load to P_induction' H' w/ y2 |% G8 p; F+ I1 Z
        wait for A_time sec
' h3 Y+ b0 a4 }; p, E, v) U    end
& \" Q& @$ l* Vend' n  _. g; v8 n  W. z* x
) q8 j+ e7 T) u/ a" t
begin P_induction arriving
- A6 v+ |1 k6 H$ h9 u0 Z3 E    if A_induct=1 then clone 1 load to P_pick1
- ?8 S) B1 J2 k7 S/ }8 a& a    else if A_induct=2 then clone 1 load to P_pick21 j, Q, @: I: g7 S( R4 J* y* b
        else clone 1 load to P_pick3
% E+ V6 H( h! C) ^end
- d8 @0 m8 m2 G. ]" ~5 c( u4 P7 V
begin P_pick1 arriving
) R# T0 i0 T5 X. }$ h; \    set A_i to 1
1 V1 k+ l, W  O, q& u    move into Q_induct1$ j/ o$ l. q2 |' U  }* Z
    move into pickaisle.induct1# E0 y1 ~- e0 K) z0 O7 r
    while A_i<=30 do begin
& c' |' @3 M! a, C9 S: Y$ Y        travel to pickaisle.con(A_i). v4 }3 D  M( u" Y9 e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 o. C0 W2 [7 j5 V& b0 ^  L
        else wait for 10 sec
2 _* U6 q1 |  P9 [        if A_i=A_leave then send to die
: G0 a+ v. _2 `3 ^" {" D        else inc A_i by 1: m& J! f6 a( A2 n% ~; F
    end
  x4 B6 o- y+ B0 v' \end
7 S; Q3 g- q$ x0 i* n% C$ P, @% i5 E1 O' _
begin P_pick2 arriving
" h. A! b7 N; G    set A_i to 11
" l2 v7 {/ O& }$ N    move into Q_induct2
% E( s+ E0 x9 K, }    move into pickaisle.induct2
8 L' m0 }* {/ m    while A_i<=30 do begin' r9 H8 {4 V- o; B
        travel to pickaisle.con(A_i)0 n% ]/ z; ~. _" Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: g+ z6 H" l6 N% ^
        else wait for 10 sec
" {/ ?* R+ c+ r" ^  x7 L" P+ {        if A_i=A_leave then send to die3 s' Q1 w; j; j% @4 }
        else inc A_i by 1+ I# e6 X( W1 r
    end+ m) g; o; {/ o' x/ v) u
end
6 d8 U: [/ w' \) A: z  a7 l+ q' R6 i/ `- U. P
begin P_pick3 arriving( O' c6 q- s$ W) _! x
    set A_i to 21- u& ?( {& i: W% S4 ^
    move into Q_induct3
5 O- W: a, Q' S; s* M# s    move into pickaisle.induct3/ \! B( l; P6 t3 c$ X
    while A_i<=30 do begin7 e8 w* K% n4 F# T3 o6 z2 P# O
        travel to pickaisle.con(A_i)/ C& X5 _* o6 }% k8 L, I" _/ m/ _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 B" f1 i' G( J9 ^! L% Y1 i7 Q* ~
        else wait for 10 sec( @8 Y1 P; l) ^" |* e! P
        if A_i=A_leave then send to die
  k- {5 a" r& }8 C8 Z: Z, c9 I2 E. Z        else inc A_i by 1
$ r3 K8 \- _" D& g- |" E    end  t" [! X4 R7 c8 e/ Q, u
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是个什么东东?
8 T2 N5 p& |+ X; Dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! Z7 h$ ~8 V. O2 s& K9 z, B; Z9 W$ [4 H( w! s# Z- x# d
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 _" k4 M$ M8 u9 c# l7 g
& ?$ u4 N- `8 k4 U1 R4 l  I0 I
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' |$ s* W! q; }7 K7 M" }* \
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 a1 g  L$ s, D$ `) g3 \2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' \1 T- ^1 y+ n) ^" J6 e
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ B. X8 I# O+ F/ m5 g/ a2 rbegin P_induction arriving  D* R2 B# g" [  d/ v
    clone 1 load to P_pick(A_induct)
: a( D  Z; ?) B- P9 Uend最大的系
& W+ P6 C8 {" D, k  |5 C! T, a! J+ i( v- a$ q; N% C/ Y$ M
begin P_pick arriving. o' d9 x) s: t% M; _* g5 X/ E6 S
    set A_i to procindex * 10 + 1! z9 ^1 ~0 ?0 Z9 g/ B
    move into Q_induct(procindex)/ }+ z% {; P) J; i, r
    move into pickaisle.induct(procindex)0 v+ D/ L6 ^& u* F4 w- ?/ J
    /*check the type of pickaisle.induct(i), for your last problem.*/
* m* l0 ]# S1 v: \1 f, g7 {
; @4 I: Z( X* X( y- _    while A_i<=30 do begin
) f9 n3 D3 ?$ F" j) N  m/ s3 P        travel to pickaisle.con(A_i)3 M! o( a. w' I) ^2 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' f" F% ?' p9 q$ j4 ~+ T
        else wait for 10 sec$ x8 Y# k+ Z& t7 a& ~& d* I2 O
        if A_i=A_leave then send to die
! X- I; b6 L6 @) Y        else inc A_i by 1
+ r5 k. U9 K! t! B! G1 O    end; q, V( \2 q: [
end
$ H) i' s5 c3 G6 ]" G6 g
  y( N8 a. c, f% s' i其中的procindex为整形,代表当前process的序号。( c  i( }- \& R6 e
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-6-17 09:48 , Processed in 0.016582 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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