设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14276|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 K( S' Z  E  B. ~1 Q
8 d( U6 f5 _8 Y  w5 P/ J
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ ?) K/ ?5 w+ h+ ]+ L7 S" }
9 \" y* ?9 G4 m8 ]& nbegin P_read arriving; I( M5 o1 H# k
    while 1=1 do begin* [* F* Z$ D6 W5 f9 z
        read A_tote from "data.txt" with delimiter "\n"
; ~7 }. z: B3 s& w& H        read A_time from "data.txt" with delimiter "\n"4 D: q4 n3 z" {5 ~1 j7 E
        read A_leave from "data.txt" with delimiter "\n"
$ [; |  R4 S' G8 R        read A_picks from "data.txt" with delimiter "\n"
) M) t" t8 W  H* H/ g8 j        set load type to A_tote# r5 D4 m6 o$ Z6 n- P
        if A_tote="tote 1" then set A_induct to 1: `5 e& @8 _! e6 j; K: x4 C
        else if A_tote="tote 2" then set A_induct to 2
2 N6 B; B1 M" j$ d2 n            else set A_induct to 3    % e8 Q$ a! H7 K, }/ C, a9 Y0 l
        set A_i to 0. I  b) @; N2 |& }
        clone 1 load to P_induction! p) n2 b2 N2 u$ v* H  U
        wait for A_time sec
5 a- f2 |- x  e1 k% G    end2 V: w4 g3 |4 i. W( y
end5 H4 M1 H. F: `) t1 a, k  N# s
0 ?2 E" j1 i* B+ [
begin P_induction arriving+ p  A# L: O, J- I" O# S2 [
    if A_induct=1 then clone 1 load to P_pick16 x  d3 \/ u& f. b" x1 ]: M! Q% h
    else if A_induct=2 then clone 1 load to P_pick2
8 h. Z; a& [- k: U8 m        else clone 1 load to P_pick3# ~( I' K! c+ i& L# l+ z6 [
end. P8 W4 i3 B& Z
. ^% {: Y7 G/ R
begin P_pick1 arriving
0 q+ k" K! Z8 I" o) @" C( v    set A_i to 1- \7 O$ K7 d+ c- C; t8 _
    move into Q_induct1( {0 j, I% [, n/ k8 x( c8 }) G; e6 V
    move into pickaisle.induct1* c3 A3 P3 Y( z6 h  l7 L2 y
    while A_i<=30 do begin
3 M* Z9 t) x  h8 Y$ O        travel to pickaisle.con(A_i)
3 k7 X  w0 N+ v9 h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ G3 [0 ?1 h0 C& g2 d4 V        else wait for 10 sec, O' E; m/ F; y$ E; q2 a
        if A_i=A_leave then send to die
) _2 [1 b% q+ ?) r5 a        else inc A_i by 1
7 \1 O2 ^5 L( @$ j' C    end
2 O2 G- \2 _' l$ s0 send% O# k/ `8 ^2 l

1 C! {) h1 D' mbegin P_pick2 arriving$ o$ K; Y9 E3 _5 ]4 n/ j* e4 F
    set A_i to 11
* j& @+ B- u5 p) v/ a- H$ H% V) ]# ]    move into Q_induct2
. y+ J) Q* t' d( ?+ Q$ E    move into pickaisle.induct2
0 b+ R6 [+ J# d( l3 [/ o: V1 l5 T/ P    while A_i<=30 do begin1 C' F6 T/ ]0 H: z
        travel to pickaisle.con(A_i)) [$ |" B$ H5 r! F- K& g! \0 X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 c( d; F- f+ Z
        else wait for 10 sec
5 H  s$ m/ @7 n  {+ |1 w0 b        if A_i=A_leave then send to die
, M8 Y2 `# C( T  V7 r9 o        else inc A_i by 14 x" ?# _! _9 ~
    end0 Q8 p2 w. U: A* B1 j: o
end& Z8 R1 N- @& F0 s2 y. `' v
% \' S9 S; n+ H! X2 \
begin P_pick3 arriving' _. e$ S. Q0 x- B6 q- L
    set A_i to 21% b! y3 E( i0 Y4 w) M! @! e
    move into Q_induct3
! S1 D, W. S0 U6 m( C    move into pickaisle.induct3
' ^+ l& x0 Q- _2 ^5 d    while A_i<=30 do begin* {% P8 v; F  [3 d
        travel to pickaisle.con(A_i)
; E2 S$ i# T8 \: W( |  U+ ~5 d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) V  ~+ y) d& |7 s' i
        else wait for 10 sec$ F4 V4 L  x. K7 L/ J7 [: \9 s
        if A_i=A_leave then send to die
! W/ }+ p( E8 K# j3 `1 s/ a' h        else inc A_i by 1  \2 u: B# o1 F  i9 ^& V
    end) h+ Y4 g4 _5 k2 V. q& ]; ^
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是个什么东东?2 x, w$ y) r  l
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 X) [; a0 K5 C: ]: O
! K, e, l" W; s1 m8 c; P6 W! j9 F: B
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 Y$ l; s; b1 e5 a
* e4 ~- f# C" \4 H3 k* e4 `另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 s: v7 \0 ]$ E1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
, q2 g3 y; ?, w+ W( M2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 [& q  m- a- X( J
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, c7 n/ R. L, }7 k- I
begin P_induction arriving
; V. M2 c  G) b& H    clone 1 load to P_pick(A_induct)
  e) v, b# `5 B/ M3 y& e% Bend最大的系
% H& @) x' F' K; q8 s0 ~- F
: ~7 b3 @% J- @begin P_pick arriving# O  S" ~0 P9 _- t6 Z
    set A_i to procindex * 10 + 1
" _! j4 i! ]1 K5 b  Q    move into Q_induct(procindex)* V$ V- w, i) B! c4 R# y2 U, X$ u
    move into pickaisle.induct(procindex)
* k( x+ j- E$ k6 x    /*check the type of pickaisle.induct(i), for your last problem.*/
) s4 e4 h/ e( m
" ]6 K$ N; u9 ^    while A_i<=30 do begin
  z9 k5 s8 G8 C- y! M        travel to pickaisle.con(A_i)7 b, ?8 e. k6 K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ {9 ]0 k! w, `" W5 l* \2 U- l3 c( D        else wait for 10 sec7 |! S/ i; J9 ^, S! R
        if A_i=A_leave then send to die" q! Z4 o3 b7 T& \, q( E  {9 L0 \
        else inc A_i by 16 w! G( Q3 n6 Z2 z: ]; E& q
    end
: W  i+ M; U& q: U$ E& dend0 }1 r1 v( B' O/ A! z! r
1 V9 e$ c" W6 U3 J2 Y
其中的procindex为整形,代表当前process的序号。0 d+ q& k; J$ z! E1 U! |, 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-27 02:48 , Processed in 0.013748 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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