设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13965|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 g3 X' J4 P9 u8 u: F0 a

) T" }5 Q" g3 I2 @! D/ ^' z# L我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 B3 _4 s* d1 Y

9 ~  j, p  x5 ?+ e" D% U* m" n4 Xbegin P_read arriving( i6 q+ R) I% y9 V( P/ G) L0 E  |
    while 1=1 do begin
5 v- [& y9 x6 c0 X: |( y, D* w0 z        read A_tote from "data.txt" with delimiter "\n"1 M* f6 s! x2 W! C" Y. @8 J0 `4 A  h
        read A_time from "data.txt" with delimiter "\n"
2 Q8 U2 [( t9 ?7 ~4 x: d        read A_leave from "data.txt" with delimiter "\n"/ Y! N! N; j& F; R
        read A_picks from "data.txt" with delimiter "\n"+ s% S6 M/ \7 q+ [" t
        set load type to A_tote0 j" d6 S) q( @$ b
        if A_tote="tote 1" then set A_induct to 1
# E# h4 f3 s! P3 w* f, o4 g        else if A_tote="tote 2" then set A_induct to 2; `" G) V: z' E1 D! D. D: j0 ]
            else set A_induct to 3   
* e& b, v2 w0 [# m8 ^% @5 k/ }        set A_i to 08 a6 O( d: [% A( G) q. N: [2 s7 x: e
        clone 1 load to P_induction
3 n* r1 @3 v: r' A        wait for A_time sec( V# x" ^# I* L  }7 j% S9 B9 Y
    end4 D/ z- q) ?9 @/ N- D& x/ s% {5 m. l, i
end
+ z. l2 U  y, E9 g! \
/ I4 m$ ]8 [; T" i6 z9 I3 nbegin P_induction arriving
. x; ?. G7 j( G6 U2 X: U    if A_induct=1 then clone 1 load to P_pick1# W  \; m2 X( V0 S% F$ o) f- W
    else if A_induct=2 then clone 1 load to P_pick2# d6 u; `, E$ h! I! D  U2 `
        else clone 1 load to P_pick3
# i' L( L9 |, f$ D* D# Y7 Y8 rend
% X: N! ?1 A4 j9 n" c- ]: c2 y+ I, H
begin P_pick1 arriving* O/ }; N" J, o) B- m( Q
    set A_i to 1' W: D2 Z$ `" S3 E2 U
    move into Q_induct1
, G! Y* k3 z6 J; W+ ]    move into pickaisle.induct1$ V2 U! Q9 h8 C. R+ m
    while A_i<=30 do begin1 Q, l7 i0 u2 W2 i5 ]1 p
        travel to pickaisle.con(A_i)9 E; u; c! Y' ~" k3 ]. r6 w4 d9 j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, p1 }  `6 B& P/ N# l
        else wait for 10 sec7 g* e- ?6 |$ }' x
        if A_i=A_leave then send to die+ u- G' Q% d2 O4 u
        else inc A_i by 1
4 Q) d# M# F0 u' o# T5 U6 m! i    end
, `7 V) @$ @, gend( G' H! o- F5 Q- K

, r$ w) t4 I4 |8 t( zbegin P_pick2 arriving2 A" J1 O8 P- @; |
    set A_i to 116 J$ ~3 S  v( D' U7 A/ a
    move into Q_induct2
: Y0 k( l4 X3 e# W    move into pickaisle.induct2( P: `; x0 x0 F/ k" I
    while A_i<=30 do begin
2 g/ m; Y& U& t+ x$ ]7 X$ ]        travel to pickaisle.con(A_i)
: F- Y8 \7 v# S8 D4 ~* W+ T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 c& f7 {4 X) U+ F7 a2 v& x/ Q        else wait for 10 sec
8 ?1 U' `  }' ]) d: A        if A_i=A_leave then send to die
  [& S6 ~) ^; a0 Y        else inc A_i by 1" H) T6 A& {1 |1 c
    end! ^6 S& n* p& v" y& \/ I
end
" n1 P' I$ T- S; P* j7 @+ Y7 J& _, l, m# u8 v( w
begin P_pick3 arriving! h& W& A: ~: }$ L. N
    set A_i to 21
2 q6 k5 U3 w- S# ^; S/ g    move into Q_induct33 _$ `, [9 F5 i9 h! e$ L4 X
    move into pickaisle.induct3
4 s. M! ~( n% n- B" i    while A_i<=30 do begin
1 K$ j) T1 A% ^# V. K4 T8 m        travel to pickaisle.con(A_i)
2 Q  i4 Q5 t" }7 t1 L% ~& p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* q) O! q) B, C. \
        else wait for 10 sec
" H9 I# Y$ T8 l  \        if A_i=A_leave then send to die& H- j  B7 _  o# ~! e
        else inc A_i by 1
& h: Q9 d7 R/ \) e/ g    end: A1 R' l8 N% t+ }/ h( Q
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是个什么东东?
# v) Z- i9 r- Vmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) i' S; @7 }  y9 F& y. j5 {; E- ]* T- U# |  D5 y$ C8 X+ s
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& b5 U$ i$ H! Y- ?0 t$ Q
6 C: X$ E9 m4 u- U+ e/ L, {1 M
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: ?7 o6 v. w3 w& r  f, F& I7 N0 c1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 D* q( w7 e, v5 w  f7 [
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! J$ g$ n3 m. }9 Z1 A
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% G  ~: \6 o* j- F: h/ E
begin P_induction arriving
0 j+ a7 a9 J6 f* o    clone 1 load to P_pick(A_induct)8 A. c- o* c6 t! I, v
end最大的系
6 F! ^5 Q( Z( f) s
8 C- y& N0 B8 N8 l1 sbegin P_pick arriving8 M+ e' y* l/ c5 k. v
    set A_i to procindex * 10 + 14 N/ n( Q! }" I1 E0 E( J
    move into Q_induct(procindex)
3 G" l! d$ y/ m$ r; m1 j9 \    move into pickaisle.induct(procindex)
* T+ J3 }/ f9 |    /*check the type of pickaisle.induct(i), for your last problem.*/& B1 G4 p, g' D5 g

5 q! v: k9 Q( C; o    while A_i<=30 do begin
, P* z) Q. `/ l' L- A        travel to pickaisle.con(A_i)
; V8 z, R+ s9 r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' j1 `2 v3 u" v+ G- s0 c        else wait for 10 sec
6 a" A2 y' {* Y2 z: Y* c: V! T: I        if A_i=A_leave then send to die
1 Q7 ^" N6 X' W, X        else inc A_i by 1
( `8 ?; A0 g4 |2 `/ D    end3 d# H( i% Z8 K- b9 w
end" T; a; r& ~9 E0 P

4 _  \$ c' i8 q7 M! X( I其中的procindex为整形,代表当前process的序号。
' \( m- X# I5 n) h7 X. B/ x2 \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-5-25 13:33 , Processed in 0.018153 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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