设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15633|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  s' \9 @  E5 a- S' N+ r' n
' E* p9 s, J+ H' f' [( ~我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' W- O% f+ P! b' U# ?' t' n! I! n5 w& }. e" `% b
begin P_read arriving- X! e& `7 o- M! c0 V
    while 1=1 do begin
/ X/ g3 I3 N1 {        read A_tote from "data.txt" with delimiter "\n"
# r- |2 t7 P6 ~4 b        read A_time from "data.txt" with delimiter "\n"$ p. C( v/ r: C: d( V4 z$ w/ v
        read A_leave from "data.txt" with delimiter "\n"* D/ ]4 @- U9 X3 l. x
        read A_picks from "data.txt" with delimiter "\n"7 t8 {; Z1 g- \( x9 I0 C' e
        set load type to A_tote4 @2 Q$ ?# X, i. k: [  ]
        if A_tote="tote 1" then set A_induct to 1$ A5 X* Y9 r8 O5 E# q+ s& Z1 K4 r
        else if A_tote="tote 2" then set A_induct to 2! E: ]8 G% {" _' V0 [- }
            else set A_induct to 3    9 z9 X. d& Y, U, X: w, M  Z; G
        set A_i to 0& u+ S. ^7 U3 ]* P1 l
        clone 1 load to P_induction
* ]- @4 Y" S' l  c4 f# ]: n9 M        wait for A_time sec
4 C" \  e9 `3 h  N7 z; S1 C$ M4 T    end. r& P) c4 @* N2 j- g' P- g
end
. o  @. T- j! m( o% b; i
$ c; Z" u0 b! t$ kbegin P_induction arriving
3 m$ x2 m$ F* Q2 V( \    if A_induct=1 then clone 1 load to P_pick1
% v( `( n/ ]8 w) E/ w    else if A_induct=2 then clone 1 load to P_pick2
% [% J/ \5 `7 \& {        else clone 1 load to P_pick3) G4 j2 e# J* F$ N* A
end
4 l) g/ s! v  x" m& C
, N! g- Y/ Q5 ybegin P_pick1 arriving7 }2 l: J: B8 @
    set A_i to 1. c+ B. x/ ?# C. n0 ?) ?. J
    move into Q_induct1. L. D# M' O2 e, ?/ Q
    move into pickaisle.induct1
7 ]9 }& G( p% M$ V# y3 p    while A_i<=30 do begin* a, g. F, R1 {! w/ ~7 s
        travel to pickaisle.con(A_i)
, A/ [: b$ R4 S; \1 E" D8 R$ j: w+ l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% p& R) t0 y& M; f% o$ r
        else wait for 10 sec6 A) K( a+ i% f2 ^7 o
        if A_i=A_leave then send to die
5 ?; s7 [1 `( C& N        else inc A_i by 1
, S9 e- x' S* Y$ w  N* Z" E, Y    end% t! s& x5 L4 D. `7 r3 ^
end! U& m  T% l+ R4 k4 x, p2 Z- m
8 H- K1 x( L- n( @0 b% h" [
begin P_pick2 arriving
2 j) o/ a- u) ?    set A_i to 11  K8 D$ h0 K% a% k2 k6 J% O% _
    move into Q_induct2# E+ U# ~2 h/ u/ g- I
    move into pickaisle.induct2
  e1 N& }/ F  w* A7 A) c; g    while A_i<=30 do begin) ~! m3 W8 E, q& c5 g, ~( l
        travel to pickaisle.con(A_i)5 x; Z" f& J* D3 F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 x0 l2 |9 S+ B2 g. M9 T2 |        else wait for 10 sec8 S8 B/ ]- `* {& J3 u. t5 C6 |
        if A_i=A_leave then send to die; p8 ^- P* s2 p  \  u: _" r
        else inc A_i by 1
* w. O9 M. P8 w    end
! N  T  l+ A7 y1 _3 ~7 ]2 S/ x0 cend
: V: O9 `8 [' D! M- U+ M  J: F& m, j7 Y% {: G
begin P_pick3 arriving
7 ~! e# |4 `! `) r& Z" y1 [    set A_i to 21
4 [8 d4 ~0 z+ b, d( C    move into Q_induct3
* y% Z2 _6 h2 F  b' U7 `0 s    move into pickaisle.induct3
9 {  C7 z1 d# v    while A_i<=30 do begin
7 b# A6 T" ^' Q# b        travel to pickaisle.con(A_i)# U4 L% N- W) t5 f% k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- i, p/ e/ s& `& H% y# {. x        else wait for 10 sec# u( g/ q2 p8 t3 h3 Q
        if A_i=A_leave then send to die
  G0 ?7 H" o6 T/ P        else inc A_i by 1. F4 g& l1 P; ~2 D
    end
9 {- K: L3 P! _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是个什么东东?
) a) O/ u( C! J: s, D! lmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 V# j& [: n- s5 F; Z1 c6 k& v$ }8 X9 O
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: b( y2 p5 w3 z( x: F& @5 X! y  E7 ]9 A3 @9 F
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ N- Q$ o  x5 d2 f
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# t( ?0 B$ A  l
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& }, W2 o# ~/ u, {; p9 v+ I
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ q5 L1 i; C/ R( y& Fbegin P_induction arriving6 x6 y) v9 ~) a8 a+ o
    clone 1 load to P_pick(A_induct)
# ]  G+ |; I' ~( lend最大的系% z% H9 ]% b4 Z0 z! F
* r4 _7 t. c& S, p! W. S' u
begin P_pick arriving0 W+ j/ W5 q' `- k! d2 u
    set A_i to procindex * 10 + 1) m0 D0 _# V( Y( J+ W
    move into Q_induct(procindex)
, L4 H" Y0 H+ ]# ?2 E" @2 S    move into pickaisle.induct(procindex)2 O( q; y; |* P8 l
    /*check the type of pickaisle.induct(i), for your last problem.*/
; D3 l8 u9 |3 C1 ^" R. y2 i2 o8 C, |2 A1 Q
    while A_i<=30 do begin
5 e" ?: |( Q* ?3 s, J- r: B        travel to pickaisle.con(A_i)# I* _3 X6 H* w: n: V/ `3 l0 N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" o" K0 B" ]& Q9 o$ s        else wait for 10 sec
8 N; R( K* o$ F. W7 ?$ h6 n        if A_i=A_leave then send to die
9 n, o/ z( e; \, [7 l0 ]        else inc A_i by 16 ~6 I9 T2 i' C
    end2 H. |+ E+ m$ A% {5 d5 F' ^
end
, Z2 p; A) o2 v& f6 Z0 E
. Q* I# Y+ ^/ N$ q3 v& b其中的procindex为整形,代表当前process的序号。
, f/ p/ j6 e$ ]9 I+ Gstation和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-23 12:55 , Processed in 0.021040 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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