设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14125|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' e7 o3 r6 b% E* `: i) v. I4 N7 O" w2 R" k- c+ v# @) _2 {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 b- q. a( R7 N9 H
' ^1 V" p2 G7 [5 ?; G+ D' w4 x
begin P_read arriving
% G" g% L# ?* f+ ]    while 1=1 do begin3 X8 ^$ f1 g% I
        read A_tote from "data.txt" with delimiter "\n": n- K' I* ?- R7 }% r% ?
        read A_time from "data.txt" with delimiter "\n"
6 I# O; n1 L+ b9 y; ]$ I        read A_leave from "data.txt" with delimiter "\n"4 @- l) b0 V  T* t% V; u
        read A_picks from "data.txt" with delimiter "\n"
) o& S6 |1 B2 G( h: s; s! y; H1 N7 Z        set load type to A_tote
! ~8 D+ j8 K' U; C  m        if A_tote="tote 1" then set A_induct to 1
; R7 e; w' I- K# y! V' L1 Q- A        else if A_tote="tote 2" then set A_induct to 2: E: J* O2 @# d0 L, {
            else set A_induct to 3    % o) L, U, G) s0 r9 y6 f# s
        set A_i to 0
6 ]# h8 p0 l6 c& K  l: {        clone 1 load to P_induction
. X1 |/ I' L& F0 i5 ~        wait for A_time sec& m/ g, c" G& b, X( Q9 [
    end
/ \' h: U. k4 |9 k7 y; cend7 F5 Z+ R* @9 z9 ~% m

! q5 b1 C. r: r) ^5 Nbegin P_induction arriving% N" D- c% X: F  A4 `9 n
    if A_induct=1 then clone 1 load to P_pick1
( |% J+ g7 i1 e7 Z    else if A_induct=2 then clone 1 load to P_pick2
' o( |- a7 U5 x0 w# Q        else clone 1 load to P_pick3( T2 j4 I6 o; J0 @/ V5 m
end
( D4 D9 q8 U' |  c, S, M3 H' z1 y: J. ]1 W3 ~
begin P_pick1 arriving
0 F0 u6 q. {% j$ f    set A_i to 1
- W3 V0 K6 ^" W# W# y& M: Z; |    move into Q_induct1
! b4 u5 ^* e6 U6 u* Y3 V    move into pickaisle.induct1
; W) ~7 c; X& z; }; F( i    while A_i<=30 do begin# B6 t7 A! r' B! A3 Q3 l( t
        travel to pickaisle.con(A_i)$ ?* q. _1 E( u0 r" x& }0 V7 b, t3 c/ D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ^$ V# ^. Z  _8 i  T
        else wait for 10 sec1 S  Z9 M- K7 Q& R
        if A_i=A_leave then send to die1 }2 @/ T! A$ |( L$ m# j  W  [% }7 A2 T
        else inc A_i by 1
0 a7 k1 @7 b3 G4 n1 {+ ^& B* v    end
0 b8 k1 o% D; E  m2 v# {end
, g7 d3 a, e4 v# J  e" @
: g% g! u( l5 Y7 J; Q& H( ~begin P_pick2 arriving
; z7 e! E1 W- i% g    set A_i to 11
1 x/ c6 ^5 u. a    move into Q_induct2
+ M8 d) F6 x9 |. u- P    move into pickaisle.induct24 O+ c2 v9 y% {. z
    while A_i<=30 do begin
% a6 K+ ~& }' n  @4 a        travel to pickaisle.con(A_i)
4 W& ~1 ~, J9 J& O% q$ G  A  M# h" [) M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( q* c* G5 x! {7 S. H( W# l        else wait for 10 sec3 @' M. {0 u& k$ k. v
        if A_i=A_leave then send to die
8 P3 z. H2 u) z+ C( @5 l' b        else inc A_i by 1- B! M$ c$ v% X5 x( [
    end  `' P% [: G5 k3 _
end7 f  f2 Y' Z) v4 `4 ~  b9 i
- G' c* U* I( Q; f2 f9 w5 a
begin P_pick3 arriving1 G" H* h/ ]4 h: p" D7 }) h0 N* g0 k
    set A_i to 210 W5 ?  x: M! X/ c- L. e6 g' C
    move into Q_induct38 k; w& R; v6 x/ o9 a# k. I
    move into pickaisle.induct3( `/ A4 r; e- a
    while A_i<=30 do begin: e2 I4 L! t9 P7 b. V
        travel to pickaisle.con(A_i)
9 v# p% E  w4 n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ m- Q7 X" X; m' n& p
        else wait for 10 sec
* q3 Y+ u+ y0 a5 G$ e$ u+ G, R        if A_i=A_leave then send to die2 k5 ]" T3 b$ }7 E" ?0 }
        else inc A_i by 12 w0 b1 P& V1 |4 |1 j/ ?0 |
    end- I# `: V! w: [+ i
end

最佳答案

查看完整内容

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是个什么东东?6 i8 {7 O% l9 i& ?5 B
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  E( \8 |" n* J8 x& }9 \& r, k2 j/ _9 Z* U( X4 e/ d/ v' S
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! N! B2 \/ I$ H9 V* |2 f- f6 O& b/ e& P* B0 V( ~$ o0 z; f# z2 W$ j
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- ~% C# n7 ?; ^) Q, G, s2 @8 q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% P  p7 I6 |' |2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; O& p# N4 x- }! b7 c1 Y7 x! G. A
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 B6 l: O0 U6 Y* Y9 C9 \- Ebegin P_induction arriving6 B. M9 a" b. h
    clone 1 load to P_pick(A_induct)
  S$ t% v: t, j5 ~end最大的系
) a! ~; a: G' x1 a6 n# Y
3 E! Q  j( F- Y  ^' A( f3 Z! {begin P_pick arriving5 y# G- x. l9 k. W1 I6 x* F
    set A_i to procindex * 10 + 1: Z4 k& b. ~+ \5 f
    move into Q_induct(procindex)
" P2 v0 V5 R$ Z$ P' r- c2 x    move into pickaisle.induct(procindex)
+ A  I' o9 b1 x3 w) C    /*check the type of pickaisle.induct(i), for your last problem.*/( s$ P0 f& |4 @. {

9 K, G& s3 G0 O2 c+ Y    while A_i<=30 do begin
3 i. i% e  l" G- H: x, U        travel to pickaisle.con(A_i)
6 A! u$ {2 }/ H/ P% V2 W  T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 y1 \/ p5 Z3 o: a5 X+ L% m" ]* m
        else wait for 10 sec
) n( k* L: o2 G. j5 a( r        if A_i=A_leave then send to die
- `" h6 ?/ j" K# J        else inc A_i by 1
0 p5 b4 {) X' @# ]    end
3 z& t; ^8 e; |1 C: K% @2 mend
) ~- V" w$ i' w3 V0 O+ t3 z' T+ I% }5 e
其中的procindex为整形,代表当前process的序号。% A4 D! G" \) \4 p( {
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-6-11 12:32 , Processed in 0.013198 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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