设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13058|回复: 2

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

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

$ h' d4 y/ m2 _0 ~, r5 O" C& P我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 O# D: z+ @/ o- a7 x% Y* D
& f, U3 D" J( o+ m4 N% tbegin P_read arriving+ P3 r* E- b9 Q
    while 1=1 do begin
) k1 {- w, w0 H$ O# G/ E1 g, U        read A_tote from "data.txt" with delimiter "\n"/ y6 X% J0 U$ u/ M
        read A_time from "data.txt" with delimiter "\n"
  @( W* s/ S" _2 g4 d8 p        read A_leave from "data.txt" with delimiter "\n"1 \' R2 x7 ]1 C' J: V
        read A_picks from "data.txt" with delimiter "\n": c( Q$ [/ G% N7 w( `* H. o
        set load type to A_tote
& v8 r- s/ e, Y* p        if A_tote="tote 1" then set A_induct to 19 W. ~$ |: N8 T; N6 P- V: Q9 U% a
        else if A_tote="tote 2" then set A_induct to 2$ T# V9 {' K2 U# e
            else set A_induct to 3   
3 C2 {7 w- `( y6 b8 }        set A_i to 0
0 j1 B( U6 k9 J/ l& X        clone 1 load to P_induction
- S* b  m9 z) ]& @3 N        wait for A_time sec
! C7 y4 N# {0 y    end8 h. u1 @+ Y/ E9 F4 U; k
end- I& I5 f/ `9 p( U6 K7 y

# {) J& D1 I- ]# _  k8 x1 wbegin P_induction arriving
, H$ t( B# i) d5 X  ]    if A_induct=1 then clone 1 load to P_pick1# Y; U+ w  Q* |2 s
    else if A_induct=2 then clone 1 load to P_pick2  k! s! Z5 t2 [+ D" W3 z  v9 u
        else clone 1 load to P_pick35 Z( k% U# f  m3 ~$ s( y9 V- D  K' D- H
end
+ ~3 \& x6 a1 T$ c" v1 i" [3 }% p7 g" \4 Q' u( ?
begin P_pick1 arriving" d& G" o% Y4 N' a- F" v6 R/ Q) Y
    set A_i to 1
4 S. |6 I) c; b  C1 W    move into Q_induct1
- Z/ x4 L$ x2 G5 ?    move into pickaisle.induct1
8 ^% z% }! t5 x8 L1 ]7 U: q: b6 S    while A_i<=30 do begin2 {* p" U) L+ j1 b/ B9 d9 m
        travel to pickaisle.con(A_i)' F$ I+ O( e5 n, u* G: m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* g4 s4 Q" p) U1 Z' ]
        else wait for 10 sec
4 W7 X) @+ k! @! @$ S        if A_i=A_leave then send to die
8 g0 [& ?# E4 }- T  j        else inc A_i by 1, W( B. F; [$ ]3 o9 @
    end
8 ]  \/ M; q- x; @6 a( \end! J4 I$ i  R! h/ t; D) i0 r# w0 M
! i! j+ r3 q, O# k- I! d& V5 z' ]& |
begin P_pick2 arriving7 S8 K4 f  Z) r4 a
    set A_i to 11
& }* L- [1 J4 @7 D0 T    move into Q_induct2
/ x; s# Z0 ~; ]    move into pickaisle.induct2
$ u; R0 E% M1 k) [1 a1 M    while A_i<=30 do begin
: M  q- z' h: V( V( U5 @7 u7 _( |1 I        travel to pickaisle.con(A_i)0 x4 X5 C# I) W4 o: X4 `; q: G* B2 u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ D4 b9 H8 Y' m+ f/ @
        else wait for 10 sec) P4 a6 B9 n7 e
        if A_i=A_leave then send to die5 e: Q* I0 H! Y3 k1 j8 R
        else inc A_i by 1
5 A1 |: ^% o/ ]2 B; w3 U6 q    end0 S; H; O# e- F* B+ ]3 [. o2 k3 {
end& D' ?5 f8 t( I- G9 T& g. G$ }. D
. B. ]3 G" U; l& ]; Q) M
begin P_pick3 arriving
5 g  J4 W* e( c: S: P    set A_i to 21
  K! `0 i" q- G  H1 J    move into Q_induct3
0 P+ L+ I7 ]( Z    move into pickaisle.induct3
/ ~% E1 e, ]! ~4 V, f  ^* o    while A_i<=30 do begin7 j3 j. L6 X4 B- y; p
        travel to pickaisle.con(A_i)3 `+ \% x" C& ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- j  j$ z0 L! ^6 T, ]& t. y0 w        else wait for 10 sec
  j0 |* m+ B" V- h& a- K5 l# o. v% s4 S        if A_i=A_leave then send to die
: X( Q. Y: |2 b9 @* x6 B# ]6 h        else inc A_i by 1
0 y" [$ W2 x5 Q0 y7 h  f& J    end
+ i$ B8 s; ]1 Eend

最佳答案

查看完整内容

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是个什么东东?& q6 x) x) z" O" ~& \
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
* [1 Y( g9 a8 l# F
" R$ V6 j( ?, p% T, RAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% t' [7 c0 j$ Y% \8 @: l! b* r; L5 z8 M* W3 C8 _
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- x1 R. k8 q5 L, K0 l' L
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 S3 P/ S$ o$ H0 x: c+ c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;* ?0 }( P9 Q9 }- f) p7 F
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ q1 }" F- j) M( g( j
begin P_induction arriving0 u1 N# r3 D0 o& K
    clone 1 load to P_pick(A_induct)
; K, k+ x! \5 zend最大的系
8 S: H9 C# ]; ?% Z( Z8 m, n, D
begin P_pick arriving% f7 d0 G. `& |  W$ X
    set A_i to procindex * 10 + 1
: J- w3 y: v  b/ S  E, j' p    move into Q_induct(procindex)1 o7 k) ^# L+ A% o! D
    move into pickaisle.induct(procindex)4 y) C' P2 B5 T' M6 W8 {& I
    /*check the type of pickaisle.induct(i), for your last problem.*/
/ y* o; _) c2 _" g& n
( F5 V- o& {- R5 u. U3 ~* g    while A_i<=30 do begin, O1 p7 X* g& Z* k2 |) C
        travel to pickaisle.con(A_i)$ G2 b) K* c7 w. Z, S) h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" u8 t, `/ q5 a$ W/ C) e
        else wait for 10 sec9 k3 \9 c' ~; A8 [. J
        if A_i=A_leave then send to die6 R2 d. F+ [; N
        else inc A_i by 11 a' e( M( ~1 E& S/ i
    end
7 p  x$ z# J+ F& Xend
, Y7 v0 p- v- |/ M; y$ D9 @6 V4 Y7 V! K
其中的procindex为整形,代表当前process的序号。5 H2 V  W0 V  V( _
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-3-14 13:51 , Processed in 0.013216 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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