设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13776|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- f, h1 w" Q$ @2 ]2 A
) y, Z4 }% J2 @5 p% I& y" }3 P* 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中的数值,不知道会不会有什么不妥。
, Y! f6 U3 C$ X" V# |) Q0 O
5 t( T  w- b' a4 K3 W$ u5 b  wbegin P_read arriving
7 d' k7 D' O- S, C' d3 m! n3 A8 `4 W    while 1=1 do begin$ ^* D3 {$ X! a" i: V6 H
        read A_tote from "data.txt" with delimiter "\n"
/ z2 d4 t) C. f- Z* ]8 b0 R& ~        read A_time from "data.txt" with delimiter "\n"7 P# P4 ]" B4 w. k
        read A_leave from "data.txt" with delimiter "\n"
/ p1 a' \/ ^# \. [: K        read A_picks from "data.txt" with delimiter "\n"
! ~7 i4 V- o! Z" D. ^" h        set load type to A_tote
' s9 _* B& G8 w7 _) q/ w        if A_tote="tote 1" then set A_induct to 1( G# E& ]/ T; @/ C) B% `- M
        else if A_tote="tote 2" then set A_induct to 2
% [+ a( N1 _2 K; b& \4 P            else set A_induct to 3   
5 T. x$ j) P1 k+ t        set A_i to 08 R& p, C6 p! o6 s2 V
        clone 1 load to P_induction3 u8 s7 |! L7 P; l% y. ]
        wait for A_time sec3 R0 I* K" L6 ?, e
    end
& I0 a( G8 D$ j+ c( Yend9 C- q- W' y! C
0 a% s+ {; P/ h% S! E
begin P_induction arriving8 ^6 U0 T$ u: j8 q7 Y+ a
    if A_induct=1 then clone 1 load to P_pick1
' t, K2 T+ v8 B" o! n3 m    else if A_induct=2 then clone 1 load to P_pick21 P/ \( G' [1 G2 Q2 {3 C% X
        else clone 1 load to P_pick3
& h! y! U8 L1 B3 J3 @. T) x8 Mend
8 S7 J% x+ W( ?# x
3 ^7 ~/ E/ k) a, Xbegin P_pick1 arriving
, L( A1 i* ]% a' t; x) U! i    set A_i to 1+ I5 W$ M! R. v; F* q2 k
    move into Q_induct1  M. P* A, `1 v! l
    move into pickaisle.induct1
8 f" _+ u* W6 {% `, Y+ l" r; h    while A_i<=30 do begin: B1 \0 v4 m6 B; p" o& X
        travel to pickaisle.con(A_i)
4 J" n; b) }3 o! h! [8 M$ ?! H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: T" O) ?: j% D
        else wait for 10 sec
' R4 i: W9 v& T% }  A        if A_i=A_leave then send to die/ f  l$ f" _# {, h5 {. d8 Q
        else inc A_i by 15 {- u  {: e) s# H- i$ L& \9 B1 g
    end3 O- I5 j# P* ?6 h
end6 q8 h, |9 w& I& [" D
) E6 m% j* Z6 j$ D( N' r
begin P_pick2 arriving! d3 |3 Y3 {9 i9 p
    set A_i to 11
! W+ v# U& r" @/ B8 B8 n8 w2 x    move into Q_induct28 D+ K' u% H! g
    move into pickaisle.induct2$ b: w9 O( ~% f  O
    while A_i<=30 do begin
" v$ }5 @: c; u9 o8 w        travel to pickaisle.con(A_i)4 Q5 b# I. C! K* p  X" n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) a3 P; ]2 m4 g4 {; }        else wait for 10 sec
0 E: S1 w$ m( E0 ?        if A_i=A_leave then send to die
& V/ e3 {3 k  f" B6 Q        else inc A_i by 1
$ _2 V8 Y$ |8 c+ c8 p, B& F    end' `$ h6 M4 K0 @" b3 W& }2 [' L# y* y. W
end' X% R7 U) ?2 {3 e" ?, i0 X- o, H
' y" s) G8 f. A9 c5 ^
begin P_pick3 arriving% v: `) ~  Y+ c; }1 R) y9 z, |7 M: |
    set A_i to 21
7 N  r( ]% Z9 r+ L2 _, Z: b: y    move into Q_induct3' m( k* w) s# O4 u' I) z
    move into pickaisle.induct3
# z7 z7 d* G- L! p4 `' K    while A_i<=30 do begin
' U& Q& A0 e* w2 M! D0 ^1 m        travel to pickaisle.con(A_i): l4 G9 R7 {$ j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 t! Q* Z$ S/ K+ W7 m        else wait for 10 sec$ s% _* Y/ }: W  p7 i$ r" g! l" |" ?
        if A_i=A_leave then send to die! [. H0 D0 u; r' i' v: o4 K
        else inc A_i by 1
4 t( P. _' }2 h6 o    end
  Q) \$ E' E# p! j1 t9 jend

最佳答案

查看完整内容

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 e& e8 \- F
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ ^. C. a, H2 G- I/ `0 O  R: v& n" }$ c+ R1 H7 }, u9 p" Q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 }4 x6 H! \% b- d+ }& Z7 \3 F

5 C" _# I# n+ C3 N2 d/ \" t: O' U# Q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, M. X6 x1 j0 h' M6 c
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 r" @8 `$ L4 c( I6 d2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' L4 ]- d' W4 o, U% |+ c7 ]
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ q7 X; u& F  x$ ~
begin P_induction arriving# D: d) D+ e( I2 e2 H
    clone 1 load to P_pick(A_induct)9 o. ^2 J7 h* f1 c, D. i/ u2 s
end最大的系$ _8 `; q2 j& s: X. u

" }1 Y* s% n6 J5 z  Nbegin P_pick arriving
: V* q. k7 u. e    set A_i to procindex * 10 + 1
) F( f5 }, ^9 C( {    move into Q_induct(procindex)
4 P' o" r9 y6 Q- |1 q    move into pickaisle.induct(procindex)
; H* W4 R' n1 e6 V( d+ W    /*check the type of pickaisle.induct(i), for your last problem.*/( Y' }& c9 T) {8 l! q& D
$ [9 {0 m" t$ |/ G! Y
    while A_i<=30 do begin+ W6 M1 b9 o- n4 k
        travel to pickaisle.con(A_i)
. q1 b; o  v7 G7 D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! v7 |$ G! B3 d7 m( u1 V0 R        else wait for 10 sec3 ^" ^( q, w  b3 J
        if A_i=A_leave then send to die
4 D  f  f8 L& P        else inc A_i by 1
" S9 B8 v3 T  J. a: E    end* O7 E6 M# A# s" E0 u* U, H3 [: N# n
end0 U( `) |9 R( O: O, J

. @) [- A  M# m; I其中的procindex为整形,代表当前process的序号。3 S5 ]9 I2 i% Q
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-5-4 12:16 , Processed in 0.020603 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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