设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11824|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! G: M! L$ ]" h2 Q
! |! k! p+ l; r  h) A我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ T! S/ f/ o, U$ z! C4 ^
- A3 c+ Z$ a6 W: t+ j
begin P_read arriving# H/ v$ E1 @7 A4 u1 I2 V
    while 1=1 do begin  ~2 _0 @% V4 Q" l
        read A_tote from "data.txt" with delimiter "\n"3 n! ?! W/ j1 W! m
        read A_time from "data.txt" with delimiter "\n"
0 ^# x8 ?5 J  j" H        read A_leave from "data.txt" with delimiter "\n": X) k2 H* K6 b  \8 _' A
        read A_picks from "data.txt" with delimiter "\n"
% T" y* f$ K) j4 t4 I5 ]9 m% n        set load type to A_tote
4 T+ i7 _. x. q1 x) x% Z8 X( a        if A_tote="tote 1" then set A_induct to 1
1 \# f2 ?( I1 [/ r1 A8 \& Q        else if A_tote="tote 2" then set A_induct to 2
7 e4 v6 C% R$ k0 y0 x  M& n            else set A_induct to 3      A! H& \" u: x; b7 m6 J7 R
        set A_i to 0  k( n. I8 V. `% r- n  Z
        clone 1 load to P_induction' T; \  q! |' D9 A
        wait for A_time sec( s6 }  t( W# ]& T2 ]7 J% m
    end! S8 q; S% t9 t0 y2 K
end7 j$ F+ x4 [; h

1 f# l4 {( R) {- a, r  D* Obegin P_induction arriving% V0 N. y6 f. T1 \
    if A_induct=1 then clone 1 load to P_pick1) x9 H4 p, T8 h6 C
    else if A_induct=2 then clone 1 load to P_pick2
& m4 R: y8 O) ^: [5 y0 t1 @        else clone 1 load to P_pick3
3 R* D( ~2 n& jend
# R9 y0 }9 N2 Q0 r
  P% f$ Y( _, p% f6 @" O  sbegin P_pick1 arriving* z; W( |2 |7 O& O" N1 o6 @. Q3 N
    set A_i to 1
1 W) T7 d3 E3 E; W! ^) I    move into Q_induct1
1 M; G3 z) E( `* A3 O4 T; `  t    move into pickaisle.induct1
4 D  M1 B4 s0 `+ R7 H    while A_i<=30 do begin
7 r0 C) l  ]' q. g. x( k        travel to pickaisle.con(A_i)
7 n, w; s/ S  w9 t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% d7 M3 o7 Z7 Y: ^4 Z& L9 G, i        else wait for 10 sec
8 Y1 `$ X8 O2 ]. Y$ f8 M# ^$ n        if A_i=A_leave then send to die4 m7 h; s4 m2 \( P2 X7 F
        else inc A_i by 10 m4 l) b4 d2 g
    end5 e# e" U5 a1 W) a' P, C
end
: C+ `3 {  ~& y5 N) _* m! [& `% t$ P! O" {4 v% N5 ]0 u
begin P_pick2 arriving
" Q$ L7 N5 N: s% o5 I% ?    set A_i to 11' g5 L3 B, C5 C$ v/ {# ~
    move into Q_induct2
+ ~: |! m7 `9 w9 |' z) c+ y    move into pickaisle.induct2+ L* Q. P5 M' c4 F: O
    while A_i<=30 do begin
7 o6 x9 f' x6 }3 l' C8 ~4 i* f) o$ D        travel to pickaisle.con(A_i)
. k) w( a. R( [% i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# m  H( t: r4 _/ _+ }2 U. I- V+ a        else wait for 10 sec+ G+ N2 n2 ^: u: e1 F
        if A_i=A_leave then send to die: j3 I$ g+ m# R9 @
        else inc A_i by 1
' I7 f& M2 D! k+ N    end6 _4 ~: f" L& [$ _0 @
end  b# X6 c5 l/ p  N1 H, V0 v0 w
4 u" L2 [3 L0 }" @6 _$ y
begin P_pick3 arriving! {; O% i* j7 P
    set A_i to 21
3 ]8 Y9 ]+ G: U* J9 Z    move into Q_induct3" p; W4 l8 ^9 Q% {/ g; S) W" p
    move into pickaisle.induct3$ [# c* D7 K: ^3 i
    while A_i<=30 do begin% U7 ^1 {: u7 c- l2 ]
        travel to pickaisle.con(A_i)
7 |$ t7 \7 Z% M6 R5 T7 \! {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* e( ?; |5 n0 O* p        else wait for 10 sec5 A# b% h4 T2 |  `* \; I
        if A_i=A_leave then send to die0 k3 v9 x4 K8 H) {
        else inc A_i by 1
) p( v- S2 u; d# ^    end
2 X! P% D( [# h* E7 `& ]& \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是个什么东东?
' k0 C: ?2 o' |( xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 L% W0 h2 s: t6 ^$ Y0 N
7 o) z, o% w* T' OAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 m- Y% a; }, C9 x6 H( w
. K% c, }9 J: k% k
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 N0 ?* T$ ^, J4 d% K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 F* P& N% M; e' B9 v
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 A1 Q+ `0 n( K8 a, q
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ B2 z* U, B$ B: Nbegin P_induction arriving) m  w. `3 q9 |" u
    clone 1 load to P_pick(A_induct)* w- m# U6 ?$ F1 y$ P( X
end最大的系
( _! n4 V& s$ h" j( L# @7 B
! X. L" e, U# Q& }# Qbegin P_pick arriving
9 a: D' {% i& k# @    set A_i to procindex * 10 + 1
: p+ P/ P$ n% b, D' y' i; {/ V) h    move into Q_induct(procindex)6 l; }1 M0 `3 c6 \
    move into pickaisle.induct(procindex)
6 u- m& H* y! u/ G    /*check the type of pickaisle.induct(i), for your last problem.*/
0 N& d2 p2 r: w3 |  J8 R2 l# \$ G, k5 J
    while A_i<=30 do begin) t8 f" k( Y# d. c2 b
        travel to pickaisle.con(A_i)- H+ P; W+ L; S1 c  `; A+ r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& W* M) ?$ T2 D7 ]1 s
        else wait for 10 sec  Z2 k# }# g; x1 G3 G2 G" v% h* Q
        if A_i=A_leave then send to die
4 z- Y0 J8 i6 c0 h& @        else inc A_i by 1
  ~% G. i5 T$ c    end
0 v1 }8 L! o: H# v- e0 N$ c1 J& j  vend* T, U" t3 o& C0 `8 u$ V
5 R  U; [! T5 r; ^, F. W
其中的procindex为整形,代表当前process的序号。
& U+ Q9 n- q2 C' [3 G; Fstation和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-12-8 06:28 , Processed in 0.018683 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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