设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14257|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, _. q# C! f& f" i0 s1 c; n; |% [( n* V! e; ]
我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 @6 ^, ?7 G6 z5 h" K2 ]$ ]! R5 `

( x9 F" q% i' ]3 }1 _" Tbegin P_read arriving
% Y8 c2 F( M0 B4 m    while 1=1 do begin
) |9 q, j' z2 f' O; w9 @+ N        read A_tote from "data.txt" with delimiter "\n"
2 f  Y2 K& Y0 j; a! x( Y+ g/ ?        read A_time from "data.txt" with delimiter "\n"
; V1 R1 }. M4 _3 _! \8 J        read A_leave from "data.txt" with delimiter "\n"5 c( c0 @4 L7 D6 @, F$ n
        read A_picks from "data.txt" with delimiter "\n"  F0 f: P* a/ g$ {4 ]
        set load type to A_tote
: w" U3 T% ~# m- n        if A_tote="tote 1" then set A_induct to 1( _- }8 \; U( M  Z5 B9 _
        else if A_tote="tote 2" then set A_induct to 2
5 l: G. T- P4 e' h. q5 C            else set A_induct to 3   
4 s4 g8 w& g% q6 L0 i* @        set A_i to 0" ^6 g% z2 S9 y, \7 e2 q* K$ v
        clone 1 load to P_induction
  R# H# [5 X3 q8 f        wait for A_time sec+ Q9 e: y, ?, K( {# ]
    end' V0 }( ~8 O/ p6 j
end3 q  e) o. L- ]2 V* W' c- n/ j

* U  `) t& K3 Pbegin P_induction arriving
' j" h& R% C" ?; B* Q; H. f    if A_induct=1 then clone 1 load to P_pick1
# Y. w: V0 l* ?7 B) G# \    else if A_induct=2 then clone 1 load to P_pick28 t. X  t) a# j( M
        else clone 1 load to P_pick3
: X: @+ z; O, e/ t* vend" u" W4 [. ]  Y6 T3 r* v
2 L9 \! B  A" E) Z* ~. ?" {
begin P_pick1 arriving6 \& M; `0 H1 S, h2 U4 {
    set A_i to 1
5 z. K' B) w0 p9 m/ v+ F7 J: @    move into Q_induct1
$ U% ?! v3 }' y    move into pickaisle.induct1, T. G# R; }2 r) C6 {
    while A_i<=30 do begin9 C# [/ q9 V: k3 o+ s
        travel to pickaisle.con(A_i)4 \6 u' m1 k  w0 G" {+ m' J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 c+ M$ x# T! r6 T        else wait for 10 sec  X# C, P7 ]0 x$ ]& g9 S
        if A_i=A_leave then send to die5 R' `7 u2 f0 S  l
        else inc A_i by 1
/ O( i8 Y: u2 m# C' h    end
6 _! L; h. P$ p& wend
, f2 t) N; ?  z) u# x$ I! F1 f* G) }2 x- L
begin P_pick2 arriving
" s; ?! r9 r% y6 o+ {* m/ u7 a/ i    set A_i to 118 M, G0 S% a% Z( O
    move into Q_induct2/ O) r6 M0 s+ y. ~& h6 K/ d
    move into pickaisle.induct2
6 K0 S; w5 z# A& n$ _    while A_i<=30 do begin
9 A% k4 s( T5 l        travel to pickaisle.con(A_i)
, N0 Q/ K4 v( ]8 g- [* y, ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 h( m1 Y0 W; D/ F5 T( G        else wait for 10 sec
/ _7 m1 ?% c$ h) ?* Q6 P        if A_i=A_leave then send to die
# z  H7 m0 ?* x1 D        else inc A_i by 1( g6 P5 _2 {+ ^9 f' M- `
    end
& {8 ^* u  j( q3 _5 b7 Xend
% Y. T: x1 J' I
# R* o& F: q9 q$ |# Y4 v2 h9 D, [begin P_pick3 arriving* G& e" w0 t% \4 `4 a7 p- o
    set A_i to 21) J3 L$ y/ l4 ]& ~) _: w# ~4 {1 l; j
    move into Q_induct3- q8 y. k, P4 X6 }* h
    move into pickaisle.induct3
  U* J5 R9 C" S    while A_i<=30 do begin
9 \* ]$ W* l7 Y2 S) D        travel to pickaisle.con(A_i)' m! T, u. `  {9 Q3 D2 C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  L4 `0 b6 T: P, j7 @" M; D
        else wait for 10 sec
) _8 p* r$ c* e& M        if A_i=A_leave then send to die4 U* `) W, d, a- s8 I' Z; w
        else inc A_i by 17 n  Y) J. y: p  ?, a/ f5 |
    end
! E2 f3 B2 |) h. N5 c5 `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是个什么东东?
* q0 ~- _  B) }. h; U" |! omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" g5 r$ `$ o; G. `5 [1 v8 C' F; }4 e0 m
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* k: N2 U0 m+ I4 r
% ]2 Z. \  P- ?. B* X9 o, f另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: \/ D# w( G3 l1 B1 T+ Q6 }, C
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
, Z' D' m$ ?. Q: b' k, S- |$ t2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ ?4 i- E+ {: u: ~  G
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# A  \2 d; J6 S( a- K2 h6 B( Dbegin P_induction arriving+ \' `4 ^& |( T- b! Z6 @
    clone 1 load to P_pick(A_induct)
3 i5 b7 V; \8 X3 |end最大的系9 N3 Z7 A7 ^; e4 |

, ], m4 X- T% }  @begin P_pick arriving
0 W8 N0 q" `; y0 ~+ e6 y    set A_i to procindex * 10 + 1
9 W! k8 b9 ]9 f% \    move into Q_induct(procindex)
7 j# ^: s3 U! Y    move into pickaisle.induct(procindex)  Z* Y# f5 Y$ C# Q' k1 l
    /*check the type of pickaisle.induct(i), for your last problem.*/
. P- I) ?: U  c/ m8 ~: d+ g9 L* ?* i8 [' C. m
    while A_i<=30 do begin
& Q, q$ u/ J7 O" D- g+ [        travel to pickaisle.con(A_i)& C: d% M2 D  b2 a' N5 I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" R! p5 U0 p( e! g. P  A6 H: P
        else wait for 10 sec- t6 H$ t. A7 \: J6 J5 L
        if A_i=A_leave then send to die$ z4 s& H" V3 u+ z- B. r
        else inc A_i by 1, F1 X* h* \# D! }8 ?6 L& E" @! l/ d2 L
    end3 I6 f+ s( U# C  V2 ^3 ^4 }8 N
end
* r" q* C# h( Q! i9 W. g4 s
/ z+ z! v% T# C4 W4 U其中的procindex为整形,代表当前process的序号。' y" Z9 r/ W2 Y
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-6-25 15:22 , Processed in 0.015159 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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