设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13076|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! |  v1 N; ^/ g% a
5 |( T: T! W2 r3 U# y: p' ~
我的问题是,在每个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 J& w  e. i) Q% S9 e% I0 A/ W$ k$ T( ^: w/ A
begin P_read arriving6 t* Q6 @. N" _  p
    while 1=1 do begin6 `4 ~- ?% A. h, x
        read A_tote from "data.txt" with delimiter "\n"
1 f# X6 J; A3 L$ A; A" s        read A_time from "data.txt" with delimiter "\n"+ q; k4 c5 f- {) b, }# W
        read A_leave from "data.txt" with delimiter "\n"8 A0 T6 X8 Q, N6 ?
        read A_picks from "data.txt" with delimiter "\n"% c9 _! L/ n4 |/ V% `; m
        set load type to A_tote
! K7 V% b8 ~: M7 f! Y4 b( u        if A_tote="tote 1" then set A_induct to 1( M, M; G3 k- O5 a9 Z# w/ s
        else if A_tote="tote 2" then set A_induct to 24 ?$ l2 u+ M% y" _; K4 O
            else set A_induct to 3    ! e2 K! ^  y: i9 S
        set A_i to 08 t* T) {& |8 U" u! _& S
        clone 1 load to P_induction  |' F9 q8 G$ T2 C9 P3 l* ]
        wait for A_time sec/ f) B6 i1 F! V3 P2 U' \
    end
4 N7 D6 `) n& V# J# a  X$ d: ?end
# }9 s" L; N0 O  M( j2 J  E' d5 p# E$ d- j
begin P_induction arriving8 n4 w/ n' s% A# W! s4 I- h
    if A_induct=1 then clone 1 load to P_pick1+ D" ^' d- V8 `% u$ r
    else if A_induct=2 then clone 1 load to P_pick2
$ \* p2 s. ]9 K9 o        else clone 1 load to P_pick3- u! C& x& ?" y% {% L. I6 j
end: H' ~' A8 u; A; }* ~! E: Z
% F* V- Y+ `4 f+ A; K9 O1 `
begin P_pick1 arriving2 j5 M% `" y- |, o- H5 u4 v2 ~% z, N
    set A_i to 1& j8 C& Q: C3 U- ?" t- E
    move into Q_induct1
$ g* y0 O8 T* ?& d3 G    move into pickaisle.induct1
4 o) ]/ d8 q8 z$ h    while A_i<=30 do begin
* c. b" y3 d2 s. m, B$ }        travel to pickaisle.con(A_i)
- s' Z0 [% w* V! R( m/ u. f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& P" V# b: p6 p( i" V. H; C& t        else wait for 10 sec
6 j6 h+ W+ [% \) f. ]+ `, @        if A_i=A_leave then send to die
6 [4 M( h; e& b        else inc A_i by 1
! e. `9 M% ]# @2 E8 v) a- n, S    end. Y7 N* r6 Q6 }8 k4 s/ s$ E
end9 i8 Z+ [0 M; k5 d

$ G8 Z' w6 F& B+ M! B' ?begin P_pick2 arriving+ x: P- C6 O% r  N, z7 H$ S
    set A_i to 11
& o4 Y8 i9 u+ C* Y6 l3 E( _    move into Q_induct2
; a2 k0 P6 i8 s$ S$ r1 D    move into pickaisle.induct2
1 C" `  e& O- u! w3 H    while A_i<=30 do begin
; h* b! h( m/ A1 ~4 _! ^* G        travel to pickaisle.con(A_i)
9 U; r1 h9 E( v& R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 x1 B- O% X: F+ r- k9 w) W
        else wait for 10 sec
, `% }/ b- Z1 Y: J        if A_i=A_leave then send to die
4 n# C" k9 Y7 A. E        else inc A_i by 1
$ o, e( h1 j/ a" a- y: ^# q    end
0 e$ ?/ w: b! Xend) z8 o3 _5 c: V

/ x! ]& H* u, Cbegin P_pick3 arriving
3 s& c2 J1 G# Q  Q& q    set A_i to 21
2 o* |1 G) }( Q/ D" ^  O7 W1 u    move into Q_induct3
9 u) S! ^) O' [7 H    move into pickaisle.induct3
0 }  D  M0 _" I% ^    while A_i<=30 do begin
. F& W7 L% Y; w* T        travel to pickaisle.con(A_i)
" ~8 c3 s& b8 ^% l' j& {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! Q9 w: K3 @+ q- r2 w        else wait for 10 sec" W" E7 v+ g. K& g
        if A_i=A_leave then send to die
& `5 P% i; I% ]& ^* U7 O( s        else inc A_i by 1) A; H, {2 _5 p6 H  r' u
    end
/ d% \' }. f: i( `) c& X" pend

最佳答案

查看完整内容

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是个什么东东?
% j7 K; L8 ?0 a: a9 W+ Q1 omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 x' z; D* T3 z* h( V4 Y! w0 U# k! b- q$ N1 }6 |( Z, ]
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" n/ u1 o: I/ H3 K; u- g5 s; _, e" u& Z* G$ _) g- Y: d! i5 t2 Y" |6 ?/ M: y
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 a+ q' |. {, b/ Q4 l8 s
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. x4 l: M' t2 u6 t0 O6 C8 n2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ q! ~2 `$ |! e$ ]$ l0 X3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ j# O1 k4 v4 O3 A
begin P_induction arriving9 E9 f: T8 }7 i: F8 r# \
    clone 1 load to P_pick(A_induct)2 x, v3 c5 ^& v& c! ^$ R
end最大的系
# a" d5 m5 o9 Q2 R, g4 N2 K
0 Y- T- _  h$ Xbegin P_pick arriving
% J' a; E" ^6 X7 c) A4 t    set A_i to procindex * 10 + 1
8 K4 _8 T! _' G* U- r- \+ [    move into Q_induct(procindex)/ S1 M* [1 x5 b$ n, Y' t6 y& u' b
    move into pickaisle.induct(procindex)
5 \, W# Z& d0 ]+ b9 H. M5 L9 q; j    /*check the type of pickaisle.induct(i), for your last problem.*/( K5 |' N8 d4 X

& I- b; {0 _8 x- @& I  Z9 N    while A_i<=30 do begin8 |- z1 _3 t, z) I
        travel to pickaisle.con(A_i)
' g2 R# K$ k5 g" \: k& K$ `* x2 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ a  \! H; p7 W' q' ~        else wait for 10 sec
4 J2 m+ Z6 ^$ z7 h5 g7 U* u        if A_i=A_leave then send to die% N  a6 W: I, ]4 ]5 F( [. ?/ @
        else inc A_i by 15 L6 ]5 R: y% l1 j% d0 K7 ~( F! a4 [
    end- {+ Z9 @# @7 W
end* }' A2 ?( o. j2 }
; K0 I9 i( N* i
其中的procindex为整形,代表当前process的序号。
' f2 c7 N1 |+ U* }) L% C3 e, tstation和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-16 05:04 , Processed in 0.020331 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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