设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15213|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- B" v8 ]2 V" q6 P8 c* p: Y* R
( |' k1 i% ]. x- P5 y我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 o5 Y/ H5 P! z! a% S* y( i" h- I% H# K& v
begin P_read arriving: T. C* q9 ^4 T, g2 E
    while 1=1 do begin
) J( y0 l  T7 D! z$ h        read A_tote from "data.txt" with delimiter "\n"
  U0 y5 T0 i3 g        read A_time from "data.txt" with delimiter "\n"
" |! Z  X& ], M7 j/ c, f        read A_leave from "data.txt" with delimiter "\n"
$ y- G0 [; r1 w4 Z( d        read A_picks from "data.txt" with delimiter "\n"; w8 k' [, L7 i$ z8 i2 \( u
        set load type to A_tote
6 a. j5 s. v+ b  H        if A_tote="tote 1" then set A_induct to 1
2 B2 O9 Z8 H4 n) ^' J& J        else if A_tote="tote 2" then set A_induct to 2
- B- t5 C' ^8 m1 J* P            else set A_induct to 3    $ i1 C, Z/ M! _3 e9 u
        set A_i to 0" Q6 ~; |2 }1 ]5 u  G1 k# o
        clone 1 load to P_induction
* T' u5 M( t( k: k        wait for A_time sec
, _& m" D& Z. Q. S# z9 @9 r    end
% {' U  U* o$ Lend0 ^5 q* B- R. m
# I% Z0 w" c2 v; z) Q$ s& Y" O
begin P_induction arriving
0 o5 ?( A& k' K    if A_induct=1 then clone 1 load to P_pick1( x! W1 u( b5 m
    else if A_induct=2 then clone 1 load to P_pick2
& C7 X2 S+ _1 q1 K, ~. l        else clone 1 load to P_pick3
" e- M, m6 S: S! v- yend
7 f# p( K" _3 l$ ~3 n0 A3 z% S2 l8 M5 _" b6 }9 R& n0 ^9 c
begin P_pick1 arriving
% Y' w. A7 w  H: X. I    set A_i to 1- B% ]4 h7 m1 T: F2 @
    move into Q_induct1' Q. A* N; _1 Z7 {! ~8 j
    move into pickaisle.induct1+ w5 @! b6 m( \& p; \
    while A_i<=30 do begin
% p3 O$ w' N5 H3 _" K7 C, J        travel to pickaisle.con(A_i)
1 n. d* e0 a* e' T- u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 ?! L% {. V  d( [( W8 I        else wait for 10 sec: \( ^. q) R, z0 I0 j5 N; g7 R
        if A_i=A_leave then send to die+ ^0 |0 U, w6 L
        else inc A_i by 1
* d- z7 i* c4 s" E/ h    end: L0 W% N/ L7 T0 Y4 u% [( G
end
) p5 O8 z5 }% ]3 U- X
: T# B: H1 S" l! w) K. Hbegin P_pick2 arriving& A$ \( X& O) |" s1 |, g9 x
    set A_i to 11
6 ~8 g( @$ V( a7 d2 @1 x/ [, `9 _    move into Q_induct2( p! r7 }4 V- a( O5 J3 w& E
    move into pickaisle.induct2
$ g6 n2 C3 I, Z8 q6 ^" R    while A_i<=30 do begin+ ?' ?3 B- X6 j% ~% q& |
        travel to pickaisle.con(A_i)
8 c2 ^7 E) j( J8 A  R* v' Z% Y8 D# X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ y9 r) E# a2 n3 x( W( e- H: _
        else wait for 10 sec- E% V/ v, r- W- i5 a1 q0 g
        if A_i=A_leave then send to die! j. J& X7 [" w1 Z& p6 l
        else inc A_i by 19 V4 Q3 d( L1 Y4 G
    end0 B  _; l6 ]$ ]" O
end
7 r* W, k' i3 T/ Y) |% M
  n0 p1 A& m% Y$ T; ebegin P_pick3 arriving( [1 g1 n) [* A/ h' e! s  h' t
    set A_i to 21
7 ~& J( P  Z0 x8 J1 v    move into Q_induct3
: x; h/ ^! {% i) |    move into pickaisle.induct35 Q8 J: j3 R6 h8 j! N2 |" s
    while A_i<=30 do begin
' _7 L+ A+ D" T/ _+ b        travel to pickaisle.con(A_i)6 V1 T! {% r  X# C$ ~0 E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ a- E9 d+ D3 b6 L! Y: I
        else wait for 10 sec7 y9 V0 ~! G8 S2 H
        if A_i=A_leave then send to die
. X1 j9 _; x& I        else inc A_i by 1
/ s8 k- L( s* c0 L$ w: {# s    end! G* h0 i' f3 h, q
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是个什么东东?
) I' j7 A/ x+ v, x/ k: Fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?5 R! l1 v. o2 `# r; V
' [0 t2 M6 g0 |. j2 T
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 z' _+ [# r1 [3 c0 ]% l  A
( U, `, L* j5 n1 S( {0 c. W
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
& K8 k: r. k4 C: d5 ^. I5 E1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. P& n2 t! D* l: h# I- t2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3 G. E! d5 p7 {) D3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; E- L. s6 v6 u1 m5 G, g5 G! S
begin P_induction arriving
3 @6 `/ u. O' ]! T( b    clone 1 load to P_pick(A_induct)/ r: o' \- `6 G9 ~. |# c5 P2 M
end最大的系! `! i" u) M- I, Z7 I- o

1 h; U2 F5 r# Z+ Nbegin P_pick arriving
; p# X7 U+ W9 [/ g# L5 t0 W. _    set A_i to procindex * 10 + 1
& \) f$ C* H; _7 p    move into Q_induct(procindex)3 z& e% B. g  c
    move into pickaisle.induct(procindex)5 p. m! i- M0 }- P2 T* y4 g
    /*check the type of pickaisle.induct(i), for your last problem.*/
  R+ g% ~: u6 H+ t: `5 V- G
6 x8 }/ }  q, I7 w; `3 Y1 G' O    while A_i<=30 do begin
. f7 I  x5 g- X* [7 ^& L        travel to pickaisle.con(A_i)
! x% v4 b! t0 ^- y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 `2 A; x/ l* ^' @, e2 U! ?0 {
        else wait for 10 sec4 O+ P3 u2 ~: Z7 E+ _7 O. Q  }
        if A_i=A_leave then send to die
+ l. |% O4 a) h2 a5 R        else inc A_i by 1& _8 W  Y; F* A
    end# @" T6 d% L+ k$ d$ l
end
8 ~8 B, G! F  ?: j3 V
8 `6 ^) E# D% Q6 [, V3 O3 \其中的procindex为整形,代表当前process的序号。3 g4 g% t2 r' Y/ ^, e% t
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-8-24 06:14 , Processed in 0.018604 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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