设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14805|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# J3 s( O! ]  g0 q, R# L/ O, G' m/ S% D- G/ 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中的数值,不知道会不会有什么不妥。' V% D) w' y1 b$ O

* m! ~8 u- o2 ^7 l$ abegin P_read arriving
5 U% X/ H8 }2 O5 m" v    while 1=1 do begin" k' q) @* w& y8 O( q& b, ^: R; t* S; N
        read A_tote from "data.txt" with delimiter "\n"
% R& e  Z* x0 E7 n0 O- M( z        read A_time from "data.txt" with delimiter "\n"
6 J" ]: w! d. U7 y2 Z        read A_leave from "data.txt" with delimiter "\n") H8 J5 v1 E6 N
        read A_picks from "data.txt" with delimiter "\n"8 A( i( M, @$ D# m2 Y, @
        set load type to A_tote
6 M% U6 U, z: u+ Z  ]        if A_tote="tote 1" then set A_induct to 11 t" {! S9 J4 D$ d* L5 }
        else if A_tote="tote 2" then set A_induct to 2* D* U( G) i4 u+ Q
            else set A_induct to 3   
) _! E1 W9 T/ t        set A_i to 06 D9 I* J. a' [" ]" S
        clone 1 load to P_induction
% [5 Y9 |9 d; ~7 @3 M( c        wait for A_time sec
+ M' ?/ C- ^1 z( M6 Z7 G% D    end
1 B6 `, F  ]4 z, u" Y# `end& L# s: c+ P9 m
0 a. a4 O* ^& S  ]1 u# o
begin P_induction arriving, H; ^9 ^, Y: o9 ^) ?
    if A_induct=1 then clone 1 load to P_pick1
" F1 n# _8 `2 \  ?7 t+ r    else if A_induct=2 then clone 1 load to P_pick2$ F" J. z$ K9 g, _2 e2 W
        else clone 1 load to P_pick3
% ?8 e. Y" y# g8 h7 l4 |( N$ Iend. q& Q1 F% r/ c/ Q* c1 ~
1 _+ z9 [' B. c8 n, x5 i6 h
begin P_pick1 arriving6 K1 L* y1 \* U7 G9 {& R0 R
    set A_i to 1" M  ?( Z; t4 {
    move into Q_induct1
0 P, P# i0 N  X1 M& p$ y    move into pickaisle.induct18 o; b/ y, U( v4 v( k! Q5 Q
    while A_i<=30 do begin
- R0 T) l; r1 x7 u        travel to pickaisle.con(A_i)7 {) s3 w" L8 U6 r9 J' p! L$ c4 X1 D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 ?( k3 X7 A2 i: O        else wait for 10 sec
+ K1 k! ~* P+ M: S  E        if A_i=A_leave then send to die) N% s1 X( i% B3 r  Y8 [
        else inc A_i by 1. O& N8 [. y& ?; z
    end
3 l  _0 {% J) D- H) O) Fend/ @- _  N! T' l! R$ l" |

! ~: f  K! x4 R$ o2 hbegin P_pick2 arriving# C/ U" H  G3 F, |1 G0 t% u
    set A_i to 11+ U  f! s4 e8 E
    move into Q_induct2* C3 t# V1 x, `( y% [5 U
    move into pickaisle.induct2
3 |# l# Z/ X# e9 s+ u    while A_i<=30 do begin
- h# S! u4 _' o1 D/ C1 J7 T        travel to pickaisle.con(A_i)
% E9 Z) B/ B  V7 G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 X- {  q0 a. C$ e! z( i& c        else wait for 10 sec+ c7 m, Z$ y$ g- U8 h
        if A_i=A_leave then send to die
8 m+ T% Y1 @' Y0 H1 l7 w        else inc A_i by 1
2 @$ j' g, f* v+ v6 m    end
0 w$ ], M; N& }+ x% Gend) N& s* j( D9 W/ \  u* K) b& b

0 b& s2 J0 v0 q& Hbegin P_pick3 arriving( m& ?& V4 x' F+ t
    set A_i to 21
  `- F. a5 V) L    move into Q_induct36 G2 r* k. x5 S& [+ j3 @
    move into pickaisle.induct3
& z, [  v1 d; d5 s    while A_i<=30 do begin2 n/ |  Q* `" S' R
        travel to pickaisle.con(A_i)4 v. U( q% D/ d% \0 M) V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ T$ ?  c! @# `( S* X& ^7 C3 Q        else wait for 10 sec
0 o  @6 V$ M) V! j3 o. `# F* [        if A_i=A_leave then send to die+ E: s) R1 K/ K5 I4 j0 @
        else inc A_i by 13 e$ r( d) i3 m3 i- d1 P
    end
; R7 i& |. G5 h, Z/ H8 v3 ?3 f0 hend

最佳答案

查看完整内容

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是个什么东东?
( q; T5 {6 W& o6 O, ]& c6 amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. O  K9 c+ j: a
8 p$ V" X' j! h( Y: F3 o! C' j1 kAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& W; e1 B9 N+ s( f  v0 Y

3 s' r* r! x5 Y3 W( k+ o$ P另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:( K$ w- |8 F+ l% q# l0 b# R% b
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 S8 m4 I3 v6 Y$ ~7 ^4 H2 q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 l3 ]0 ~3 E1 t' Y0 s% Z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! N' }. k3 j0 v3 M9 k4 r' k2 ]+ s) u
begin P_induction arriving
3 o3 }% N: m* Q- K6 z    clone 1 load to P_pick(A_induct)+ Q9 P3 E$ t- M, Q1 a
end最大的系
, Q$ F% x8 y  |0 z* s3 ]
( X9 @) V) {" J0 b4 \; }begin P_pick arriving
, [+ `" q; `& l# s9 O- f8 G- w$ i: @    set A_i to procindex * 10 + 15 |, f% }7 ~: f. t% X( H- X
    move into Q_induct(procindex)
8 q' |" u- D# A$ J; o    move into pickaisle.induct(procindex); W  i# c% \8 [7 \
    /*check the type of pickaisle.induct(i), for your last problem.*/
( p) Q# s  D( j& \; k+ H3 Z' ]
4 Z$ A" d' ~& Z    while A_i<=30 do begin# o7 }: _5 [' I' W6 ?
        travel to pickaisle.con(A_i), R, b, R2 d- v/ v3 _; C0 A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' B: V6 n. g7 q
        else wait for 10 sec
5 _+ }4 z) {  V+ v        if A_i=A_leave then send to die1 J  a% h$ D5 K" s
        else inc A_i by 1- V/ j6 d1 U3 N3 k
    end
1 p$ E, f* ?% t$ |end
& U8 P1 X  `7 i3 l+ N+ r% g
% j9 Z) b" D5 b/ q: N其中的procindex为整形,代表当前process的序号。0 W& w$ W4 E8 ^8 ~- l' ~
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-7-27 07:05 , Processed in 0.014093 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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