设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15424|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: R" \# n+ I2 J0 X8 j" y7 ^6 [$ h/ B$ c/ r
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
- J) g/ c, E1 d8 u0 a7 q: P: H( Z
7 F8 i/ v- ]; C. m9 W* ~9 `begin P_read arriving
% E/ u. E, ]( r3 ?5 y0 W: }    while 1=1 do begin* s% G$ E0 f8 t% J
        read A_tote from "data.txt" with delimiter "\n"
8 P. b: ~2 s0 v6 R% X' j) P        read A_time from "data.txt" with delimiter "\n"
2 Q( J) O( ?+ D4 ^        read A_leave from "data.txt" with delimiter "\n"; {" D) A$ f! p/ `, D
        read A_picks from "data.txt" with delimiter "\n"( p& T& i: ?, r0 M7 |/ H# Y
        set load type to A_tote
4 T% S# l1 a* |9 t        if A_tote="tote 1" then set A_induct to 1
8 I& K& S  w$ }4 D- x: B# W        else if A_tote="tote 2" then set A_induct to 2, Q9 L; G7 ^- D' k, F9 c
            else set A_induct to 3   
# P. c9 I& @5 k! f: V        set A_i to 0  I7 }( |! w; z& s/ [1 {% ?) e
        clone 1 load to P_induction
& C) D7 q/ A) z  i        wait for A_time sec
0 r/ m0 o: y* t% Q, j    end
4 G4 W/ J$ {" n5 Bend7 V6 V) U! `! j0 u* ?0 n/ W
, F1 y8 b! t. e2 c! U/ j
begin P_induction arriving
2 a2 v- K# [* ]1 m    if A_induct=1 then clone 1 load to P_pick1
2 I9 V! |. ~$ x    else if A_induct=2 then clone 1 load to P_pick2
; A" r! i, F' g* b0 u8 L        else clone 1 load to P_pick3- x: u3 s8 ?# y% ]4 x+ T
end
$ C1 s) c. Q  A# c
& O4 {1 X! l! x0 dbegin P_pick1 arriving
8 W  x* b& x9 `% y5 B    set A_i to 1
- U/ x6 s4 i& C5 l; ]& l/ k    move into Q_induct1
+ z6 t' \/ P& b7 `4 }9 d    move into pickaisle.induct1
! k3 d' x: R+ |; m' ~0 W- i0 u    while A_i<=30 do begin
1 N, l  T5 t& s8 [1 j$ I# e        travel to pickaisle.con(A_i)5 [) z% E" @8 o% B  v, Q% U  _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  K. {0 `; B; |% d. U        else wait for 10 sec& s: D- d" F0 k* k
        if A_i=A_leave then send to die% c) t) [3 W4 I  a( W& `" f
        else inc A_i by 1/ ^1 w; _% ?! z" Z/ x
    end, Y9 Z8 a, W; ~$ G; m/ i
end
& g6 G7 \0 w( h( z5 z
) R0 e6 c0 V7 jbegin P_pick2 arriving
: q* M  s4 z! E! m    set A_i to 11
( d3 ~" R% t- `    move into Q_induct2
+ L% n5 K7 v5 l( Y9 G    move into pickaisle.induct2
1 f9 ~" i: k+ S: ^/ a* C" T    while A_i<=30 do begin  A1 L4 k+ s) |
        travel to pickaisle.con(A_i)! C* r- X5 ?) |) w6 c: W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- o( J; z7 _# l; H" D3 Q
        else wait for 10 sec( A5 F1 {+ Y9 F6 [3 n7 ~
        if A_i=A_leave then send to die" }" F4 n4 O  w# b
        else inc A_i by 1
' ]1 k# g6 }( t% `( P$ T; N    end
& g" `1 f7 w- G8 Rend6 }  }( P% \" Z8 c' I" j3 ^
: g* \1 a# W# {( P4 |' m( r
begin P_pick3 arriving8 M' E9 w+ r2 E% _8 a6 Y4 w4 r/ B: ^
    set A_i to 214 [# `$ D8 G( d2 C& f  M
    move into Q_induct3
: j  n7 N' F7 @# X% i; Y5 [9 k    move into pickaisle.induct3
" w( ~! Z( Z. W    while A_i<=30 do begin
5 C3 t4 X- V- R' r        travel to pickaisle.con(A_i)- J) k* l1 x9 S* @% d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! ~+ ?8 L" w( f8 g/ {0 f
        else wait for 10 sec( C: ?1 N! ~' @
        if A_i=A_leave then send to die
3 N  e4 S3 |/ e4 _        else inc A_i by 1
. F) a7 F* _' y% q/ b1 y    end
4 p4 Y! R3 i( M- M. Z; fend

最佳答案

查看完整内容

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是个什么东东?8 r2 L3 _( k  I& Y2 k
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& b8 H: a- G  w) g# W8 ]

- X& Q8 V2 \4 I3 XAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
( {! T: H. K( e6 B* h" _
! W2 t( D. _$ X, x, A" m) \7 k2 v2 R另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 o! B( z; W  ]; a9 V( n, a5 M1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ Q9 U+ q" ?) E0 X5 X, e2 x
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
, L9 M$ j  @' P& w3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) r6 Q4 ]3 q, w8 P
begin P_induction arriving; n  P. K7 k" K) d
    clone 1 load to P_pick(A_induct)9 ?% }& L3 I. L
end最大的系
8 u" C/ |4 a! x7 V; E4 \% V$ r' L% E. o7 u
begin P_pick arriving$ L4 t1 ]( K0 ^. q- Z
    set A_i to procindex * 10 + 1
5 s4 {1 N- c6 a6 b% W5 s5 D    move into Q_induct(procindex)
: B5 J8 Z4 V4 f: u5 D$ ?6 h    move into pickaisle.induct(procindex)) }6 F) x$ I8 J. q
    /*check the type of pickaisle.induct(i), for your last problem.*/
; @8 K" |( Y! r: f( p7 Y( q
1 |% r, ]! t# g7 \& r' w5 h    while A_i<=30 do begin
7 Y' f' R$ ~( |3 z7 C        travel to pickaisle.con(A_i)* p# Y2 `) r( T- H9 ~# d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 S9 y  E1 s' `% ]  v! O
        else wait for 10 sec
6 Y9 f$ a( X( q        if A_i=A_leave then send to die
& K- q, t9 M, p2 j! u* M& V+ T1 v        else inc A_i by 1
* V& i1 ?7 ?9 s( m! H" }3 H    end
" j4 j+ Y+ D$ m9 Dend4 C' m  \- ]  C& k) W$ h
- w- O) }9 ?& U* ]8 z4 s4 h
其中的procindex为整形,代表当前process的序号。8 I% O2 j. U3 l. s3 @8 p) w; ^, t
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-9-10 11:26 , Processed in 0.016200 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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