设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14333|回复: 2

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

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

1 j; u! K. B' ^7 e9 ]我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ X5 a. g$ L4 ~4 I( z, ^) J$ Q/ w, ]+ X- j) k
begin P_read arriving
( c2 a. Z3 X1 k. ], m    while 1=1 do begin
0 s& d# n. ~' O  L; a7 ?: t        read A_tote from "data.txt" with delimiter "\n"2 u3 j. n7 Y- U: m
        read A_time from "data.txt" with delimiter "\n"8 b% q4 D/ s" l. }2 W" l9 x
        read A_leave from "data.txt" with delimiter "\n"
0 C5 {9 F! i* H1 N        read A_picks from "data.txt" with delimiter "\n"2 ?- B  X0 e6 Y# [
        set load type to A_tote
# T. v. ?+ d( h8 `        if A_tote="tote 1" then set A_induct to 1
4 `6 c3 o% H5 y  X; f! B        else if A_tote="tote 2" then set A_induct to 28 ^; Y7 N3 O2 D  e* J
            else set A_induct to 3   
8 l/ s" B4 [) T; }8 }9 \        set A_i to 0
: S2 K/ D! v4 X' h  c        clone 1 load to P_induction$ Q* I2 U( t# L; G+ G+ O% w
        wait for A_time sec/ p9 Z  _; M& J" l7 b
    end
( V: J8 B9 {* V( y5 B8 r( l, `end
% C) I5 Z0 c8 G" |: e1 y
. u* ?# S" @6 q$ `begin P_induction arriving
% d* ~/ F$ {- b- @    if A_induct=1 then clone 1 load to P_pick1
7 i1 q4 [1 r$ D$ J" u) S8 B, d    else if A_induct=2 then clone 1 load to P_pick2/ p) H1 @2 j" m+ P9 H7 L
        else clone 1 load to P_pick3
$ l! d: b$ A# ]3 Y% Vend
  Z# J2 _4 |' K0 E; _0 \8 x
+ h, y' ?1 G9 X5 c% W2 _begin P_pick1 arriving8 o9 ~2 q8 c% N$ L
    set A_i to 1
  V4 Q7 F2 C% [    move into Q_induct1
% a( Y. {) f! R! f    move into pickaisle.induct1
2 x5 {  D9 F/ }8 U+ c' U; [    while A_i<=30 do begin
/ c/ Y. R# o. Q9 F- J  [$ i        travel to pickaisle.con(A_i)
  K0 v. o8 ]1 m0 h& y6 U" `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 a/ K5 I( w7 R9 L1 u7 Y        else wait for 10 sec* g1 [+ B' [) m; K7 u* j5 n- v
        if A_i=A_leave then send to die& L6 m8 V/ j( u
        else inc A_i by 1. ?! n. @1 J. \4 }8 L) y- }- O
    end
1 _# t1 S# B; Q& b3 L: i1 b3 aend
6 V- ^. X: X  [0 R9 J/ k
2 W  g8 v6 c" j$ ^. mbegin P_pick2 arriving' z" k/ {7 ~' Y9 A( y8 s8 c
    set A_i to 11, M4 u4 Z/ ^$ \- ^" t% |6 o
    move into Q_induct2
4 \1 Z- q( o, X0 F+ S    move into pickaisle.induct2
. o2 W( Q, q1 }4 f& v/ `    while A_i<=30 do begin0 b: J! o% k/ n
        travel to pickaisle.con(A_i)# I' c8 x; r, s9 k3 |: s. A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ K9 m$ a" Z3 t. s; a$ ^
        else wait for 10 sec- F; _. L/ Y+ z  m
        if A_i=A_leave then send to die+ M7 x, I  S+ z7 F* \* o; R
        else inc A_i by 1; p% B. [5 Y: t* V; a4 X
    end1 M) P/ M' K( x2 E+ p
end
1 B' ~3 p  z  S5 u, C
& {- D* y  L2 R/ l* lbegin P_pick3 arriving
4 a: x1 j/ u. g* F6 g" t: v    set A_i to 21
) f. C4 w# P0 Q7 `/ l    move into Q_induct32 b6 Z2 z7 K7 p# b5 [0 s
    move into pickaisle.induct3
: t8 W0 x) j7 N    while A_i<=30 do begin2 O7 Z, u0 D5 Z% {/ ^7 [! U7 _7 F
        travel to pickaisle.con(A_i)
/ j7 P6 K9 T7 V1 {4 {$ P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, R1 W% Y5 U, p! y# @7 K% o        else wait for 10 sec
0 F; f4 v9 X' D/ Y' ?6 M( d        if A_i=A_leave then send to die: n1 k9 T# J/ }9 r& {! D
        else inc A_i by 1) B4 P% d6 j( t/ w) e3 F
    end
0 n4 D. N5 S4 t% k/ k; Iend

最佳答案

查看完整内容

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是个什么东东?
# b) U( y; n. F/ \4 Gmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?7 I# u* I/ c. Z# R) A6 |

2 e( ]( u" ]8 L  P/ y+ I- yAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 Q2 e3 I! S2 k( K: h* {
) r- q2 t! v7 l0 A9 ]2 i
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 }6 F& `4 T* S' [1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% r1 u6 |) \9 D$ U8 V
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 v# m8 B5 T) X/ @3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 `) N5 G: q" O9 b- pbegin P_induction arriving0 i: p! M1 W5 ^2 `" l
    clone 1 load to P_pick(A_induct)
8 ~, N1 l5 d5 x' d: K. fend最大的系
7 }% g: X( ]  R7 `7 D' U, m9 v/ B* @4 A5 Q- g6 T
begin P_pick arriving) _4 n6 I! ?# f4 g$ H
    set A_i to procindex * 10 + 1
0 r  K& h$ S: g4 u; [( y    move into Q_induct(procindex)4 I2 Q; t* T; c/ a- n
    move into pickaisle.induct(procindex)
: C/ F/ i9 O* g, ]    /*check the type of pickaisle.induct(i), for your last problem.*/
. I0 ]6 A0 I3 [# u; Y2 Q
& }( r, K! _. T2 `- W* [7 y0 N    while A_i<=30 do begin
% ^& L3 F8 l5 \! S        travel to pickaisle.con(A_i)
" [! J9 R) p% K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  f5 W/ T' w& C( _# V        else wait for 10 sec
1 ]/ b$ H4 ~6 L9 \: ]8 d- `! _        if A_i=A_leave then send to die  T  t7 R" M5 l
        else inc A_i by 13 v. {( [" C% n  J1 K$ B8 l3 @) {9 K0 y
    end
: {- m% p1 J4 r2 I. vend9 E( M0 ?. G. R/ L
: c% B; L0 r! \
其中的procindex为整形,代表当前process的序号。6 r6 d% j/ k9 M8 @" c
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-3 18:51 , Processed in 0.021134 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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