设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11735|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ z9 Z3 \- E/ u0 O5 P, D: r2 S: U( m+ Y! x/ K" X0 H; T
我的问题是,在每个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 [8 [2 [$ R# s
1 p# N2 q7 Y- l! Q5 U
begin P_read arriving/ I# c7 M/ H3 G# o/ L: {& l
    while 1=1 do begin' _0 F; a+ R6 p( Y* a( L
        read A_tote from "data.txt" with delimiter "\n"" |2 q9 A& Q( X- c) J
        read A_time from "data.txt" with delimiter "\n"
3 K6 G( S/ d: F$ F; ]; C, a        read A_leave from "data.txt" with delimiter "\n"# i5 G. d; D; n3 D( R5 a
        read A_picks from "data.txt" with delimiter "\n": S5 d' u& T% S  }
        set load type to A_tote
8 h& h- n  a9 u6 [, P3 E        if A_tote="tote 1" then set A_induct to 12 U. s; N. g0 p
        else if A_tote="tote 2" then set A_induct to 2
6 Q4 S0 C" n$ I3 i            else set A_induct to 3   
1 N! A2 l- H8 ]7 M* n        set A_i to 0, W, y6 Z/ w5 w# }. @: j
        clone 1 load to P_induction
1 B3 a. Y3 k( a; @) c        wait for A_time sec
% f. C  i( _8 ~: W! s    end
1 g( k8 j+ C; s7 U6 Q# iend8 k  U/ a8 v& a: H* A) r
5 M6 a9 L! g7 O$ W1 n
begin P_induction arriving4 P- Z" x7 K1 `7 w3 [9 j
    if A_induct=1 then clone 1 load to P_pick1
. b% A" A7 T- |" H' ^    else if A_induct=2 then clone 1 load to P_pick2
5 s4 ~7 s0 U* {) J% Y7 `- ~6 D        else clone 1 load to P_pick3
* x# K  w3 U, c5 ~5 C1 T4 Send
! Y/ u7 Y  t& n8 e2 g( K& Y
8 r/ Q, `" S  Wbegin P_pick1 arriving
& f# |, q1 {& f    set A_i to 1) z- F, b, u# _/ _! d9 I& `
    move into Q_induct1
% u# O# Q3 {9 o: U, j" E( N' _    move into pickaisle.induct1
/ k/ _( H1 w. A- _; u% u. n1 s, p- M    while A_i<=30 do begin' J- x( Q- p+ p0 l8 ?9 Z! Q; H5 g* j
        travel to pickaisle.con(A_i)
- j, o7 Y5 o2 E1 H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 }# }6 S3 F) U1 Z4 e
        else wait for 10 sec  r  `* Q' K3 d- c5 [& a
        if A_i=A_leave then send to die( E% Z, W+ `# G/ v* \! _/ H
        else inc A_i by 1
! c1 {1 `6 ^( H4 r+ z3 Q    end1 Z; P& T  E5 P$ K+ T% d4 P. P
end! ?$ Z# c4 e5 ~) @2 G
  x6 r8 @& i) F" i! a6 N# X' w) n
begin P_pick2 arriving+ C( y5 m4 O9 P! y( l; `
    set A_i to 114 ?; L: }2 J% e) y
    move into Q_induct2, o9 P& |: z; Q2 h5 v
    move into pickaisle.induct2
2 I/ J8 u( f7 M5 x1 {2 N  ?    while A_i<=30 do begin
4 l9 q% |: ~9 g6 c1 y- d        travel to pickaisle.con(A_i)
! |( G$ C0 R1 u- a7 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. X7 C" B9 W/ ]; M
        else wait for 10 sec# E  {" R) v" r2 d% {& o2 r, O
        if A_i=A_leave then send to die
* Y# _$ g8 p* o1 K. E0 i4 O        else inc A_i by 1, K# I+ g, S) `4 \. W" h
    end
) ]) c. D) z2 {% l7 H& oend7 t+ X4 v* ~  ~3 ?7 N2 K

" L7 J9 U1 d, ^  C: B/ pbegin P_pick3 arriving
! N6 l2 u3 l3 v9 T% n/ c    set A_i to 214 ^3 ^5 a# g5 G& O& ?
    move into Q_induct3
0 C7 E. P! D4 F% d) @- r5 q& }    move into pickaisle.induct3
" G5 ]7 q& R6 t1 G, t$ U( v2 s    while A_i<=30 do begin  ^+ T( u1 N. `1 K; m1 K
        travel to pickaisle.con(A_i)5 a) m0 ?) V  y$ D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* i% E# J0 p# ~: \        else wait for 10 sec$ V5 _8 Y6 d9 s0 T' q1 U% V
        if A_i=A_leave then send to die
& s  G4 I, D; q" B* }+ M5 Q4 W! f        else inc A_i by 1) E- Q7 |$ V) `" p  J8 I
    end
$ |3 r% m- V8 j2 pend

最佳答案

查看完整内容

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是个什么东东?9 T  w% I( O. f0 _# _1 P
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?% u: j. ]) J6 }$ f% f; o7 c$ Q
1 r+ q1 Q& ^+ m' O* x2 T
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. V+ o1 }, [- ?4 y5 |
: J7 |2 j( [, @0 \0 ~' x另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ v9 F  m5 B4 e# G' A# Z/ ~; ~6 \1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 W8 v( g+ F6 v  |
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
2 n1 Z# d6 h! k& e  |: @8 ^7 f3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* a& u# Y1 |; @4 ~$ X5 ^+ T9 F  T$ Qbegin P_induction arriving, I1 f+ X/ V5 b3 U3 l. g5 \" h
    clone 1 load to P_pick(A_induct)( p& Q% z) W- W
end最大的系4 k2 a8 L7 ]9 Y# E

5 |5 M% M5 W) m2 q: O& @' t% Hbegin P_pick arriving1 H- N/ U* ?0 S: {. n# n* \/ t
    set A_i to procindex * 10 + 1* B! |- U  o# d  G2 q4 l0 C' W
    move into Q_induct(procindex)* @3 J2 S3 Q% x0 E7 m8 m2 ?& e
    move into pickaisle.induct(procindex)$ t0 F) ]7 G: O2 I4 ~. N# D
    /*check the type of pickaisle.induct(i), for your last problem.*/
5 `! W" Y% v" f" \$ y. X( x( |0 K2 y7 J9 o4 }& v" E7 J3 q7 m
    while A_i<=30 do begin
; I) Q7 D7 N" q' T& y3 @; G        travel to pickaisle.con(A_i)) w. J# `3 A- p: f$ R9 J. }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 {. A( z( F% Z1 l) X
        else wait for 10 sec" u9 ~/ |) v8 b  `. O: ]
        if A_i=A_leave then send to die! s: p( c( Z0 f/ n
        else inc A_i by 1
  R) j: \/ ~+ L" r+ v/ w    end. M  A% L( O! l0 m4 Z+ V4 [- u& J
end+ p- L6 k, |( X- w

% B2 w% @% x) ~) M: d其中的procindex为整形,代表当前process的序号。1 H  t6 u8 p$ w1 Q* M. 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, 2025-12-1 13:33 , Processed in 0.021529 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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