设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13258|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 {8 I/ C5 j( i) r1 {# ^3 v% b- N

' U( C) c! y9 E) m我的问题是,在每个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 z% x) S' `- P( @
& Q* Y1 s; {4 V+ |# D! t- {' w, kbegin P_read arriving5 i! d& }6 c" s3 x7 Q5 \* a1 N/ X
    while 1=1 do begin$ \7 x4 r8 c5 i; U$ A) \
        read A_tote from "data.txt" with delimiter "\n"3 _- v# H* _5 |, F
        read A_time from "data.txt" with delimiter "\n"
+ e2 b4 L7 Q4 H! \* q        read A_leave from "data.txt" with delimiter "\n"2 y# W: E3 i0 P/ M- `
        read A_picks from "data.txt" with delimiter "\n"
7 C: H- Y( z* g        set load type to A_tote% u! z& O* R, E9 h" s
        if A_tote="tote 1" then set A_induct to 1
. D' B% z" I) F2 V5 s        else if A_tote="tote 2" then set A_induct to 2
. F) R5 W' j3 f$ |9 u! Z/ D            else set A_induct to 3   
. C8 J: Y7 k2 n* x. f6 c        set A_i to 0
: {# n% ]1 m! Z+ A% A% s& L        clone 1 load to P_induction
& y7 f  M' r1 H+ [- a8 U$ t( u        wait for A_time sec
5 f# C. b1 d; I" ]    end
: W2 C8 c3 j: J5 H5 N+ lend
/ Y; L+ s. L: _+ t4 n+ N2 a3 R6 O$ B# U7 N' l
begin P_induction arriving
1 S( P; ^1 M% m- \1 _5 w    if A_induct=1 then clone 1 load to P_pick19 U$ W7 W6 C2 W. h9 E7 b
    else if A_induct=2 then clone 1 load to P_pick2
1 l, k3 N6 {" K: \        else clone 1 load to P_pick3
# |1 p7 `/ G7 V% Dend( [% l9 s7 e4 X" Z5 }
4 x' ~  W7 @+ [% D
begin P_pick1 arriving* }) g7 O/ y) K( B0 ^
    set A_i to 1
; c1 r/ e3 W! {- H+ ]6 b    move into Q_induct1
7 C) W: m* Q- c9 M! Q    move into pickaisle.induct1
& e( T% @- Y3 w. ^! Y" }    while A_i<=30 do begin
4 z2 E) c$ C% ^6 ]7 s9 t6 w& C! W& V        travel to pickaisle.con(A_i)- g/ d; |- q. o5 e' b, O4 A# i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 u  e* c6 m7 ^$ `7 }' a        else wait for 10 sec2 c) d9 ^" w/ T$ B, e
        if A_i=A_leave then send to die
) D+ F6 M8 e( ?* E$ G1 g6 F        else inc A_i by 1- Y) Q* H0 E7 q, i7 A) C( O
    end7 o  e, |  x5 b( B! l7 [
end
+ a) Y, T* R  c3 \' t) D: L! Q' I+ ^' S# T( |5 D4 d- ~
begin P_pick2 arriving9 [% t* i( E. Y% e
    set A_i to 11. J5 z) T/ h! {2 }6 }- k) e
    move into Q_induct2) t& ?- [# c- c& k  [2 g0 L, P4 v* Q; u
    move into pickaisle.induct2" T3 i3 H- o! y7 Q# ?
    while A_i<=30 do begin
8 b8 M' f( e5 L7 W/ x, k        travel to pickaisle.con(A_i)# Z1 H% y. i6 P4 g" ?' m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 p) e( d# K- x' T6 d8 b# h
        else wait for 10 sec
' U) I" k8 S/ T9 N8 Y1 O) y' X- a4 P        if A_i=A_leave then send to die
, o2 C9 \  W5 ^: X: j: ?3 i9 D8 l        else inc A_i by 1" c# C* |- g  T! F. Z, m
    end- c! S. }& m; B. h% j3 |. J% _
end2 y& j2 t6 z% Y- }% ~

) l: S. b: T) \) j# `begin P_pick3 arriving
% O0 J- P/ S* g  V: V; A    set A_i to 21
9 Y- Q* e, j- e* G    move into Q_induct3
0 F4 X. j8 u8 T3 D    move into pickaisle.induct3
, Z. O2 d) L. u% e0 M& X1 ~* @    while A_i<=30 do begin
+ ?) k) n. X3 j' V5 w- N2 F        travel to pickaisle.con(A_i)
1 R' c* \4 X& y9 F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 ^3 ?/ P3 W6 W8 @2 y; ~! R3 l' E% U
        else wait for 10 sec
  J3 N) p; _# t: h( Z; P        if A_i=A_leave then send to die% ]  d. |7 h1 R1 f  I
        else inc A_i by 1
( G3 J7 p4 Q5 K+ @0 \  z- d% e    end
1 w5 l) k2 v! \8 C( Q3 F$ rend

最佳答案

查看完整内容

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是个什么东东?% q# j% l1 P1 d+ n5 k
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; K1 M9 N/ x# N7 I* H2 q: b

+ J4 q! ^: X- B, \) q& \AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 H5 \$ P' \1 }& c( I( f3 C  E$ l$ ?+ _$ W" h8 {
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 |" U' a# ?# F9 H. N3 O4 [1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;6 z, p* w& D7 y0 b1 H$ s7 }
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ p4 e5 t4 t0 W" S& h5 T
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  s# A4 I2 N" H2 G' _9 }" A$ q
begin P_induction arriving. H) Q3 Q: n8 W; g+ T# r
    clone 1 load to P_pick(A_induct)
* \, ^+ h! V+ \! C: Eend最大的系
5 |% I% t  z; k  N5 I8 r* K  ^& _5 q: b0 e' |/ z6 p) F
begin P_pick arriving
1 x  K1 J2 q' d* H3 }# f8 X- S    set A_i to procindex * 10 + 1; ~" Y6 r4 [- {* M+ i- X
    move into Q_induct(procindex)8 f9 l2 c# S! ~. i7 K: l4 D% p
    move into pickaisle.induct(procindex)( [1 p8 O9 Z! K3 h3 }% D3 o7 o; W
    /*check the type of pickaisle.induct(i), for your last problem.*/( v: h5 d( Q; o0 x1 z; X0 R

" I; o. ^$ m/ I: m9 {  F1 W    while A_i<=30 do begin
' g7 f' M3 E+ ~$ u- g. W' F. L# F3 I        travel to pickaisle.con(A_i)4 h; U. T: R# |5 o# g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- B+ R& o+ A& Q
        else wait for 10 sec7 G3 P6 [4 p7 R; F9 o3 U$ k
        if A_i=A_leave then send to die
5 y$ h+ Y: f* s! [; [        else inc A_i by 15 P2 H* K/ k5 a) O8 J$ Z1 G
    end8 t, F5 |1 K/ {
end# x3 q1 l6 m$ {  l1 d2 X
4 C$ u3 e, G2 A8 I) b  d) [7 i
其中的procindex为整形,代表当前process的序号。4 a& k5 O/ a& A
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-30 18:36 , Processed in 0.021041 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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