设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14923|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ y# u% F% Y  y( a  @4 l

5 S# @9 A  J- i- c我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 m2 D  O. R( k1 ?4 v8 U' k
7 f  \8 `/ k5 k9 ?begin P_read arriving& @( d8 j/ l: j/ R9 j7 }9 e
    while 1=1 do begin
; h" ^8 A; h9 K0 s& J        read A_tote from "data.txt" with delimiter "\n"; ]( S5 L' N9 W' v0 i! Y% l
        read A_time from "data.txt" with delimiter "\n": g( q# P$ L: z( D- S" m
        read A_leave from "data.txt" with delimiter "\n"
' D, h# a4 |7 D5 C        read A_picks from "data.txt" with delimiter "\n"
+ ]! E2 m3 d+ Z8 O) K  `        set load type to A_tote
# U  i) J/ Y9 p# Y3 I        if A_tote="tote 1" then set A_induct to 1- |, f' I* q& k3 I
        else if A_tote="tote 2" then set A_induct to 2
8 ^& @) Q+ K( a4 e9 k6 t2 _            else set A_induct to 3   
3 X( X& A2 E3 ^+ b+ R9 h' I        set A_i to 0' S1 F* ^- F! H& C$ g, Q
        clone 1 load to P_induction
1 q$ A# M% g% M- T        wait for A_time sec
% i" q+ c5 n1 }$ S& z% q. w6 {$ j    end! B* Y( T+ H8 c; H# u, K0 }$ u
end4 z1 U' T) i. x  x" o

* r8 A# y: m7 ?: y( P2 hbegin P_induction arriving/ b' F, `1 n( l8 Z  S
    if A_induct=1 then clone 1 load to P_pick1' X5 _9 Q( V- T- H2 E" u$ b. X( p
    else if A_induct=2 then clone 1 load to P_pick2& J: X5 f/ k- B* K  R
        else clone 1 load to P_pick3
; v* e$ v* @6 O- j& E( h, `end; C/ u, S0 q2 E
3 i: m$ \5 f8 i. i& H& t( m, J+ ~2 B
begin P_pick1 arriving
& q: @; w; D: z. N# {/ l; V+ Z    set A_i to 1
2 r; [! K4 _3 R    move into Q_induct1
1 D6 Q6 t) d7 j2 v    move into pickaisle.induct1
9 V: e, Z$ g& p/ n. g    while A_i<=30 do begin% E' K3 N( @' n* f
        travel to pickaisle.con(A_i)
1 h# k! {' s( S( C( o: S  T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ v9 `0 C, s/ R( ?% o: \8 q' o
        else wait for 10 sec( Y& c& G3 x' ]
        if A_i=A_leave then send to die! y- ?) S5 Y$ S* k
        else inc A_i by 1
4 W9 `$ G* K; m! C+ L% e    end
. v2 j4 f8 o5 g# Xend
: q- D% w; `4 X  z' v5 }0 d0 T' d3 G7 T9 d: `! r7 B/ O
begin P_pick2 arriving; v& e% p. H- G
    set A_i to 11
& P) j* @8 v* o9 Z$ F1 h( a) I    move into Q_induct2/ [( t) c! T) p- N) c& l
    move into pickaisle.induct2
  e4 B# [) M$ `7 Q( O) Y3 W    while A_i<=30 do begin
* [3 l# E+ r! ?) U, {: A        travel to pickaisle.con(A_i)) ~7 C1 D% K- M5 W5 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 ]+ E0 b! u7 e0 w1 S$ K
        else wait for 10 sec7 t% Q  s7 S8 x8 U9 W5 j
        if A_i=A_leave then send to die
2 Y+ P3 y1 V( U        else inc A_i by 1! W; V0 o$ q% i: O  n' C. W- P
    end
, e& s0 S' |& d7 kend
* h4 J. E. j6 _6 r! X2 ]7 Q
; k8 y% G8 H" j4 `- V- u2 Tbegin P_pick3 arriving
) W% y- F' d# ?& M    set A_i to 21: ~( t9 x' S& m
    move into Q_induct3( e) j- S  z0 s; L7 P1 k/ z6 A, }
    move into pickaisle.induct3
: L' P- ~' {+ ^) B7 K. x4 I    while A_i<=30 do begin
% p" q6 _! Y# M: R, l# a, r1 }        travel to pickaisle.con(A_i)
8 R& n! X+ q7 g$ R  V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% i$ O, m& L% @7 W  a: m        else wait for 10 sec, {4 A2 p3 @/ M+ u# [
        if A_i=A_leave then send to die
- P) {% D" x: @( i& r        else inc A_i by 13 D8 e( |6 \" t5 |' V; o0 |
    end
* g; V& o) [. Xend

最佳答案

查看完整内容

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是个什么东东?+ x, h7 y6 @! D# B: p
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?* M: E: M) H1 I. X- f) J

8 r5 |6 ~/ ^9 AAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 E6 ], l7 a& A0 |. b& P
% a% B/ z* L- T+ ]; [( ~* ]
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 ~5 b+ H. \* |0 [0 z, Q, J, F1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;6 U3 p; R( ~. G/ Y4 X* n
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! \, |8 D: E; U- n3 `3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) w$ m' b3 a2 |  A  I: q& g
begin P_induction arriving+ G6 Z. [( F$ Q8 G$ Q
    clone 1 load to P_pick(A_induct)& a1 h0 V2 u- r- J% Q) j# P/ O  w
end最大的系4 O* V1 E  K- n! ?/ i$ U

4 t$ N; z8 O; r7 w+ V& `! Fbegin P_pick arriving' E! `) K3 C  t" S( g  x' S6 N
    set A_i to procindex * 10 + 1
5 q1 p% C/ v4 M3 B5 l! p! E    move into Q_induct(procindex)
/ z0 |: u8 y- a, x9 _6 ~    move into pickaisle.induct(procindex)' O% ^& r# i$ Y
    /*check the type of pickaisle.induct(i), for your last problem.*/
8 ^4 {6 I  @, x# B' C9 X$ d0 a: R6 @! c' c# t& A, L
    while A_i<=30 do begin
. C% \0 D( S. v0 {3 N5 d        travel to pickaisle.con(A_i)
8 e- t* l( R3 n1 s; _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 T0 ]. |: x1 \- U3 \        else wait for 10 sec
( y" D# N7 d( ]8 z2 D* ?: ]        if A_i=A_leave then send to die& W( @: O$ O8 w* E4 [7 V
        else inc A_i by 1; K" o3 F/ Z; Y! U1 j. P
    end
! h# N7 g0 `5 ]& C% \end
0 K8 R5 E, m) G1 V' X: i8 k; P" D; `- A4 y: U/ {( L3 R
其中的procindex为整形,代表当前process的序号。
$ d! F. P1 z7 W; I6 l/ ]7 E( Rstation和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-7-31 23:03 , Processed in 0.019433 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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