设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13376|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: z" u! }+ Y3 E3 k6 T

& m: a3 H8 r7 l; ^+ O4 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中的数值,不知道会不会有什么不妥。
+ N2 Y* M7 `, E
. P  Y/ p, I7 H' G" I# @- ~: cbegin P_read arriving
9 c5 D! g  W/ o! G# t8 K    while 1=1 do begin9 x/ m* A5 v1 n8 f
        read A_tote from "data.txt" with delimiter "\n"( ?5 o1 ~# a" _( ]) `* S, i
        read A_time from "data.txt" with delimiter "\n": p8 O+ x0 C1 g8 a) [
        read A_leave from "data.txt" with delimiter "\n"
) w8 V4 r: A$ ?: A! `. A) n- [        read A_picks from "data.txt" with delimiter "\n"
2 Z5 C2 I4 V; E2 I7 |9 g        set load type to A_tote
0 [8 X- _8 Y# U* p+ D  v        if A_tote="tote 1" then set A_induct to 1. B; e$ b- h4 r0 l
        else if A_tote="tote 2" then set A_induct to 2
) K0 W% m4 y- Z& i/ W            else set A_induct to 3   
8 F8 ]; P; P, S( F        set A_i to 0
- T, k( s3 }* V( b0 i: E" n3 ?        clone 1 load to P_induction
+ c+ T- N& l' A4 @( j5 G        wait for A_time sec
8 d- }3 ~- Y% C' b" B* }) v    end# w: Q# ?* l$ M) M) ~
end
' |1 R' ~1 R% ~" K6 [; n# \) j6 j7 i0 R# B2 C, n
begin P_induction arriving1 q& v' C8 }* \( m/ g  A
    if A_induct=1 then clone 1 load to P_pick1
  o: Q6 O8 u' T6 Y3 X9 a, ~4 {    else if A_induct=2 then clone 1 load to P_pick25 A9 H' ?) g1 I
        else clone 1 load to P_pick3+ I; ^7 `$ ^! ~
end8 x. W# w( Q% X/ b3 M8 n* L( e. A

  `1 D, R- f  x& `begin P_pick1 arriving+ K/ ?6 e) e) d5 b5 o: P; Z
    set A_i to 1  b8 @4 l, d2 d+ b7 ^/ T5 X* O; a
    move into Q_induct12 b6 v: e7 A. A* m9 j
    move into pickaisle.induct1
2 p2 x: g  n5 z+ j; M* _; C    while A_i<=30 do begin/ k* _, B9 r0 D
        travel to pickaisle.con(A_i)
) S$ o0 p( q+ L3 \3 S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 C3 }9 Y/ m/ S/ Z% i. A- [% ~
        else wait for 10 sec- L& `; Y6 _7 W8 i$ {( @* o# c
        if A_i=A_leave then send to die
6 h* R% R" h3 l/ e" q        else inc A_i by 1
7 K+ l5 E* p  u* q" A7 K    end7 f( {! @' d' _! ^) F2 r0 O" d( e5 U$ \2 k
end
4 e, u& y& q9 o3 N: G# f5 U) j3 X/ U7 K( w1 r: V
begin P_pick2 arriving; r6 U& F* j3 S' U4 Q
    set A_i to 119 J- e/ {2 u/ R& g
    move into Q_induct2' [4 Z, X0 h! s9 K0 B; s# }! \" j
    move into pickaisle.induct2
! i5 u1 j8 ~, f* q. W    while A_i<=30 do begin
* K2 Z, j& g% T/ E$ x        travel to pickaisle.con(A_i)% o( O% O2 Q$ f! d5 b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; }6 n# H- @2 q% ?# ?% F        else wait for 10 sec! R, E. b0 h& s* w, O8 D
        if A_i=A_leave then send to die
" d# R" K5 s2 Z) n        else inc A_i by 12 l# k! `1 ~) g& v5 g8 P
    end
. ]# L" M/ i# N8 Bend
$ B+ k* V8 f6 w2 p) ]; j' A: M) c6 @  V" ]
begin P_pick3 arriving
+ \3 `9 N' z) N* \. B    set A_i to 21: B5 r, A9 s. P9 p5 d6 O; v6 R, @( D
    move into Q_induct3
9 s" j7 V  H9 T    move into pickaisle.induct34 m8 I* \( `- ]" S% x
    while A_i<=30 do begin) R4 j0 d! d! ^+ r6 M) q
        travel to pickaisle.con(A_i)
' |: q! G5 a, k- _* i1 E3 f1 M' x# I6 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 ~1 }! F; I% P. ]7 T# @% d
        else wait for 10 sec
1 T7 f1 V) e0 o0 i+ Q. Y& D        if A_i=A_leave then send to die# d) q/ L+ e5 a# r) z  W
        else inc A_i by 1
1 K: b& d) Y" J; {0 g) u- ~    end
, C% i: X1 J  Q9 H" ^4 e: Eend

最佳答案

查看完整内容

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是个什么东东?
+ x" ?% F& c- o' Q2 qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) C& |- J, {7 c* e, K
1 i: O  N6 T' _& s; X1 D
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% G) D& P5 X  s1 M8 B5 A6 F
' Q# D4 S6 p% p  n) t7 v2 O' S, o7 O
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ W. W. d9 Z4 A: u/ a& L( R1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" Z+ g4 l4 ?  ?, I5 {' @+ L2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 g+ `2 k! k  A/ Y4 E+ f
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' |9 Y3 _! R- {" n/ Q# j- T& Y6 G
begin P_induction arriving
% L0 |1 ^" o; ?% s$ t8 M; R    clone 1 load to P_pick(A_induct)
8 c& F  V2 O+ h# b( O+ K, W3 Gend最大的系6 `3 W' ^% r5 R4 K1 X# [

; `7 @/ y! x5 f3 c1 b5 G! mbegin P_pick arriving
7 y7 M7 \6 R. w/ \8 q, N3 F; l, \    set A_i to procindex * 10 + 18 V5 y" m& i- \; k  u  R. w
    move into Q_induct(procindex)
* l+ V$ \6 p. \& {) i. t    move into pickaisle.induct(procindex)
7 J# W* j1 I* M8 q6 c3 G! j    /*check the type of pickaisle.induct(i), for your last problem.*/
1 C0 C5 S2 e. a% y8 e( e1 B+ a, N9 C/ e% I# B
    while A_i<=30 do begin
6 i9 D& T. N0 ]0 f4 n! y2 h: X        travel to pickaisle.con(A_i)
% ]; w) V7 O  i; ]# H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; }4 |4 \9 B' L) B3 @        else wait for 10 sec( X% h' k: g" i/ f# V
        if A_i=A_leave then send to die/ T+ g3 k4 B) N( r$ B1 R8 i
        else inc A_i by 1
/ h( _5 N9 `3 Y/ S; L  H* Q( M    end
7 Y+ p- r( {) U9 V7 X8 b- p6 jend) J: X7 z6 N0 v$ N; i# ]; D
7 \; y' y( t* R) i( M5 \1 R2 ^& f
其中的procindex为整形,代表当前process的序号。
2 |/ v2 }# e" c- G  w/ Ystation和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-7 18:48 , Processed in 0.019931 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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