设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14301|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) S' _$ m! e# J# x! {
4 a* _/ b- W( H* R0 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中的数值,不知道会不会有什么不妥。
3 |- c- W: M% ^8 P1 H& I
* ]8 u% q+ v; ?8 _5 Hbegin P_read arriving
. T0 Q  m" X$ x8 s3 \; v    while 1=1 do begin
+ i6 V6 D$ H' z/ [. L) o        read A_tote from "data.txt" with delimiter "\n", f! N! r9 n/ q) m$ w: b9 }0 `" g
        read A_time from "data.txt" with delimiter "\n"
/ e1 g' p3 B' {6 g        read A_leave from "data.txt" with delimiter "\n"
5 D8 Y: H8 n! D6 ?        read A_picks from "data.txt" with delimiter "\n"
8 r; `/ z$ r- H& L6 W0 N$ i: ?        set load type to A_tote9 @; Q% U1 Q6 f- w1 k
        if A_tote="tote 1" then set A_induct to 1
% d$ A0 M# l6 T        else if A_tote="tote 2" then set A_induct to 2
8 `  I* l  E; l2 z+ c            else set A_induct to 3    3 K) f. h' x/ h' f7 |
        set A_i to 0
( ?5 {) }$ N  i: i( z. o4 ^, `% N        clone 1 load to P_induction
. ~8 Y& F/ ^: F& D8 y% @0 Z        wait for A_time sec
) f, F" `# @, D# x$ }# K! i3 R8 t, m9 L4 F    end
& {8 k2 i3 M' _3 oend
3 s; p6 c. k' X% J  C9 Y4 T( F. o' Q
begin P_induction arriving6 \/ h! }; o$ z, U% A5 o- \% y. a
    if A_induct=1 then clone 1 load to P_pick1
9 \- f4 j/ u; n$ L5 I8 d    else if A_induct=2 then clone 1 load to P_pick2( M4 P% x! ^. h( z3 `
        else clone 1 load to P_pick3
7 e2 `& J+ k1 Q9 M( N  d. @- `end
8 ?4 Q: G  K) v% B
, h. S% p+ o; x4 Z" Ebegin P_pick1 arriving
& a/ K/ M( e5 u7 s    set A_i to 1  ?% j0 Z6 S9 [# A1 S6 J9 I! Y
    move into Q_induct1
' \. {% y2 e, B: u7 v    move into pickaisle.induct1, C7 Y- g+ j, V" {% _- u
    while A_i<=30 do begin
9 T% O6 Q7 ~8 g; C        travel to pickaisle.con(A_i)
3 v& P, I6 ]6 z& l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! {) l3 T( B# e) J0 ]# r+ T, w        else wait for 10 sec1 I3 L$ `5 z: Y1 H
        if A_i=A_leave then send to die. G" A* `! e( k" e6 M: C
        else inc A_i by 18 A: y8 B# k7 y6 S" W1 g
    end
( o* c; m$ U0 U6 G9 E& S* rend
* `9 ?+ F, Y4 E( J4 o$ @, {* W
2 W+ v" A( {6 [' ~$ ]' lbegin P_pick2 arriving
# t. c% L7 P) z& l    set A_i to 11' z! k9 l5 [/ {' T% Q7 t
    move into Q_induct2$ J+ @$ i, d# j* q
    move into pickaisle.induct2
6 b$ ?1 d% T. h$ E; T4 z    while A_i<=30 do begin
7 y  Y, P, q' D        travel to pickaisle.con(A_i)
& I6 l. x8 {/ d, T3 b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  i1 _& _- D! m2 A6 b5 |. `        else wait for 10 sec
: i' g* a& u( ?3 Q! n        if A_i=A_leave then send to die
6 ~. \: o/ u! k9 Y0 y# r4 s        else inc A_i by 1* M0 H# C& z* E- [' g; P4 u) c' `
    end
! Y) ^2 @% s% N2 [5 c0 ?$ q8 \5 S2 Pend
* l7 [6 T& a5 b9 N: l8 j. n& Z$ w
begin P_pick3 arriving
" H& G* T, O* R& m* L/ n    set A_i to 21
. W. D( h4 [- Q    move into Q_induct3
7 e+ Q4 Y0 a  }$ U/ g    move into pickaisle.induct3
) f& f5 i0 u: }4 E, l; h    while A_i<=30 do begin/ E, W0 F% s0 K' U# H9 k( e9 E
        travel to pickaisle.con(A_i)7 H0 p# h& ^1 `" h4 H- G3 t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( }7 p4 v6 Y/ F' m0 b& ]4 C5 H        else wait for 10 sec
8 [' Z* c) A+ |$ {' l7 a$ f" v: K        if A_i=A_leave then send to die
2 f# G2 [' S9 W  S) a9 s! s        else inc A_i by 1; q( J7 r0 ?6 Q/ D- S# o4 M
    end
) Z( ]" W' ?* aend

最佳答案

查看完整内容

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是个什么东东?
, z1 F7 z: A- E, f6 w: Xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?0 U1 P$ `0 _6 w/ Q

2 ?) a, Z4 O3 S4 s; H3 @$ ^AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. P" t, `& |! I
/ x& w- q" U& Z4 [! ~; P3 A! ?另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! |+ [8 @* z5 ~4 _+ F3 d  H
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 T3 o  G+ K0 n; A2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ O6 p% _* }! R/ q/ m6 N3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 |9 `% R3 _* T+ @2 k# `6 z# tbegin P_induction arriving
" ?1 e$ y" `! Q  z    clone 1 load to P_pick(A_induct)
1 M3 G! Q! `6 k4 t) lend最大的系2 R8 ~7 Z: l" }3 N

7 X2 ]4 n1 W& V% O* p2 i$ E# |. v; ibegin P_pick arriving9 [0 v$ w" J( R' w* C  i2 H
    set A_i to procindex * 10 + 1
2 d8 I: q5 x' ~! R( T. W    move into Q_induct(procindex)* e+ k( M. k; |" r& M
    move into pickaisle.induct(procindex)( \3 a! o  H2 k# B2 S
    /*check the type of pickaisle.induct(i), for your last problem.*/, c$ u) Y9 @, C

7 U8 y+ [; h6 ]) f6 \, s  Z    while A_i<=30 do begin
. S/ n9 P4 U" G8 g  v1 d, z        travel to pickaisle.con(A_i)* J0 V$ C4 Z, J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% D- `6 Y5 t' Y% Z        else wait for 10 sec9 S6 k# z) d# ]8 A
        if A_i=A_leave then send to die. K* L( r. \3 L# L* p  S1 K+ [* y
        else inc A_i by 1" h+ y6 }5 u1 ]# Y5 m! c
    end
! I1 R' x5 w& |- n9 Uend
1 Y- c  u; n: z9 X- `  u7 K5 ^
$ Q3 w# M; B1 M0 c9 n其中的procindex为整形,代表当前process的序号。
( K1 u( u* c3 D' ?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-6-30 00:36 , Processed in 0.016295 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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