设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11591|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, [/ O. u3 G# A& @/ E) {
6 p9 Y+ Y" l% 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中的数值,不知道会不会有什么不妥。1 o6 v* _/ l5 b/ S" z

! S( n2 m! Q. R; `0 Ybegin P_read arriving
/ n5 N0 P, I9 K- f2 H' N+ {0 ?    while 1=1 do begin
$ W3 T/ G. j5 S" J0 O- D& i4 ?        read A_tote from "data.txt" with delimiter "\n"/ ~3 O) a3 R+ X* o4 r+ P
        read A_time from "data.txt" with delimiter "\n"
1 W$ a4 Z' ^- k) s. T- E, d        read A_leave from "data.txt" with delimiter "\n"
" |( s- C1 n$ C( w" `( ]' Y# e7 C        read A_picks from "data.txt" with delimiter "\n"/ D6 E" i- v( e: z! D& o; o1 T
        set load type to A_tote" g( i4 X* _# C' B% x
        if A_tote="tote 1" then set A_induct to 1- j0 r$ O1 T$ ^3 J
        else if A_tote="tote 2" then set A_induct to 22 |% O4 S9 U8 ^$ Q" V' G  e
            else set A_induct to 3   
  [3 N* c1 |% O: B3 x4 e* G6 H        set A_i to 04 X" {' G( f$ q( D: G# h
        clone 1 load to P_induction! m3 d8 w5 j- ^3 z$ h1 |
        wait for A_time sec
+ u. U2 y* q/ J/ o    end2 g/ x" q; D. \; j1 i, L! N
end
9 w" v9 a9 Q0 T# Y! g8 D& x0 O  d& J, d/ a) u/ Z% U8 v* O7 c8 F0 g
begin P_induction arriving
$ v4 \1 j+ C5 i    if A_induct=1 then clone 1 load to P_pick1. S2 w1 G1 k/ i- }7 r
    else if A_induct=2 then clone 1 load to P_pick24 a8 p( ]* O5 R$ T
        else clone 1 load to P_pick33 m& l* h- {' l! L3 d( n
end
2 r: c" Z. D" Y, i& c/ A
. B( A* ], `  V$ o/ E5 p; abegin P_pick1 arriving
- G6 ]& W: }3 _( Z0 a    set A_i to 1
, {* r* w. j' q; V2 I    move into Q_induct1
7 N- Y/ c3 E8 _4 M    move into pickaisle.induct1
6 v3 F* [( }% c    while A_i<=30 do begin
8 I5 V! q; V" a6 @  n" F        travel to pickaisle.con(A_i)
3 G9 h' y* z. x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. T# E+ r* D" w
        else wait for 10 sec
* _$ w- _! T$ p        if A_i=A_leave then send to die
: I6 G5 m0 r; |2 j! b        else inc A_i by 1
5 z7 `! `" A% k    end4 o8 g2 `3 n/ J! m  ]: t
end
1 s* X, ^5 p+ \. N" y: D( N5 b
$ b) `2 V- L8 n* h: _% q  ~' Wbegin P_pick2 arriving
- e2 R/ }% h% M- l/ d, R    set A_i to 11/ c9 F1 |* @1 Y
    move into Q_induct2( X& x+ v- ]/ K2 Y! }" A7 Y
    move into pickaisle.induct23 C2 O  e* X3 L1 p3 |. L
    while A_i<=30 do begin& H. J; C# f( x/ m
        travel to pickaisle.con(A_i)
5 _1 G2 q  v- U" a0 h# \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 f9 H! r" p1 X, [5 {& V" ?        else wait for 10 sec& ?8 F. ^8 r% N% L
        if A_i=A_leave then send to die
. K6 M- F; R0 h, @  j0 \0 t# l" N        else inc A_i by 13 o, x$ o/ S  k6 U
    end, x2 k6 K2 G- l9 K% ~
end
8 `9 S  P) Q$ a& l. T2 T5 c. \% ^1 Z9 `- N  @( ?6 |- r" }
begin P_pick3 arriving, j4 [+ A6 v" O- f- j: W  i! e% o
    set A_i to 21# b1 ]  a/ y6 }( _, E
    move into Q_induct3/ n! i1 w2 ^& D! r' q9 E; n
    move into pickaisle.induct3
- x' q* x9 A* `' l9 Y7 l    while A_i<=30 do begin5 O2 H2 w4 [" b" i
        travel to pickaisle.con(A_i)
7 u, J- v, a9 T1 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 p! D2 P) e, q8 X; _5 `8 N" x' }
        else wait for 10 sec
; K* a- `2 v6 }; B        if A_i=A_leave then send to die4 G4 Z' }1 p% j7 [
        else inc A_i by 12 g! `" G2 S  W' b+ ^
    end
9 a; F0 j# M. Jend

最佳答案

查看完整内容

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是个什么东东?
4 h4 I8 V( h$ ?+ ^7 \  b! tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& X0 m0 ^3 I' f5 D4 I
) O5 t8 Q" p- t8 X- j. VAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' }9 y* T. u; M6 G( m

( {; ?+ ]* w3 a另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% f% h0 L6 y  Y  H6 J: e4 Z; f& e1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 _7 _' h$ A" O3 N1 M2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& ~' _" B3 B7 Q( g3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ k! X0 ^4 v9 W7 E! x3 ~" d# N
begin P_induction arriving
5 E" Q8 D: b' x2 b9 S8 P" N    clone 1 load to P_pick(A_induct)# d. H9 E" D0 @( E
end最大的系
- e0 N$ K" x1 j1 z/ v' U; m% N- Y- ?
begin P_pick arriving
" u9 B& n2 W2 j& j0 B. l; e1 D    set A_i to procindex * 10 + 1
' g; N! M7 v! I: K( P' M- r1 N    move into Q_induct(procindex)7 o5 s+ U$ l4 y. I
    move into pickaisle.induct(procindex)
# ]. R  u- Y% J# ^5 l" m% N    /*check the type of pickaisle.induct(i), for your last problem.*/4 D2 u( _2 B& m

: Y+ ]+ h7 W. a0 A6 t% S( [    while A_i<=30 do begin
( Q5 N, e( h8 M. o1 t# Z9 x2 v# V        travel to pickaisle.con(A_i)7 d- P) \3 F+ B0 c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 S$ j8 `; h* c9 m( |/ n        else wait for 10 sec' t3 f' ?0 e  ?' u7 A
        if A_i=A_leave then send to die0 C! T4 h2 {  X% }0 z, r  j/ e
        else inc A_i by 1
* ?/ w- c- \# ?* v# t    end
+ |6 o) a9 `! f3 W- Hend
1 W8 O( d# w' D* U. w* N  s3 n, ~* s4 s. g
其中的procindex为整形,代表当前process的序号。
# E( Z4 G, u7 _9 u4 l7 A8 ^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-11-22 12:51 , Processed in 0.019324 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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