设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14798|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 ^& F0 w1 Y- J* W  U$ ]% ], P) f6 @- ]6 }9 q/ F* t/ P: b+ {7 s- k+ v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。; n! \5 r/ j! z5 T6 M$ W1 i

4 [+ R9 d  C1 v2 Dbegin P_read arriving
6 \3 }. N; t# O5 L* T    while 1=1 do begin
2 `9 z% H/ c# D3 G% ]        read A_tote from "data.txt" with delimiter "\n"
- w  U9 f$ n; j6 S. _        read A_time from "data.txt" with delimiter "\n"
5 g2 A! C, T: S        read A_leave from "data.txt" with delimiter "\n"! W2 T! o' l( @$ U# U3 @
        read A_picks from "data.txt" with delimiter "\n"
# k- ^# a- |- g7 A. _# w1 e        set load type to A_tote2 H9 h% Q# l% ]4 E- J
        if A_tote="tote 1" then set A_induct to 1
4 `- n* f7 }' o, ~" x4 X1 `+ t        else if A_tote="tote 2" then set A_induct to 25 d/ G* e2 {0 z& t$ v
            else set A_induct to 3   
/ x+ I* Q- C7 S9 C* `% _! O        set A_i to 03 c2 x4 s' b0 l/ \9 [
        clone 1 load to P_induction
: v) T/ y! w1 I* X' i0 [' [: C        wait for A_time sec
* _" }; A9 _" U( K; |- F    end
9 m" g! k6 v- u% v1 bend
, D" y+ w- |. x) m; Q2 c) X1 c: j6 B/ l1 n/ s1 p7 n- O
begin P_induction arriving0 I$ Z  @% D# X  t! t& ^
    if A_induct=1 then clone 1 load to P_pick1: L3 U+ \. h+ }" X# |
    else if A_induct=2 then clone 1 load to P_pick2% c+ S) ]# [2 I& ?5 I+ S4 J
        else clone 1 load to P_pick3
2 b$ ~: k( x% v% t7 f$ F) Pend7 ^" i2 s* E7 n, a( j& k5 @$ _

. h& L/ ]1 E; x& F$ V# K/ Fbegin P_pick1 arriving. o; R2 b( ^( V7 S! p5 u1 z; N
    set A_i to 1
  U4 A- O1 H8 c5 a+ ^& S. S" e    move into Q_induct1" {, d. d$ C. o! [, L
    move into pickaisle.induct1
0 [, H! r* M- z& F' {' G' W. K    while A_i<=30 do begin
& R3 e, ~3 R7 T) @6 n* f. ~% N: L. \        travel to pickaisle.con(A_i); a+ X  E1 z, g* ~( v& a; O0 o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# l3 @1 X6 `' ^; k        else wait for 10 sec
: v3 b  l* r% t8 Z        if A_i=A_leave then send to die) C% M7 b5 d; ?) h/ h0 N0 v
        else inc A_i by 1* \6 l- Y& b. L& }# D
    end
1 P6 ?4 I3 X, E8 F! wend
2 ~/ q, s3 I1 s! l7 I0 l6 r- |; T' i- L% g: J
begin P_pick2 arriving  W/ L8 [  Z: \9 r" }0 D- S- ~$ p
    set A_i to 11
) d9 D1 B3 I" Z( W! Y& i5 a    move into Q_induct2
1 B8 c& d7 N3 n1 |6 g    move into pickaisle.induct2
# r4 ]" B! V) ^0 A$ ^2 C- r# ^, O    while A_i<=30 do begin/ W7 f! ^$ i' J, H( U* j4 b
        travel to pickaisle.con(A_i)
1 M5 d# T7 t& c1 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. }6 F+ i0 S; Z& A- N5 A) Q1 S6 Q6 Y        else wait for 10 sec/ H' ~( x. S: {+ s- M$ ?6 g) Y
        if A_i=A_leave then send to die
1 f" r- T( }( [3 z0 p8 j1 i        else inc A_i by 1* [" c$ S" m: j/ s0 a9 R; ~: N* x! v
    end
- J5 Z$ e( X+ x2 uend7 }% x2 N9 e" C  y1 ~6 I
* c2 w9 [! D' \/ I
begin P_pick3 arriving" ]/ _( R3 w. X8 m9 n
    set A_i to 215 I9 @) D& ^3 ~4 {0 J
    move into Q_induct3
$ J5 _/ f. d, l: h; f% D) N" W    move into pickaisle.induct3
5 d! a! v/ o0 u! q2 l- m    while A_i<=30 do begin
$ x/ W$ p3 R: X1 ]: {( t3 \2 L- q        travel to pickaisle.con(A_i)* Q& m  W( S, [0 y2 A, N' |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 c1 i: Y: ?0 p# y  e) M6 L        else wait for 10 sec0 _1 P& i0 Q" h0 o8 v6 j" o
        if A_i=A_leave then send to die  I1 Q* r5 |/ Y2 E/ w! Q7 Q& ?
        else inc A_i by 1- X. r& l7 B! t/ c1 b
    end
# v2 @2 b# v( |1 w  _6 k! fend

最佳答案

查看完整内容

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是个什么东东?& z: n! E" I  H% q4 a9 M" Z
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  A  D4 N0 M- X8 X1 o0 i
3 s5 B; Z! q1 X2 C9 T3 ?+ fAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. J  E6 q: F2 m

; _1 U! M8 x8 W. q5 ?* a7 J7 H) T7 y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( E% V; f' V0 r+ j1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 R2 @# o" n* E6 E3 J$ U9 N
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 F0 S) i! ]' b; N3 w. O1 `3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 z& g3 O! t9 ^1 a' V4 r: x2 v& Z" R
begin P_induction arriving/ K( I, x$ T0 \. i2 d3 q$ V
    clone 1 load to P_pick(A_induct)) ~0 {- G) ]  f; `0 i
end最大的系- j; G3 R. h" N! P- J! Q9 @2 W

4 g! M9 l6 Q" i& y8 p. g; O9 ubegin P_pick arriving  \3 t! Y8 L* T7 C+ N
    set A_i to procindex * 10 + 1- e9 u+ a- `' C/ ?' P6 y9 y
    move into Q_induct(procindex)
# K) e2 r2 W. v, P: J, o+ Y    move into pickaisle.induct(procindex)# C# b. z. ~( p4 a4 e8 d# \
    /*check the type of pickaisle.induct(i), for your last problem.*/
( ~& {* U! @! X8 V1 \  A3 A0 }0 S  C5 j2 x4 R7 g
    while A_i<=30 do begin
* A2 \5 H1 G% t& w* t3 j+ ?        travel to pickaisle.con(A_i)2 ]3 L- m; G& O7 s4 W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 _3 _6 N! s% `( Y        else wait for 10 sec7 f$ U) H3 f( `0 X2 B' N: W0 F
        if A_i=A_leave then send to die
% g. K5 @% X: ^6 W/ [        else inc A_i by 1
3 b, {. t, M# ^- }- ?    end
$ Q3 z/ V  H3 H0 @4 e8 ?$ Jend& i5 P, Z$ Q0 p& H4 @5 _1 q7 `
2 ~- e* b* i, P9 o& G- U( w  Y
其中的procindex为整形,代表当前process的序号。2 W# x1 _* c3 c3 |/ @7 g" D/ K
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-7-27 01:30 , Processed in 0.015065 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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