设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12521|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 o1 w# n0 Q4 H2 M

3 Z1 W) a# u1 b; t我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# l3 M! F% Z& U& r, |3 ^- ?, F9 {4 D4 o; g$ F& T
begin P_read arriving
* j7 O! a0 w8 f' Y3 N: S    while 1=1 do begin
1 ^8 M" W0 p3 ~" O- R        read A_tote from "data.txt" with delimiter "\n"
+ _+ \) K' C8 |+ B        read A_time from "data.txt" with delimiter "\n"
- ]7 \4 V/ N+ }% z) q& z, Z( N        read A_leave from "data.txt" with delimiter "\n"$ g9 h. o- n9 \1 X' ]6 P
        read A_picks from "data.txt" with delimiter "\n"
: _$ H8 s6 ?+ K+ m; W1 o        set load type to A_tote
# r4 s" U/ k, [9 Z9 O+ l' k5 v        if A_tote="tote 1" then set A_induct to 1' A$ v* U- a, K' y$ ^
        else if A_tote="tote 2" then set A_induct to 2$ l" w3 u% o. \: z% l( o
            else set A_induct to 3   
; }, G/ ?. B3 O1 M2 f0 P8 ~5 k        set A_i to 0
5 b% k& a& F/ w9 J  u' z6 p! V        clone 1 load to P_induction
; ^3 n8 `2 L# k5 a3 ^) F        wait for A_time sec
, |3 U8 {2 F2 e# S    end: u* H( `* K3 v. p% x& a, ^
end
' `8 x2 t* H& g2 B& [$ V9 S3 l6 h3 D
begin P_induction arriving7 b" B: z+ `- c; X
    if A_induct=1 then clone 1 load to P_pick1' A+ A/ a( c8 r# b  u6 m& p
    else if A_induct=2 then clone 1 load to P_pick2
. o1 ~8 w0 c9 E. T6 G        else clone 1 load to P_pick3( b3 r: P2 n$ f" M' `
end2 Y+ }" }) R! M6 @. n  C3 m/ B
- H' p) u! l6 F8 x' S4 Q' q. O
begin P_pick1 arriving
% u) R4 |5 I4 H. l    set A_i to 1
6 p/ T3 |& f* l: `! H    move into Q_induct1  {/ Y( e6 r0 C, o
    move into pickaisle.induct1( e3 C: ?' V( W, a
    while A_i<=30 do begin
; v6 c6 `3 I5 A( c# Z        travel to pickaisle.con(A_i)+ X2 Z( F$ E; N# y, u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 E, Y& @! |% ?( e
        else wait for 10 sec' u9 D5 Y  H  w: q" t9 S1 S
        if A_i=A_leave then send to die
! |3 w9 {4 L- R! m" L# ]( o        else inc A_i by 1  X/ `4 ]# ]3 q, v* a' e
    end+ x( O/ ^- t" z+ {
end
" N  y1 k' b" ?- O
. e# e5 H1 h' W5 Obegin P_pick2 arriving
5 p2 O& [7 ^% J9 J    set A_i to 11- q5 g% J8 F. ]( W5 R
    move into Q_induct2
- Q  L5 K1 S0 K+ E5 _& U$ V( o    move into pickaisle.induct2
3 ?9 k" N* h+ v* g* j. E    while A_i<=30 do begin
, |! B2 c' H, \        travel to pickaisle.con(A_i)( M1 T" ~+ y6 z, Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, u" b; E% W, s9 N
        else wait for 10 sec* m0 ?% Y+ P- o" F. y
        if A_i=A_leave then send to die. d4 ?) Y3 u% D) o1 p
        else inc A_i by 16 {9 R9 f1 k0 x
    end0 S. l6 R# S1 I$ H% E! V# C
end& G9 a2 a' ^( i2 {- G( k
: S3 F5 C' N4 d1 q5 L5 Y
begin P_pick3 arriving6 i" c/ H3 j1 A8 V
    set A_i to 21
% Z' [3 N& d. s+ M3 G    move into Q_induct3: [  ]/ J1 m. i9 ]% T
    move into pickaisle.induct3
' ?0 F$ R1 j4 L    while A_i<=30 do begin$ c7 t  J2 B  B- ?* c
        travel to pickaisle.con(A_i)
3 `1 g4 \/ R- J& T6 A( k# i- P8 \8 p. b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ z& P- L" d' b7 i0 ^9 o. k! n6 T        else wait for 10 sec
9 C0 J- a+ Z- o: I* E+ S        if A_i=A_leave then send to die
$ o' e# P3 \# x1 R# Y! ?        else inc A_i by 16 \: G! e0 k2 P$ U7 t$ R8 c
    end9 _* M$ }  d5 k" D8 U, U
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是个什么东东?
3 b1 P" {: h% ]& U* M) O8 N' Cmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 O. N! N& i- P5 p/ k  W; f% X
) u( h5 ?) X( R; _. |
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 W' i) Y+ ^4 e- v; v; v  J4 e. k# Z+ P0 O  v+ h& Y9 j, I
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 D! m1 @6 u. U/ n4 k7 q; b% j! M; \1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 S2 K# `1 W( m' K* U3 [! ~( a
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ ~: d0 g2 N+ R3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; y2 p- S$ _2 h
begin P_induction arriving
6 ~1 q1 w0 K) {- H6 D, z    clone 1 load to P_pick(A_induct)6 P- {* f7 \# a9 a% ~
end最大的系5 D8 n9 i% F4 A* b! y

. b3 w5 M( ?" n" U, v0 V; M9 Pbegin P_pick arriving
. O( ]# A% w  Q; ?# ~* o    set A_i to procindex * 10 + 1
; b7 [& I$ w9 T- e* X4 j    move into Q_induct(procindex)
+ K! g% Y1 _" o: `% T    move into pickaisle.induct(procindex)
  Z% Y0 p7 }+ T9 U    /*check the type of pickaisle.induct(i), for your last problem.*/
2 U; @" D5 Q. D; Q+ Y9 G- h& m1 ^. Q  f
- M" k: @% [! E1 m! \$ p    while A_i<=30 do begin5 h1 }# z* U) S  K' q* C' I
        travel to pickaisle.con(A_i)$ U6 M( e5 O. V0 |0 k& g% W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, P1 Q( p6 \& x* L6 R
        else wait for 10 sec
7 |0 k- t, A; t3 ~" W" P& ?        if A_i=A_leave then send to die
) ?" i9 }. t! o/ J2 J* Q# j        else inc A_i by 1! R/ \5 w, u* A% @4 C
    end
( Y7 U$ W/ \2 c& J  Mend
5 H# t* x8 L! @- k5 D3 \% c7 l  O/ ], \
其中的procindex为整形,代表当前process的序号。* B8 P" k* K4 K
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-1-29 17:58 , Processed in 0.026114 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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