设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14295|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 \+ ~+ \  S2 v  S6 E- E. ]

4 }2 o. B  V+ c7 {3 k1 {我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 b, a9 Q9 G, L  f

: n* A( j3 B! bbegin P_read arriving: N+ \! b7 H% q/ M4 o( z& b6 ~
    while 1=1 do begin" A& d( p" ^$ ]
        read A_tote from "data.txt" with delimiter "\n"- B6 w* w  e6 O! b, B
        read A_time from "data.txt" with delimiter "\n"* C% m( _6 J, J  u3 A7 z
        read A_leave from "data.txt" with delimiter "\n"
2 x: a# w4 ]( X/ C0 z6 V        read A_picks from "data.txt" with delimiter "\n"+ l6 ?1 T7 K9 V& K9 A$ P
        set load type to A_tote
6 F4 k! \; a7 `0 R. M5 W        if A_tote="tote 1" then set A_induct to 1. F  J: t+ I( h- I
        else if A_tote="tote 2" then set A_induct to 28 P. e0 O0 x; y+ n+ x; {
            else set A_induct to 3   
; X! ~3 n- p/ h! |, {4 s; o' b        set A_i to 0
) P' J/ F! W7 |. ^% x$ i        clone 1 load to P_induction
( ?- S* {/ ]  k  p0 b' m: P        wait for A_time sec
4 D% H+ [/ k  F) ^7 n5 U- }. |    end
* |6 N4 Y! t4 [end8 f' F  {, u* R% K" |

3 F8 l- P* \8 T' H" Jbegin P_induction arriving1 @4 L# x+ `8 y$ l
    if A_induct=1 then clone 1 load to P_pick1( H9 w/ D, {+ @# @- e+ u8 k6 w0 _
    else if A_induct=2 then clone 1 load to P_pick2
+ W0 n: v4 z. E. M/ m0 c4 K( ^! K6 Q        else clone 1 load to P_pick30 X% g5 P7 z4 e4 E  R9 m
end/ y+ d( b2 U7 C, D0 A
9 @+ {8 u3 }4 h
begin P_pick1 arriving2 D5 V, a& F- D$ A7 U
    set A_i to 1
  S! ?+ [7 E+ ~    move into Q_induct1  P4 p, i- E. v5 F4 N! P$ O
    move into pickaisle.induct1
! ^" }! M! f: I" q" d( }    while A_i<=30 do begin
) K& m$ a+ r! ~        travel to pickaisle.con(A_i)
% v' J! y: n# _+ `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 H  k9 j9 x7 i1 R; w0 K        else wait for 10 sec/ ^5 ]: X& X' ]- v2 ~  d
        if A_i=A_leave then send to die9 i3 i2 G2 G3 x) x2 U( a7 W+ J
        else inc A_i by 1
6 M" N0 K: X5 T0 v  M, Y    end
/ C# U' K% V% J; Nend
7 V" o5 L& D4 m* j* s! i5 Q  d4 }" d% Z+ W% L. m: E4 e: \: }! t
begin P_pick2 arriving% H' Z, s4 S5 h# b3 J1 b9 U
    set A_i to 11
1 o6 v) K% F) S+ [% C    move into Q_induct2
' y  I$ y% p6 a! n" B$ z    move into pickaisle.induct2
# ]. `' F, m! h7 _    while A_i<=30 do begin
7 k/ I7 z; }5 ~5 M. x        travel to pickaisle.con(A_i)  A) g5 P6 ]- ?/ q) w5 {5 E, e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. P7 s& n' R1 G# U, T
        else wait for 10 sec9 r7 }" y3 u& |! y7 c5 z
        if A_i=A_leave then send to die
6 _: Q$ Z' o# |" M        else inc A_i by 1% y  O4 u7 G: J7 j
    end3 h+ A  e/ ?6 I* g$ R. q! Z
end- |! ]: T, {4 c1 C4 a

4 w: N. j, p$ P7 u0 f6 Xbegin P_pick3 arriving
3 S$ ]. m' h* D    set A_i to 21
. c4 [& P2 V" w2 P! o, o    move into Q_induct38 X8 ^+ Y( K) ?0 `4 H$ m  p
    move into pickaisle.induct3
( r: K+ c5 c' l  V- I' `    while A_i<=30 do begin- ?3 y3 c$ Y# L9 |* E
        travel to pickaisle.con(A_i)& c3 \2 j- A# g- R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ E% F; L, R2 n$ _. V; _. X0 h5 M+ R
        else wait for 10 sec
' a$ G* r0 T, `: J        if A_i=A_leave then send to die
4 l8 j9 ^+ M( |( m2 o. |# u5 h        else inc A_i by 1
% g: s( k7 y' W* [6 j) v    end/ q+ Y; X6 _5 u7 B7 s6 a
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是个什么东东?
5 e/ x% j- n% d. gmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) Z2 e1 V, r% N/ B8 @1 b; f8 M

3 `; |7 Q, o1 qAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: p% r* y5 i  P6 h! Z3 I9 f
) L6 |! N1 D" F8 V
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ h3 `2 c5 U" O* e  y' n1 G1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" J1 E; D  t0 z
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
2 {- g7 D: Y( C7 l7 D3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- e& J# T8 l" t$ X
begin P_induction arriving! e8 I& W- x; X. V7 J
    clone 1 load to P_pick(A_induct)  [& f$ a! q! M9 m  O  L
end最大的系
" U& U% w  t, Z2 j$ z& g: @7 f1 T; T2 O8 H" K  y
begin P_pick arriving
9 c2 a+ O: u+ P1 C+ D( F5 O* m    set A_i to procindex * 10 + 1
* p2 {' `2 ?# }1 G3 Z, z    move into Q_induct(procindex)* E- @, p; b8 E0 W. E' T" z8 s
    move into pickaisle.induct(procindex)6 U9 j3 A- R" g) z
    /*check the type of pickaisle.induct(i), for your last problem.*/0 R2 g& D; Q2 \/ B
$ T5 R! I$ `1 f% g
    while A_i<=30 do begin! |( T" S7 F8 P
        travel to pickaisle.con(A_i)( u0 T7 d7 |# V6 V( o; h5 G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' r5 H3 s7 A9 R- `( c% v8 X8 F6 ?
        else wait for 10 sec3 b# N6 H8 {' z0 p; ?4 [  T
        if A_i=A_leave then send to die, W5 l0 I: r- L( @1 h4 |
        else inc A_i by 1
' r3 f/ R/ R) |. Z1 l# S    end7 j7 N. E& f3 r% K: O
end
* t: d* W2 c2 L! ], ?4 V0 x; ?- I4 q9 N
其中的procindex为整形,代表当前process的序号。3 ], b6 h4 L8 P8 b' c3 u
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-29 02:45 , Processed in 0.013090 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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