设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13226|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- I( D5 T5 A1 b4 {
8 [& {6 n( J, x! |
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' |* j0 U4 S0 {; ^9 c2 S" J

4 x1 _1 |4 L9 J4 s( N$ [; R; }begin P_read arriving
( S) z0 W7 t6 v( O! K    while 1=1 do begin
8 s" x- b) m  W: D        read A_tote from "data.txt" with delimiter "\n"
: u$ @7 j5 S$ @! n        read A_time from "data.txt" with delimiter "\n"
  S  W' k/ e  A7 n        read A_leave from "data.txt" with delimiter "\n"/ w2 z, |2 E5 [. i
        read A_picks from "data.txt" with delimiter "\n"
1 n! \- \* v- h# H/ @+ \        set load type to A_tote  Z% r. v: ^4 K, D3 p
        if A_tote="tote 1" then set A_induct to 13 z7 F% t. C5 ?. Q4 j
        else if A_tote="tote 2" then set A_induct to 2
4 [% T/ l2 @9 m! ]6 \* @% |            else set A_induct to 3   
9 N+ ~: W) \, U4 n! x2 m: |; }        set A_i to 08 l$ {2 \" |1 M7 ~1 J$ m
        clone 1 load to P_induction
# p  t- [1 H0 U/ K7 O- ~        wait for A_time sec' A, }6 u) U2 g
    end( J  t$ N7 r' R0 @7 k
end
% m( \& M0 i2 Q# t7 H, O% ~( U0 L
" I- p- b9 N* [' d, G  y) ]* fbegin P_induction arriving7 c; J& M, }& P  u; z
    if A_induct=1 then clone 1 load to P_pick1
( G2 w- d! ?; j6 j' m, m( g    else if A_induct=2 then clone 1 load to P_pick26 \0 P4 V* W! o4 D4 n$ a
        else clone 1 load to P_pick3# J9 Y) p0 M* ^# s* p+ H7 U
end
  X' E1 l% q3 G" H8 Q$ B0 m" F  k8 R* `
5 c9 x" C: a2 c* Q% ?3 l+ ^begin P_pick1 arriving
* r  V! ?: T6 B0 ~; E6 h- N3 t    set A_i to 12 O* |$ v+ _1 p+ N- I7 M3 O$ M6 z
    move into Q_induct1
9 s& v* b! S8 ?; V/ L    move into pickaisle.induct1
$ Q& {+ z8 ^2 G" w    while A_i<=30 do begin6 E$ I( _/ J" W/ Q- [# Y# _( H% D
        travel to pickaisle.con(A_i)
1 u( v; F" V! m5 b( i3 h7 E0 v' }$ }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( P8 G  q! F0 R/ g5 F$ J        else wait for 10 sec& [/ h8 c+ P3 I( R- f
        if A_i=A_leave then send to die! H) `5 j% w; T( D$ K: X- E
        else inc A_i by 1/ n7 ^; {& J0 S  L2 n! n  O6 x
    end9 Z* M9 ?! v; a4 I$ ]
end9 B+ X$ T  _; }# Q
$ r! E) [. U, k8 V, a) Q
begin P_pick2 arriving
( `, G  T6 O( W. x" l' l    set A_i to 11$ V2 @+ Y* E% y! ?# C$ I+ ^
    move into Q_induct2
1 X$ S# [3 T$ l! Y% s5 j    move into pickaisle.induct2% ^: G  P& `3 `/ q1 V- x+ x5 ?
    while A_i<=30 do begin
! P. g- c9 F, Q/ {" r2 @        travel to pickaisle.con(A_i)/ u" J$ k+ ^5 B5 E: k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) P; K4 o! C/ B/ t4 U1 F/ J, @
        else wait for 10 sec
+ U$ {( ~& F  _* @        if A_i=A_leave then send to die
, G: q9 u3 N' Q7 x3 h        else inc A_i by 1
/ ]( [; N% N2 T9 e3 U# ?    end
3 j+ \) v, u( R  X, nend5 s4 u+ J. d; x& B

) w3 f1 [9 W& O$ C: d+ ubegin P_pick3 arriving
+ u7 A$ U- u% E+ f4 G+ S& T9 F( H    set A_i to 217 ?" E% ~4 ~2 R& ?7 `
    move into Q_induct3) ]% u  w  _0 L% R5 J9 n" }. j
    move into pickaisle.induct3
) Q" b* B7 L9 T/ |$ D# Z    while A_i<=30 do begin* s' o7 O1 ~7 a. m
        travel to pickaisle.con(A_i)3 G2 w% i, p3 K# J7 H( K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ P. t. P2 r+ S) a4 Z, I        else wait for 10 sec: l4 d6 l# a8 x' N9 M2 f1 ]
        if A_i=A_leave then send to die
! F3 R7 E6 S) K* Q9 F) G' o        else inc A_i by 1$ m. s9 h+ c, S  Q8 F/ \
    end
6 V. f" R8 R% d7 wend

最佳答案

查看完整内容

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是个什么东东?
. ]! U! g6 s3 Y) F7 L- Mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
* B% ?& w7 n$ ^6 _+ {. M" o2 \% B9 g0 E' o1 L1 \
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。6 f  ]- s* t9 _) A7 E

5 B3 F# S0 P6 z7 U" l另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, ]! [8 v" y2 C7 @+ q
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ E; ~+ x3 [1 P1 u0 N2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: X( k2 [' x5 M9 _: S3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
% E5 m& f/ }: y" C2 B" ^begin P_induction arriving
: i. d0 N: S1 s) r& q3 ]& O- U    clone 1 load to P_pick(A_induct)
3 d2 P1 n( E3 y9 E* L* w2 [end最大的系2 p4 {! S( a/ |; p/ H

5 e6 J# D# s# Z5 c! P' Gbegin P_pick arriving
6 T; e- w3 e. k    set A_i to procindex * 10 + 1
6 M) \8 _3 g! S( U: z    move into Q_induct(procindex)( Y& Q$ E) ~2 x4 V- c' G3 d
    move into pickaisle.induct(procindex)
7 F; S: f& W% g1 j7 e6 F+ S/ l( Z    /*check the type of pickaisle.induct(i), for your last problem.*/: z8 _. x, [+ _6 l4 W" x8 L
7 T" s3 {) q. l+ A$ F  [9 N
    while A_i<=30 do begin4 S5 i4 k: D7 N3 P1 B
        travel to pickaisle.con(A_i)
& W( F/ q% v: R4 t- ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  p/ d$ L- L* d$ Z        else wait for 10 sec- l0 p  [  L4 e4 t' Y0 c
        if A_i=A_leave then send to die( ]& d5 z+ j5 @  o/ E5 m0 b
        else inc A_i by 1
% H( ]$ L1 N6 {0 o2 n4 b    end
4 x1 u  `. x) _8 |1 S7 B# F9 ?end
5 o3 U; F; k: P# O( ?0 h# O+ V' K6 l! M- e+ O. a' X
其中的procindex为整形,代表当前process的序号。; u' v& T+ C* L
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-3-28 06:39 , Processed in 0.016928 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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