设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13322|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ {9 F+ L8 @$ @  ~& q! b
3 ^- n0 y9 i% D: h我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ H, N0 k: E% H4 V
, ]- L/ r! i- e2 Y, B% Zbegin P_read arriving
" K. Z+ H/ R# G  u) R! t    while 1=1 do begin
0 J, t, N3 d' }& a        read A_tote from "data.txt" with delimiter "\n"8 R) @- q& Q! H% T7 ]
        read A_time from "data.txt" with delimiter "\n"' F' E$ F1 f. U6 C" G
        read A_leave from "data.txt" with delimiter "\n"
  k  h) \- F  C        read A_picks from "data.txt" with delimiter "\n"* X8 [5 J. D4 [0 s( u1 T* l
        set load type to A_tote* |- Z4 o/ |: [1 `8 P
        if A_tote="tote 1" then set A_induct to 1
7 i. L4 M; q! g- |; I/ Y        else if A_tote="tote 2" then set A_induct to 2
; `) G* T9 M8 d2 s            else set A_induct to 3    7 Q4 }+ @* a' }/ o7 a, c' s
        set A_i to 0
1 y/ U- T6 x7 L+ m        clone 1 load to P_induction
0 d. T  ?+ A* V( l! E        wait for A_time sec
7 k1 [+ S* G. {" d& V& C. ^; b    end
2 M; L& j1 G- M8 W& `4 _: V  Y  \- xend
, j: n7 T' k, k& P" {
" t9 t9 u7 J  m0 S- cbegin P_induction arriving$ {( U7 P  u" G
    if A_induct=1 then clone 1 load to P_pick14 k2 E( @" O: C* r7 D
    else if A_induct=2 then clone 1 load to P_pick27 ?3 Y" E/ F: i. t
        else clone 1 load to P_pick38 S# H% Q5 O+ b+ G, Q
end
& l  n3 n3 R* v* f; K2 Q0 u) I, B8 F# _
begin P_pick1 arriving$ q, ]9 E, R/ _4 Z  b! F0 Y$ h
    set A_i to 1
3 z( z9 I- G* ~- o    move into Q_induct13 C7 R* w( P" W# o4 H( E
    move into pickaisle.induct15 b' n2 R6 }7 F8 |5 d) r  ~
    while A_i<=30 do begin6 T$ _) @) ]" X. n
        travel to pickaisle.con(A_i)/ v2 x+ J; {9 ~, ^: A. [' _" B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 U& \! l9 j' Y& I/ T5 ?# L+ s        else wait for 10 sec: x/ P& V; u$ c1 w' \
        if A_i=A_leave then send to die; i3 I$ X, h# v
        else inc A_i by 1
- k$ @1 z) `, H  d; J: g8 O" M( _    end
4 w; e0 O7 c% t+ n1 T9 lend
. c5 O  p  ]" z0 T9 }, Q' k& e: @& y0 [/ ^; S- c; h
begin P_pick2 arriving' s; W9 e$ f; J' ?/ j
    set A_i to 11' M# @4 Q; G! M9 l5 m3 Z8 u
    move into Q_induct2
% {  U  w3 l# D( P    move into pickaisle.induct2
* ?# u" O- x2 j* H2 U% j    while A_i<=30 do begin# v. i: Q% ]; n7 s! y
        travel to pickaisle.con(A_i)
. d4 d5 S2 J. R6 |' U' ^+ h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 v& m# m2 n- T
        else wait for 10 sec
. k& k( M+ c6 I! O$ X- R        if A_i=A_leave then send to die
" P) }" G2 ]& ~6 U; m4 B0 j        else inc A_i by 16 Y! C- n' R# h  w0 X* v
    end
+ M% M& o  c( r9 b* l  qend/ x. e7 x0 i$ y( z8 c; c, c
4 ~% N: b3 _/ `; N% }5 j
begin P_pick3 arriving# @1 u5 N7 h  a
    set A_i to 21
4 b' @; a: p2 s0 \0 p4 ?. y* t# _    move into Q_induct3, K% _3 F; R) z! d' Y
    move into pickaisle.induct3
. @1 ?/ e7 p0 ~    while A_i<=30 do begin( i4 u3 r5 \1 u! M( u' R
        travel to pickaisle.con(A_i)
1 @0 P3 P1 a6 h1 I) ~( ?! X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ \. G1 o" z; t, l, V7 a8 C5 I        else wait for 10 sec
8 i; P3 u$ _, f3 F! v' Y$ z        if A_i=A_leave then send to die
# I7 i0 {6 E- C. \# K: H% H        else inc A_i by 1
, G( U! V0 _4 i+ ^) a    end
- l7 H1 e$ q7 Z0 k& d% m9 eend

最佳答案

查看完整内容

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是个什么东东?# d) Q) S4 i9 Q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 ]  p1 G9 ?* _% E4 a& K0 A9 h) {. V
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" `+ g% r& I' n
9 |  C: s- _' o6 u
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! `, q7 L& X" C- v; y$ c. z* @0 r
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( o0 \. |. Q) I% i3 p% o
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" X& i: Q5 f& w  A/ S4 Y3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& Q+ D, A$ G8 g5 ?* t
begin P_induction arriving- I* q$ H( r. N0 V" q% U
    clone 1 load to P_pick(A_induct)) Z; E2 e- @& M4 X
end最大的系
4 C# O/ Z* ?( @& F% H2 u1 a8 c$ P( g
begin P_pick arriving+ v% e. b/ i$ s2 T/ ]: r
    set A_i to procindex * 10 + 1* Z: k; m3 E; _4 i5 e4 ]- z
    move into Q_induct(procindex)7 g6 Y3 g4 @- X! p
    move into pickaisle.induct(procindex)
4 _# B8 f! H- e8 _0 i    /*check the type of pickaisle.induct(i), for your last problem.*/
  M% b( p! y% Z* `5 p% o( q
5 q& }7 O( y2 V. a5 x2 O    while A_i<=30 do begin9 N3 h& P0 Z3 e" A  f- }2 x% }' K
        travel to pickaisle.con(A_i)/ K, d' h! ?9 u( ^% b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* }) ^( W8 {0 e/ r        else wait for 10 sec
! \! s( q8 }  ?' y1 a4 @. D        if A_i=A_leave then send to die
% l+ s! n& R2 R! ^% W! S8 [( w, W        else inc A_i by 1
# D' n0 h8 I% i2 S5 u' m" k- B! m    end
  }/ S( i% H3 p- {end- p* i4 h2 b; }4 J1 \3 Z

6 h, y/ |$ K+ a1 f0 r7 ]其中的procindex为整形,代表当前process的序号。
, f- t6 \$ N3 |6 q' R; |  @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-4-3 23:37 , Processed in 0.018506 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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