设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15105|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" G% c3 d0 Z, i$ A1 W# K& H- I6 X: _
7 F  R1 ~+ @4 i+ ~# m我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 o7 ~4 M; ~0 J0 N( b
4 s% a/ C1 m# |# M9 W5 rbegin P_read arriving5 \! O( {. O+ }: g
    while 1=1 do begin
& A+ F( I4 N) n# G: L        read A_tote from "data.txt" with delimiter "\n"  F  Y7 r. _, H- Y; L% i( R
        read A_time from "data.txt" with delimiter "\n"1 L- N  K% B, Z+ ]; w; n, H+ }
        read A_leave from "data.txt" with delimiter "\n"
- j( ~5 r3 B  q, [* f+ P        read A_picks from "data.txt" with delimiter "\n"2 j; P* ^) g/ M
        set load type to A_tote; `& t- b: V' p
        if A_tote="tote 1" then set A_induct to 1& P- C; t- d) y& b9 ?, A
        else if A_tote="tote 2" then set A_induct to 2# S. _! Q# H4 n) I0 t3 C) Q
            else set A_induct to 3    6 I4 ?2 f& y3 [4 ]1 `5 k* Y, B3 ~% M" M
        set A_i to 0+ }$ ?& f1 p6 H7 l
        clone 1 load to P_induction  L& C0 y$ f% w3 ~8 {
        wait for A_time sec, l* @* H5 ^# U0 p
    end; ~: a$ u( S9 k- i6 Z6 P
end6 a$ W$ y( _# T3 J
4 i6 O( G7 q0 ~) D+ \$ v7 ~" T
begin P_induction arriving
, }7 d5 r" U8 S) P6 w4 H( P    if A_induct=1 then clone 1 load to P_pick14 E, L* J( ~5 {5 v& `+ x
    else if A_induct=2 then clone 1 load to P_pick2
* O8 F5 y' c" ~        else clone 1 load to P_pick31 K/ I1 g1 W! ]0 `: O
end( U  M( k/ O* o9 ?( j+ P
0 w' m4 {$ a: H. J6 k4 k
begin P_pick1 arriving7 B5 ?- M5 A2 E2 h) ^/ A/ P; `
    set A_i to 1
3 `* b4 H# b& m( W( L) j/ e5 I' |    move into Q_induct1
3 n% G2 P" p! ?0 `. t    move into pickaisle.induct1
& z3 r5 }+ G8 f/ Y# K    while A_i<=30 do begin5 ^$ o2 }& d1 ]# o% o
        travel to pickaisle.con(A_i)
; R$ A5 ]. w7 G$ [- p5 j' \. N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 ^1 M0 ~+ }8 f+ @
        else wait for 10 sec
* }2 d3 |/ w( C& b7 e/ t/ V& F        if A_i=A_leave then send to die
$ u7 A0 Y9 F( P) Q1 D( I        else inc A_i by 1
% P6 [  P- T' A8 X) w' S" P" p    end4 v3 t) W, g9 c  ?
end
& a! Q/ Q" l7 d5 L
% Z% N- w' w* J! v8 U$ Obegin P_pick2 arriving3 i7 e/ g; _1 d+ b7 ?) Z& t
    set A_i to 11  Z& g, T( ~9 L8 b
    move into Q_induct2
/ ?6 e+ K1 p$ s    move into pickaisle.induct2
6 G4 ]* V+ s* ^& B1 i    while A_i<=30 do begin: x9 b: _7 x8 S% z% p# N
        travel to pickaisle.con(A_i)
' K/ [" U( r( x6 T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 H( D& o# h* ~) c; E        else wait for 10 sec
4 r% B9 P, D. l$ R9 R( ]        if A_i=A_leave then send to die* g6 l" L! J# h. ^
        else inc A_i by 1- |, }; Y3 F+ p+ L3 Z+ o
    end9 g3 Z1 s6 |" K
end4 N8 |5 q* j, Z& c7 T/ _; K+ v
) f* A- ~; F7 ^% y! P
begin P_pick3 arriving) Z, \# q' N( N! y3 V! _& q
    set A_i to 21
* _# p! s/ s" ^/ _2 n9 p& _    move into Q_induct3; t3 g8 ?2 t( J4 E" m* s* @4 W
    move into pickaisle.induct37 s* j3 }3 K! i8 ?3 Z
    while A_i<=30 do begin. Z! R+ a" q$ z8 u+ M0 Y
        travel to pickaisle.con(A_i)$ ?6 ?( b4 ]9 U. M: u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 h. k9 F8 L0 O8 W+ `. x/ ^. p        else wait for 10 sec
8 f) ^4 F& c& z9 Z" p5 u5 R        if A_i=A_leave then send to die! A5 I6 \% t6 D3 h
        else inc A_i by 15 Y3 t# x0 N" [( r! ?& R2 z
    end
8 ^  C, ^, z# x& X( @& T( Y$ Uend

最佳答案

查看完整内容

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是个什么东东?
% w/ T9 @9 J' s* y# ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- u9 l; i; Y) n. D: a  j

5 Y8 P7 x3 r% p, I* n" G3 JAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 q2 j5 w/ f) J2 v" r

9 i  J' \; V( E: Y6 F5 V另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:6 N1 X/ F6 p2 _+ f
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 P6 |+ g+ Y; X$ U( \+ _5 v2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& k5 _$ ~% P. Y- \5 R' ]
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, }* G7 W) P& g8 Tbegin P_induction arriving
( d) G2 c5 n  R1 F    clone 1 load to P_pick(A_induct)
5 |: g+ d6 e1 x- N0 f2 G" w  e0 }3 uend最大的系) d( q% F) C) c4 r* `! j! i8 D9 [- C

1 U: C3 X1 {+ w! m4 w$ [$ ibegin P_pick arriving
6 t" N. `: a" E8 r/ u0 e    set A_i to procindex * 10 + 1
' v# C: I. r) N" Y1 ^    move into Q_induct(procindex)1 y# W! n5 g  {3 W4 [, c/ G
    move into pickaisle.induct(procindex)! B8 k/ m5 G5 t0 R, w$ A
    /*check the type of pickaisle.induct(i), for your last problem.*// ^, E$ D% |& I1 S: a" o+ M

! O' g' B+ v3 x6 B2 P! q2 W    while A_i<=30 do begin1 e! z# s8 `6 g2 V9 A' M
        travel to pickaisle.con(A_i)
) k- B4 z! H: \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' I: D( I7 h7 P; |+ r
        else wait for 10 sec
. W0 _+ @1 [: T# c        if A_i=A_leave then send to die3 x' K) T9 d6 a! @6 H( n
        else inc A_i by 1
- z3 y: m/ E' d- ^7 M# u9 I. o    end
# }8 [& @6 A4 p, U) Dend6 n, G! e/ [8 ]- t3 [% G' k
+ u* p- b3 _9 j' d9 b) b* b; }  \
其中的procindex为整形,代表当前process的序号。
. v0 n8 D. E9 \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-8-11 00:19 , Processed in 0.018890 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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