设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14129|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 \8 k6 V  o! f
& h4 _. t( a& X' |5 |/ z4 g" g( [
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. x1 J: W+ c* o. ]$ [  s* n
5 S" M& c% H, Q
begin P_read arriving
- f& h4 I) t6 S3 a    while 1=1 do begin" X( v, r! C+ Z9 m5 S8 W
        read A_tote from "data.txt" with delimiter "\n"
* k4 F9 E  t  h5 ]" j1 r        read A_time from "data.txt" with delimiter "\n"
0 i% H$ t6 u9 G7 ]        read A_leave from "data.txt" with delimiter "\n"1 F! d7 g/ \  c
        read A_picks from "data.txt" with delimiter "\n"
# y! |6 ^) A3 a' _& M- [        set load type to A_tote
. J9 R: i2 ?1 O5 F3 y        if A_tote="tote 1" then set A_induct to 1
3 z9 M# M5 u7 Y! R  `3 p        else if A_tote="tote 2" then set A_induct to 2
1 R+ ^* ~* B6 I2 F2 w4 }7 f( A            else set A_induct to 3    * T$ f/ [# d+ J: Y6 ~1 K7 Z
        set A_i to 0
! [' `' x; M9 p        clone 1 load to P_induction
. h! V8 g* Z0 `" {        wait for A_time sec8 O$ R2 [. _8 O) }# M
    end
0 {$ x" g" y0 T: W9 G: c: ^end! M0 r9 \3 r& t% ]  ~4 D  B8 a9 y

7 F: _6 {$ h! c- E+ _1 zbegin P_induction arriving1 K5 V; Z! I/ w  T- w$ ^. S
    if A_induct=1 then clone 1 load to P_pick1
1 Z3 r- r9 x# V2 D: L0 E+ r5 S5 V    else if A_induct=2 then clone 1 load to P_pick22 Y+ Z  a, Q) N( C/ k( u
        else clone 1 load to P_pick3: L; W6 Z0 N+ \. S6 ?: A/ _! g
end
# ]. m2 T2 s' W. d1 y
( m6 I9 {1 C6 p2 j4 B* A: X% x3 _% f. {begin P_pick1 arriving# b( `/ w" |8 T- S$ x/ e3 O1 X
    set A_i to 17 B) S7 r; W* k3 E
    move into Q_induct1
* C% S& D7 }$ w  L1 r    move into pickaisle.induct19 V9 M6 M$ O6 b9 J
    while A_i<=30 do begin2 f" G3 |0 @' H6 _
        travel to pickaisle.con(A_i)" d2 p7 M7 U7 R5 r* d1 A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 k* W7 |6 T8 M5 {
        else wait for 10 sec1 c5 n4 ?' X5 M# j/ ]/ g
        if A_i=A_leave then send to die) \# Z+ _5 @6 \/ e- ^" l
        else inc A_i by 1
; Y5 ]7 B1 V$ |, @( c" c    end
9 Q& Z3 I7 Z# U! @( Q2 kend. y+ e/ J+ x2 |& r$ e0 r" D
! c$ e* r+ A" N
begin P_pick2 arriving) h% H5 x2 l* F. u& R- i4 |' N
    set A_i to 11( R  u0 L  G- ?/ |
    move into Q_induct2* Q9 x* q) Y$ W& I
    move into pickaisle.induct2
1 ?3 h; Q% j+ \+ r5 ^    while A_i<=30 do begin# _* g2 L$ j% d, W  R
        travel to pickaisle.con(A_i)
7 k  H. t( [, T& }4 @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ r$ E! K$ i3 h( w/ @* A3 J
        else wait for 10 sec
9 `' X' ^' F: R. Q( ?9 N. B" J        if A_i=A_leave then send to die
; Q! ?" O% t7 Y        else inc A_i by 1
5 x7 [; e% V2 l' R    end( l" p3 U& p4 v4 m% X
end$ L; d1 M- ?# s6 d

3 P8 Q- H/ p' ~begin P_pick3 arriving& O# ?% x) c; y3 z, L% c: v
    set A_i to 218 G2 V  W2 _, W# n' j" J6 f+ V0 V
    move into Q_induct3+ R4 _( V5 c3 v0 A! `5 e4 S
    move into pickaisle.induct3
2 A9 u0 s0 g8 d; ?2 R" t- Q& o3 H6 V5 r    while A_i<=30 do begin+ a8 g& P9 d# ?: p7 O
        travel to pickaisle.con(A_i)
- }8 x$ W+ Z7 t+ ?$ N* ^1 ~1 L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 }- L1 _7 i* X/ t$ E2 A" c" M" n        else wait for 10 sec
) L3 V* f( Q. m- f& Q; B        if A_i=A_leave then send to die
6 h# x& ~6 w& R& d        else inc A_i by 1  t5 O" [! k. r0 [  G3 A/ T0 n
    end
$ k3 N  U. O6 w1 d% B( s- uend

最佳答案

查看完整内容

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+ V- X) ?! x: a; A- C, }6 b+ i1 Emove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?4 r9 }% x- l* P/ j8 E! n# q2 b8 A
: s, M7 {2 l# v8 e; _* `, y' g' X
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" B+ t2 h$ X% U1 k
. n6 W! A3 {* L
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 G$ p4 |& ?/ ^9 w
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;/ Y; G" u6 M% Y/ y# q; M
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! A- W2 F* n. P% w* P/ I0 T  {
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# }& f5 @+ T. w/ f1 Kbegin P_induction arriving( H/ r0 R9 P; @+ M
    clone 1 load to P_pick(A_induct)
9 o* j, \; R  [9 a- j0 w1 O" Cend最大的系
  _( b, O: j9 \9 I# K7 t
6 r& o. ^0 z6 T  nbegin P_pick arriving
! _6 ]* @2 z2 y- r  X$ Z( ?  `    set A_i to procindex * 10 + 1' B2 C7 \% i7 Z: M4 H% K% X; g3 ]
    move into Q_induct(procindex)
" W% z; l! X: J" x) u    move into pickaisle.induct(procindex)# q5 L6 \  B5 @$ m+ V5 E
    /*check the type of pickaisle.induct(i), for your last problem.*/
/ p, V( G* t2 E6 N) U
' h) P+ B  R2 l4 x    while A_i<=30 do begin: m# Y! U( t( G8 l  V
        travel to pickaisle.con(A_i); L) S! w  y6 |  B1 P; b7 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 p* n$ B+ T2 h. z+ ~: s( H2 x        else wait for 10 sec1 T/ J6 G9 S7 `$ h$ O/ t3 H, y  u
        if A_i=A_leave then send to die
7 _6 o) P( P$ @! L9 P6 r        else inc A_i by 1, j% m- O* [. q8 ]1 h8 D8 c5 p
    end: u. K: g9 u% E5 b
end
; O- O1 e/ R/ B% X1 V
; S$ x% ]$ V% D: U0 A& {# z$ d其中的procindex为整形,代表当前process的序号。
! @. j& _! B  x( U- @  ostation和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-6-12 00:52 , Processed in 0.014927 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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