设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13021|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* s  M) H& W0 u" i
' p1 |9 T1 @  }( z% R8 e' C( I我的问题是,在每个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 Q9 z4 Z& G& _# k
* U6 c4 Z' x( [  D8 e
begin P_read arriving
7 r8 Y$ F& {) @- W    while 1=1 do begin
* ~( k4 L! k" C- h: q; Q( v        read A_tote from "data.txt" with delimiter "\n"7 o1 W4 f, c# k% u/ j& V+ a/ h% j
        read A_time from "data.txt" with delimiter "\n"
# J2 W8 X' o% K  V1 n        read A_leave from "data.txt" with delimiter "\n"
2 o& I* ^( x6 B: g. g$ U        read A_picks from "data.txt" with delimiter "\n"
8 y- Y1 u- ~# `5 n3 x; e& T        set load type to A_tote
+ I8 \8 a  C5 p% ~        if A_tote="tote 1" then set A_induct to 1
: ]% X" @% C$ Z2 }+ R        else if A_tote="tote 2" then set A_induct to 2
7 Z5 k. H5 R- `            else set A_induct to 3    * ?7 l, H/ k2 [6 N( a, t/ n' T
        set A_i to 0
4 C/ [1 L" b. Y$ i% Z  c        clone 1 load to P_induction! b7 s3 o& }+ u; ?: R% g
        wait for A_time sec# m! o7 H* H- s0 H- ~# R# Z! C
    end  U5 z  |) s+ O- y. h6 V
end4 U3 I; J' O( c/ M

: s0 w' F0 A3 {! E9 pbegin P_induction arriving+ U0 Z% [6 X/ K
    if A_induct=1 then clone 1 load to P_pick1
' F, l) l# L! z& Y  n/ O* G+ Y  K( q    else if A_induct=2 then clone 1 load to P_pick2: n3 r( g. Q3 y. P( g, {
        else clone 1 load to P_pick33 s9 P; \2 U% t# H7 \1 B6 c0 Y
end
" u+ b' G2 k: B1 q. _/ Z0 D* t0 f6 o/ k8 U4 ?4 K+ G
begin P_pick1 arriving
$ V. E8 s$ d0 s2 v. a4 z9 A( A; |, e    set A_i to 1
9 q% p4 I# @# c9 d$ d    move into Q_induct1
* f, s; Q. o% }    move into pickaisle.induct1, v; V) P7 }9 [- Y4 g
    while A_i<=30 do begin( Y& @3 O& `* z# p, ?2 O
        travel to pickaisle.con(A_i)8 q' ]. F- g" n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 d/ m; \; X# f
        else wait for 10 sec7 E4 ?# \4 g; s  W- H6 u
        if A_i=A_leave then send to die
6 y/ {* c4 [* Y7 N* L- ?) w        else inc A_i by 1# n8 |6 `0 a$ l0 ]5 a, x
    end
* U" y% Y: ~! ^  l* Z# `end
: m8 Z. s! @) D  I7 \! ~7 S/ g1 \
5 ~$ A# V2 A: w! K& {begin P_pick2 arriving! v) h+ V. t8 r- s! ~
    set A_i to 11
5 {1 a4 B1 }/ G+ M  G    move into Q_induct2  g. i) d4 K1 L4 c/ w) H8 Y: ~7 s
    move into pickaisle.induct2
4 z- N! i  }+ _3 l+ Z: Z" Y- e    while A_i<=30 do begin
/ C4 m  @# O, F& o4 `        travel to pickaisle.con(A_i)
/ O; }+ I3 k# K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% V  `9 B. `% {6 {2 h: d
        else wait for 10 sec6 a  w9 Y8 \- z5 R& s$ M5 L, r
        if A_i=A_leave then send to die! |, h& E2 s( K- ]9 F. ^, G" p1 X
        else inc A_i by 18 f1 ]' v5 _: ]1 n
    end" l( R2 b* }/ ]
end% g3 _8 Q! }; _7 }& a0 A
& }! e( S. b0 E# W2 ?1 L
begin P_pick3 arriving
% z8 f4 P6 I. A9 c0 n/ @9 S% w; x    set A_i to 21. m! r7 u0 {4 \8 m$ J" C! _- z
    move into Q_induct3
& ?! w; F0 ?, y/ i* R$ x7 ]; a    move into pickaisle.induct3
# Q, F+ S! z; s# |    while A_i<=30 do begin& V, I  {) ~6 H% ?* C
        travel to pickaisle.con(A_i)
/ ?3 k, T- U8 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 E" G) {- F7 {" f' l8 J        else wait for 10 sec
( h  y: J0 U3 J- D4 R$ J2 S5 B        if A_i=A_leave then send to die
' b8 @2 C! {7 s0 F1 e# d( \        else inc A_i by 1: _7 [* j% W& j# M4 U, X
    end
) h: j$ m3 J, f0 j+ F. _# t* rend

最佳答案

查看完整内容

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是个什么东东?
) G5 B$ k3 W0 qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; @* G, i4 k; e% B3 \, s
/ l% K  f. {4 [1 T" H+ I
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ X6 F+ n( E- U4 V( @0 P7 F+ I

8 ~4 |' v. v7 D另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 w2 o  }( D5 W0 i, A. Q0 K- B1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" o; D/ |! d, e* z8 e
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 F. B; r. _7 ^* r3 ~3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 k1 O' A- @- I1 I) s3 S0 j' b8 T
begin P_induction arriving/ b* v& z& M4 a+ I' O9 N2 a
    clone 1 load to P_pick(A_induct)0 M" K+ i0 Q5 E6 f/ W" P4 o9 E
end最大的系
8 E* H, r2 i& ~+ l) J/ ]& \7 a2 r& ^& B1 g
begin P_pick arriving# Q1 N# q% o2 U4 c. H9 f3 f
    set A_i to procindex * 10 + 15 ~% k7 u8 n5 W: W" ]7 _9 X0 ^
    move into Q_induct(procindex)6 \% l/ L1 ]: t0 {7 p# u
    move into pickaisle.induct(procindex)% J1 y1 |# f+ {, A8 a/ C1 U
    /*check the type of pickaisle.induct(i), for your last problem.*/4 r+ H; }' T' p2 y
4 S6 f" W: Q( f, _+ D. g( }/ l
    while A_i<=30 do begin
& _. [) V8 u8 ?: ^. }* H) w        travel to pickaisle.con(A_i)7 B8 x5 V0 K8 Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  N9 p, C8 v9 w1 v; n: c0 `# u5 z
        else wait for 10 sec* g# u1 d8 |$ W" o- ^9 O
        if A_i=A_leave then send to die9 ~9 u7 |9 w, I# m
        else inc A_i by 16 A. f( d  c% Z$ b$ P/ T
    end
( V" R9 a* |% b+ N/ e4 {end( k6 |6 Y3 K' o# c# p+ z
) Q9 ]) q* C2 ~0 T" `8 o
其中的procindex为整形,代表当前process的序号。  y7 c! D# x0 M8 L  n  h# j
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-3-11 18:12 , Processed in 0.015148 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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