设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12449|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 T9 J. N& I, ]0 a% n/ @9 e4 r$ n1 L! ^
我的问题是,在每个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 }5 \3 }! |- z- P4 G/ ^' Q$ D* S# u, e' [' c$ \
begin P_read arriving
' _' @' F( m9 @: J1 l    while 1=1 do begin! n6 ^! a2 A- A* c2 b8 e
        read A_tote from "data.txt" with delimiter "\n". R* U4 e/ G% ^$ n  l6 L1 U4 L# N
        read A_time from "data.txt" with delimiter "\n"4 J& ]0 v2 L6 r- ~0 |
        read A_leave from "data.txt" with delimiter "\n"
1 W. y# X. t4 l) z0 `% h        read A_picks from "data.txt" with delimiter "\n"
2 [) O/ u+ d/ v5 n( M: }        set load type to A_tote& s# ~8 W+ ]1 [, n. K
        if A_tote="tote 1" then set A_induct to 15 T, I, h' C* A) Z$ ]( g
        else if A_tote="tote 2" then set A_induct to 2
' j( q; Q4 x3 M0 r, v% O; [            else set A_induct to 3   
* R" I* w: ?8 e3 Z' ?+ l1 a3 {% g        set A_i to 0# R' [/ O5 _/ Z! i8 u
        clone 1 load to P_induction
3 O# T% i: ~/ ~6 J$ b  I# Z        wait for A_time sec
. w0 ~2 J- L8 k- r8 G- \    end
7 |  x8 d3 \5 l: M4 ?end
: _( v  i$ D6 c; H; B( ~6 Z
% c. C" Q* V1 cbegin P_induction arriving
& n; Z2 e9 u; u) t) c    if A_induct=1 then clone 1 load to P_pick1
6 ?- j& A; S6 X. t4 h- w    else if A_induct=2 then clone 1 load to P_pick2
2 M; g% s* Q$ I. n7 ^        else clone 1 load to P_pick3
+ e8 s& f; F  N0 _/ b) L6 @: Oend) ?: R9 T0 L6 Y/ R
' V9 ^+ ^5 b* d0 U9 O
begin P_pick1 arriving
) z' |- p% u& r- ~* ~' |! n    set A_i to 1- o  C" _' f7 H/ R4 C
    move into Q_induct1  P% j+ [4 _4 S$ w" S( j
    move into pickaisle.induct1
! y/ \+ E: W' o    while A_i<=30 do begin
- R2 ~' ?8 U3 Y/ F        travel to pickaisle.con(A_i)
' x* f9 I; p  |$ _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. t$ v2 E1 B0 N" y
        else wait for 10 sec4 `7 F: o6 v) L' k7 b, o6 _. i
        if A_i=A_leave then send to die3 m3 ~$ I  n9 f1 g: m( Y3 m3 {! f, L
        else inc A_i by 1# u( ?6 @- @: M9 W  |
    end
0 d3 |/ n, x! oend
' E! _7 N1 Z8 y9 n0 _2 U+ l, }$ x$ C4 b2 E7 U' l' K* t
begin P_pick2 arriving* E6 \: E2 V. U5 o. e8 }- ?) m
    set A_i to 11
0 I$ ?4 ]# t" |! K3 p+ ^    move into Q_induct2
6 A' K$ F7 T7 f. F' L( L    move into pickaisle.induct2* @' h& [  N0 S5 ]
    while A_i<=30 do begin9 h5 t& p# z$ B! R0 @
        travel to pickaisle.con(A_i)" X6 t* E$ r/ Z( R8 H( I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 ~) |- a) _* o; S" F
        else wait for 10 sec3 }5 Y' u2 N8 G2 u: v" u, J7 V( @
        if A_i=A_leave then send to die' x5 B3 D) j; \: N: x
        else inc A_i by 1% n. ~* @0 G" O( U! @1 {, ~
    end
/ Z8 J* i5 a# Z$ G5 s* J* s  Jend( r1 l& C. X: K2 b  |

; m3 n& ]$ b- |& C2 c8 jbegin P_pick3 arriving
& ^! M5 z" q- E1 Z    set A_i to 21
5 F; A5 w& \# g  x2 }    move into Q_induct35 Q, `3 `4 w5 ?1 R, `* Q- K9 m
    move into pickaisle.induct3' @' q9 P  t, F- m; r8 q) r
    while A_i<=30 do begin
" D* J2 H, k4 n4 E3 `        travel to pickaisle.con(A_i)/ l' d% S* R" o2 F: U0 E$ W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 i% W+ p$ \& I; N; t; ]5 d" N        else wait for 10 sec
2 c. A' Y1 X* S* [' s# T& J; |        if A_i=A_leave then send to die
! {! C" C: v$ E3 }  W        else inc A_i by 1" G3 Q9 Z% S) S) ~
    end% b- U+ t) d* Q" t; Y" x
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是个什么东东?
% X' z$ n, X& a$ {move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) M/ s+ m, n! E* h

1 N9 o8 Y: p: D; H' T6 R4 C- \5 UAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; b# v+ F; E/ Y( ~2 a- o

: R* ^: E/ g0 A. K1 j: Z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:# I1 O' ]2 K; B1 _
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- ~; o5 B& e/ s4 d7 k- J2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# G$ i/ p7 w- t; R3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( x& X0 g1 x/ {, {begin P_induction arriving
5 I+ {/ z2 Z/ C1 b$ J    clone 1 load to P_pick(A_induct)
1 O5 ]4 n! {4 e8 p( b. Bend最大的系* ]8 ^) A, k4 C- ^6 }- i2 }5 D! x# r* n

, _3 F+ p( F+ K* d. Abegin P_pick arriving5 ~  @9 K7 E( ?, ?( e% H1 n1 N! c
    set A_i to procindex * 10 + 19 U; {) F/ F- O. O
    move into Q_induct(procindex)8 w5 y$ z( t: B
    move into pickaisle.induct(procindex)
7 p7 m* Y0 p+ A) v9 ]; ?3 }" U    /*check the type of pickaisle.induct(i), for your last problem.*/: e* f$ T$ D5 c

! g$ w+ m- w0 K1 X% J; |    while A_i<=30 do begin+ ]8 d9 U- Q; \4 }
        travel to pickaisle.con(A_i)* O7 }' n2 ]* W5 \! U7 |+ _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! g3 P5 `7 Z, k9 Y        else wait for 10 sec* b5 Z4 B5 j% y- y5 @6 r3 }% ]
        if A_i=A_leave then send to die# O. z- B8 D3 w/ r9 G
        else inc A_i by 1
5 z' b: @. e! |7 J9 S    end3 U% M' _6 c! {. g% \! z9 t
end! J+ ^0 Q1 n9 c5 c5 Q/ `7 o6 H* s

' c: R2 |" E$ E" K! r5 }" }! }其中的procindex为整形,代表当前process的序号。
1 D1 v0 _# L. C! M7 l% Vstation和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-1-24 15:42 , Processed in 0.017648 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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