设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12980|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- h3 `( \5 C/ h6 _! A  O& `* b/ w6 V; F( m+ w
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' \" I* e* V2 ?0 a" O9 O" n

! z, p8 n7 `, \! @9 M6 n; Dbegin P_read arriving9 q6 T. r8 x9 Y- R% p( e& s
    while 1=1 do begin  L( E/ \; U: I3 j
        read A_tote from "data.txt" with delimiter "\n"
! F$ E) @% f) O; r" E$ f: N0 P        read A_time from "data.txt" with delimiter "\n"
# a' O4 h; d: l        read A_leave from "data.txt" with delimiter "\n"
' M4 l$ H3 Q* X' v% K6 c: ?- p        read A_picks from "data.txt" with delimiter "\n"# }7 T0 [9 p( J9 ^. ~- x6 O8 J) l
        set load type to A_tote
0 A1 H) g; \3 \4 K* D        if A_tote="tote 1" then set A_induct to 10 G; V& c4 b" n0 _- k
        else if A_tote="tote 2" then set A_induct to 2- X# D* j; S1 w4 O
            else set A_induct to 3   
( T7 i1 p  ~/ C0 }: u% l9 B        set A_i to 0
) |/ z8 j) }2 b- @" w; w; N        clone 1 load to P_induction8 k6 ]( K; C+ J! l% M
        wait for A_time sec
& o6 c7 a! \2 |% F) n6 Y( z/ t) J    end
2 E" T+ A  F( m; G- I/ Rend# a4 j9 y$ y1 Y; ^
2 A+ U1 i! w4 K( \  B( H+ ^% f
begin P_induction arriving& ]! j( Z9 T& S- e9 l( y
    if A_induct=1 then clone 1 load to P_pick1
; a  g% s# g0 H- L& s+ X4 F! u    else if A_induct=2 then clone 1 load to P_pick24 U0 u) D9 W6 {) q% g2 p) I6 W
        else clone 1 load to P_pick3
2 l8 z3 e$ c5 n0 f  N/ Fend6 P/ C# o: M8 f1 F" |; K
+ z3 q% [( j4 @  f3 `; X2 U
begin P_pick1 arriving2 g* J  t5 r8 w4 K3 d' B' J( W/ \7 [
    set A_i to 1* a( M' y1 x% B# |) @, t7 x: m
    move into Q_induct1
6 T: K9 \! q# a# l* r. S    move into pickaisle.induct1
4 S$ w) ]  c" ]( b    while A_i<=30 do begin9 D; X8 P1 U* [4 H) ?4 E
        travel to pickaisle.con(A_i)
5 M& g6 {6 A" C1 y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 C/ H9 q8 m7 v3 n" e/ c2 r        else wait for 10 sec* V1 d9 X4 Y/ i3 ~
        if A_i=A_leave then send to die; ^0 s* R. b, c' D' w& j: d
        else inc A_i by 16 f( Y6 |, z% x) D
    end# F) q2 H/ S: X+ A) D! x; I
end
0 a3 F( A/ S( \' ?. m* P5 o) J: o; u) o5 F
begin P_pick2 arriving, Y4 t& P8 X9 d4 [% K
    set A_i to 11
; [3 s  j" c5 z* y: c    move into Q_induct2% \7 l. |  }: O, F! R
    move into pickaisle.induct2
, _4 T4 S8 F& q. A    while A_i<=30 do begin+ {; l* t: j6 M; p& f
        travel to pickaisle.con(A_i)
! a' Q* q  o  }0 v, ^4 r8 E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: F9 I$ |; M# G
        else wait for 10 sec
3 h& G2 f$ V  x0 q; P0 A. h- w        if A_i=A_leave then send to die
! v8 Y, y0 ]% s' C; O4 }& U6 \        else inc A_i by 14 t8 _9 n% e5 G+ P/ z
    end
7 g/ }2 O$ V  J0 n3 T( Eend% L' U# ^6 k# `4 y4 W2 V
& g% F, @0 g# t
begin P_pick3 arriving6 E1 ]8 |$ m5 c! y8 l# X' c, O
    set A_i to 21
% M# P7 ~2 O7 {( n" Y# I    move into Q_induct3
- g" W9 P- s) t5 `    move into pickaisle.induct3' g5 s( Y0 I4 n
    while A_i<=30 do begin) R4 v- p. ^1 y: {! h$ z) W" y
        travel to pickaisle.con(A_i)8 R0 K% a/ b, q) {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 ~4 H0 e3 n3 o8 n$ N) T$ H
        else wait for 10 sec
* D3 n. x0 n1 h8 J% G        if A_i=A_leave then send to die6 i7 @" @% U& T+ m5 Z
        else inc A_i by 1) w7 P( W% C0 i: a* W( E7 K
    end& H  A1 Y3 E3 N9 u
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是个什么东东?
, e/ V- ]( S* a* z4 w* Kmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# l" ?5 g  b6 y& m. K" C
! V9 V' v( c) b* A* B9 {: U
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
2 l; R0 p3 ?7 B3 x$ B1 i6 k
4 p! E( d$ Z0 Q. y* {# ?' Q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' t7 |5 s6 n# o. f+ O* P
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 X8 p2 s; p; r9 [. Q/ m4 F! i
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' P6 U. H- _; Y( `
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 a3 G* v% \6 L( u* w9 R$ v
begin P_induction arriving$ g  d, }- P: |
    clone 1 load to P_pick(A_induct)
! N& q& R) \1 z1 @4 B/ }% X) W7 rend最大的系. o8 B7 ]& t: c! P
. P2 L8 B  }; t+ E8 v( g
begin P_pick arriving$ [$ S( @& N: b9 J, Z4 N$ f% u
    set A_i to procindex * 10 + 1
8 d# D( y4 k! N    move into Q_induct(procindex)5 c) l- L, |1 s) m3 S9 A
    move into pickaisle.induct(procindex)6 ]4 m1 {& ~3 w
    /*check the type of pickaisle.induct(i), for your last problem.*/
3 m/ c& V( n$ F$ n
, ~7 _( R- a# i    while A_i<=30 do begin0 k' D% \8 T8 U0 G* E% `
        travel to pickaisle.con(A_i); K5 V% [: {" e, ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. B; f& r5 X$ u# z' i. {6 w
        else wait for 10 sec
0 x3 B# \* \+ |* }& U, F4 D        if A_i=A_leave then send to die) L" @: K/ w  I
        else inc A_i by 1
: b( p! ~! A6 h9 @    end
  \+ L+ L& X' ~# Mend0 ?0 o/ w( C6 i/ }
/ o; `( u2 z$ X
其中的procindex为整形,代表当前process的序号。
$ b; P7 d, X& ^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-7 12:01 , Processed in 0.014545 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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