设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12548|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ Z  B) {! i/ h# E8 k$ T. Y
$ g8 u' f- ]/ d! a- t; v我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' t- i9 r: a  M
# }7 H. H; w7 F/ o# h# H4 Bbegin P_read arriving$ I9 d8 K  h" h7 Q+ [, E
    while 1=1 do begin/ F$ g7 f: f+ j# v2 s  |
        read A_tote from "data.txt" with delimiter "\n"' c9 N( m4 E* {- m
        read A_time from "data.txt" with delimiter "\n"+ j4 w, @2 H2 c  t& p3 R1 V
        read A_leave from "data.txt" with delimiter "\n"
! x7 x3 L& E; Q, q+ p, Q. @2 w        read A_picks from "data.txt" with delimiter "\n"5 O5 W* h, M+ {6 f: d) E0 g. I
        set load type to A_tote' M) Z9 J( l3 V. r7 f
        if A_tote="tote 1" then set A_induct to 15 L# H" \9 |; P7 ~
        else if A_tote="tote 2" then set A_induct to 29 q/ x5 r. h7 f1 A( o
            else set A_induct to 3    5 c0 @* s% }" }* Y/ J/ o; I
        set A_i to 02 `" d4 n. H% x7 v0 s- {- ^- ]+ _  {
        clone 1 load to P_induction  J! T; y% D0 ]9 Z: l8 ^
        wait for A_time sec# |. |) C. S: p" ~: k- P* N4 p3 t
    end
0 f/ Z. s, l* _end& p8 \5 U9 S  `' |* v% Z8 Z
. z  `% `- x0 W
begin P_induction arriving
; o! a' C- j3 z% v6 X    if A_induct=1 then clone 1 load to P_pick1
& V5 y& [# F' G$ c" i, ?! t, B% Q    else if A_induct=2 then clone 1 load to P_pick2
6 |' g* W4 j: ~3 m, A        else clone 1 load to P_pick3
: I& v+ N# _  V+ D0 aend
/ u  v9 e# Z+ w1 m! _. Q3 b6 O$ _( b& S: I
begin P_pick1 arriving
9 j. u$ T( d% A9 H. ?    set A_i to 1- w! u- U" r7 l( t2 I
    move into Q_induct11 k3 u3 H- ^5 `5 J+ i5 R0 y4 f
    move into pickaisle.induct1
/ K4 D* u0 h+ n& k+ f# }    while A_i<=30 do begin/ e! j: [( C, `+ f+ V( ~! h/ b' g7 U
        travel to pickaisle.con(A_i)3 @$ R5 J2 q! d) B9 \7 L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. S. w. Z4 ?/ E- l% z        else wait for 10 sec+ |, m" x5 f. M" n4 M# J1 ]
        if A_i=A_leave then send to die
! z2 b5 l+ A+ R& w        else inc A_i by 15 n+ {% i- O* \/ u9 f* |' C
    end% x9 k1 ]2 G( z, I$ i5 R2 ?' l
end, Q) n9 O8 Q4 e% u

2 \0 g) m$ {, m7 J4 e8 m' Tbegin P_pick2 arriving8 X% K5 k. D2 }% c/ v  J/ o/ t
    set A_i to 118 @4 [9 p8 w4 y) c. d& N0 W
    move into Q_induct2
4 t' Y6 i8 N4 [- u    move into pickaisle.induct2
1 ^9 l) \" a+ |5 `    while A_i<=30 do begin
( z0 h: e# b! c  l4 t' y- s& v2 D        travel to pickaisle.con(A_i)# m6 b% n+ Y& w3 C  A- ^- f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' G$ U' _' _6 m. _. E
        else wait for 10 sec' G4 D  p. h+ L! A$ U2 W
        if A_i=A_leave then send to die
" X1 [! b' P* I8 i        else inc A_i by 1/ C4 |7 u- b7 P6 h
    end
" p0 f! C  h7 ?8 Hend$ V$ J  R4 I2 z$ k

+ }! g  S' K0 D' G' ?; dbegin P_pick3 arriving
7 [8 C0 K+ v' a" o& r1 S& g3 h    set A_i to 21$ b* {9 y9 M9 ~/ `
    move into Q_induct3# E" r6 H) y( o( j: T" @( p. Z
    move into pickaisle.induct3. f& K# L. ?+ f2 u1 q. E
    while A_i<=30 do begin
( p- o- z# F; R! }3 F        travel to pickaisle.con(A_i)
/ a2 p* R  J) y% x5 b* ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( l8 B% X: u: k* }" k
        else wait for 10 sec# h5 R% y! M, A
        if A_i=A_leave then send to die( A8 M3 C+ F2 Q! \4 j$ ?  l" w# w
        else inc A_i by 10 Y7 ?' M6 B8 d4 D; U' w* ^/ A
    end; g: N$ s8 n3 s# Y- Z
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是个什么东东?) B/ s5 K! p9 I; K, u9 }0 P9 I% H
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 B* Q0 y( J7 D8 E. p+ I. S) T& j- T) Y8 {2 a
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 f' r! f! V" q- p" A4 ?

3 f2 e7 L3 ]5 o! d- t8 H另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
) q  H9 V) N6 i; M0 U  n1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% ]0 @" |% k7 E% l
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" F( c  I! G% v' J! d* i3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' Y' c; [3 e8 _# B; g
begin P_induction arriving
- D1 H! d, n/ v& S    clone 1 load to P_pick(A_induct)4 g2 r, O4 x. A1 b* Z' t
end最大的系
, @* m- S& M8 B
: v: K$ a2 C1 ^7 abegin P_pick arriving3 _# a  j% v' j: K, i& c1 V
    set A_i to procindex * 10 + 1
0 y9 M/ R7 f) H, F    move into Q_induct(procindex)
/ R! i( y# B: X4 [  g    move into pickaisle.induct(procindex)$ X, n; Z* w6 g* |9 \
    /*check the type of pickaisle.induct(i), for your last problem.*/
5 P! L, N$ c8 K1 S# [- n& M% F4 E
    while A_i<=30 do begin! l9 i6 d* X2 g, G% n
        travel to pickaisle.con(A_i)
; m( u# k3 U, J0 ?3 h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ h1 Y& ^( o, O* X$ w3 o        else wait for 10 sec! I# [/ e7 U; L) x% ]$ @+ P
        if A_i=A_leave then send to die
1 F' x2 Z: u; n& }) g        else inc A_i by 1# z  ^) U/ b9 v  t
    end1 l+ }8 p1 d' M9 S+ [/ n! ?0 K4 c
end
+ U5 U  ?4 O( h) @+ e& J  o  B1 c/ N9 A! r% L1 P; Z9 E5 N
其中的procindex为整形,代表当前process的序号。
% T3 Z' ?( J; S( x: qstation和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 09:46 , Processed in 0.022435 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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