设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13720|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: W9 f: q! g+ v) j3 }
; v; D; D: R2 H% D我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ @4 ^2 W9 r/ @2 Y, G# G) ^% I  l( I. q9 L6 m4 W6 r9 J
begin P_read arriving9 @' ?5 ?+ J3 T6 V: a" c
    while 1=1 do begin
  S3 ?9 ~0 ^) v. d        read A_tote from "data.txt" with delimiter "\n"
( _, ^8 [* `" F8 I8 y' o7 u        read A_time from "data.txt" with delimiter "\n"
; E$ s' `* {+ ^$ T3 A        read A_leave from "data.txt" with delimiter "\n"4 d" Y; A% W8 [  w5 c& J
        read A_picks from "data.txt" with delimiter "\n"0 z) e7 [/ ]- j
        set load type to A_tote+ ~7 o! Q( V8 L1 Z7 P/ |
        if A_tote="tote 1" then set A_induct to 1) c* H) w; g& P8 T- s( e0 a- F
        else if A_tote="tote 2" then set A_induct to 2
9 t  L9 K, r- S  C( l) G            else set A_induct to 3   
! R2 A) h# c$ n$ B5 m/ Q9 I* S        set A_i to 0
, @0 t" @; d4 J! E% g& f4 {. k9 G        clone 1 load to P_induction
& {/ g* D1 g; @% I2 e        wait for A_time sec
7 e! F7 h7 L1 i  z& Z5 Z# U    end
+ h4 t6 C, F( gend
5 f" p0 I! {! m, Q5 c
2 c% V* I) N4 _4 b- k& F3 `begin P_induction arriving/ q7 t! D7 p: q$ h3 h$ p, y
    if A_induct=1 then clone 1 load to P_pick1
  n# V8 l, M* |0 ~4 f    else if A_induct=2 then clone 1 load to P_pick2# B7 V  S: @8 ?
        else clone 1 load to P_pick35 t( |' k) s0 V  o+ z: R3 u1 G6 [% Q
end4 C" ^6 M5 b, D# r
1 X  ]6 T* x9 \( J' K0 r6 I( c9 R
begin P_pick1 arriving
: O; y8 O5 N& T& o) `    set A_i to 1
: u" t$ I9 j9 i: R# `    move into Q_induct1# A  @5 ?+ A$ ]3 r
    move into pickaisle.induct16 V1 G. p! e! A
    while A_i<=30 do begin
5 b1 p3 R3 s! j) l6 K' B8 V7 t        travel to pickaisle.con(A_i)
2 Q3 \2 _3 u6 J2 w. q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: w  k0 ~2 w  `, }. |, }
        else wait for 10 sec
( K# u( B2 C: k: D0 m        if A_i=A_leave then send to die
; A1 g8 Y1 L' S/ \8 S        else inc A_i by 1; v3 S+ l# L& M% w% E. c
    end7 |, ?7 B- r" A3 g' l  r; B  w6 m. Z
end
% r$ Y0 c  g, z5 ~9 E: v: \$ _' n! Y. j6 i' [9 G  H& `) N
begin P_pick2 arriving  ?4 o8 C; o% d8 S
    set A_i to 11/ x& u) c. D& `2 t1 t
    move into Q_induct20 i  L1 q+ {* W# d0 l6 ?
    move into pickaisle.induct2
% ]/ k. X" _2 x* [! m1 ?# {$ D" ^    while A_i<=30 do begin
( H$ M3 x. ]" z/ s7 O        travel to pickaisle.con(A_i); T7 Z. Q0 j( {! F% O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 a; p: H* m. L7 c" b: U9 W6 P
        else wait for 10 sec  M$ L6 q4 O: T* ]' R. q7 d
        if A_i=A_leave then send to die
1 A( k, S* h' t        else inc A_i by 1
- c! i% k0 s1 h' V. W0 I8 q    end
# ?1 M$ x, F& h9 A8 e7 Aend% z8 x9 [% _+ l1 d9 v- W7 C

& d& N* g2 a+ e% ]begin P_pick3 arriving% t3 E1 B  n) {7 O
    set A_i to 21
# [: B3 ?# N( J, E    move into Q_induct3
% L: }; f+ m: K& Y  d- ?    move into pickaisle.induct3
6 X2 q" P4 D& J    while A_i<=30 do begin
: U" h$ d/ f: P" B5 v- I; e3 w- s6 g        travel to pickaisle.con(A_i)7 O3 Q2 x3 s2 [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ p, M! Y% S7 }' k9 t0 N        else wait for 10 sec
# k% r# G4 w! x/ L9 B: z6 M4 h        if A_i=A_leave then send to die- d( ]' U! G- J1 X, w% w
        else inc A_i by 1
; u* u* H6 U/ h* V    end
1 v- l( Z) N! f+ P# hend

最佳答案

查看完整内容

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是个什么东东?
0 I& W- c2 h6 q, g2 |( {move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 H7 T9 p/ t/ E5 C+ h
' G( N2 w, e& ^: vAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。6 S$ y6 u5 E1 ?# u

3 q+ j) H2 E# ^# ?/ k4 V9 x" U" T另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! r6 F& s: x$ a- S! s
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 C# X5 I- f' Y. b2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 Q8 F8 R3 P, C. H/ @3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% f' \6 B: E. |: y# o2 G
begin P_induction arriving, e5 R$ M5 U" i  U, z) ^- @" k7 r
    clone 1 load to P_pick(A_induct)
- e! L# q6 B' Mend最大的系
; |: F9 H, M3 O# ?  H- U) x! B6 P; D! Y* L& e
begin P_pick arriving
. o5 A1 s1 Q9 t( {! c( F    set A_i to procindex * 10 + 1
- U, a9 Y/ X# T; B    move into Q_induct(procindex)
" ?6 F4 M( p" f1 {3 [  ~0 Q0 g    move into pickaisle.induct(procindex)
& M0 f2 u3 g$ M6 o1 W" X* |    /*check the type of pickaisle.induct(i), for your last problem.*/( l" t1 _- H& ?! D* a( i; p3 O

! `2 t9 L; ^: h/ l3 Q% \    while A_i<=30 do begin+ D" Q: c5 S1 l/ h* |
        travel to pickaisle.con(A_i)9 M3 o6 u& r2 w* L4 M" t  B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# }1 k; f# }0 C% L! q& w- b0 ], q
        else wait for 10 sec% i  ^; D9 X% i) ^5 @' R% S
        if A_i=A_leave then send to die, W. Z: ]" Y% |- `5 F
        else inc A_i by 1* ]' W2 B/ u8 c6 r* F
    end
/ k1 p, h* G/ c  P6 k& wend1 d& B: C+ [# G% H
0 `% r- j( f# |0 G5 v  K2 S/ A+ j
其中的procindex为整形,代表当前process的序号。
$ _7 l5 R: K- C0 m& i. {' wstation和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-4-30 17:47 , Processed in 0.016926 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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