设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12898|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 E4 M! e" ~( \# u" n: U3 N0 `: ]( z: N% J7 f" a* l* u8 y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( d% x3 c- x& f
+ m4 C* k0 x, g4 K  g
begin P_read arriving/ ]; [% Z* ?8 K
    while 1=1 do begin6 d' B! m% ?( s
        read A_tote from "data.txt" with delimiter "\n"4 `( d* V% y7 `% o4 H6 m
        read A_time from "data.txt" with delimiter "\n"/ S& R1 W: B! s1 C5 [0 H1 U$ ~
        read A_leave from "data.txt" with delimiter "\n"
, p! h1 {( Z  \9 c" s        read A_picks from "data.txt" with delimiter "\n"8 S- d1 `6 z+ h+ n( y1 S
        set load type to A_tote! q: l% W( \/ t8 T
        if A_tote="tote 1" then set A_induct to 1
+ G: p9 @& u# |# |5 t% b  J        else if A_tote="tote 2" then set A_induct to 2
3 H% n0 J& A  l3 g  a- R            else set A_induct to 3    ; U& u! T* ?7 e
        set A_i to 0+ v8 }' h  J1 f- {3 h
        clone 1 load to P_induction" p' ~  P$ O6 Q
        wait for A_time sec# I4 O- x$ p. s% A
    end! F7 D+ S8 Z3 L
end' l! b4 v3 a0 q+ V; I* E- [

% m; H$ a1 L$ Q( ^1 X9 `begin P_induction arriving
+ r8 I" I2 Q( _3 s    if A_induct=1 then clone 1 load to P_pick1+ R5 q+ v8 c0 j# p6 s; x9 V
    else if A_induct=2 then clone 1 load to P_pick2
+ t6 h. s! Q& Q* }8 z4 e) c        else clone 1 load to P_pick3* P5 ?( m) Y* @- M+ T0 `1 f
end
1 o$ S0 k4 x& p' z9 X% p, e. l. T4 t3 a4 {* j6 Y( e4 Q( u
begin P_pick1 arriving
# |5 x3 {. ~# ]0 a/ [    set A_i to 1
$ @) k9 l$ v* }! r+ K    move into Q_induct18 H7 a& u: E0 f5 D
    move into pickaisle.induct1' o1 z9 R* ?1 T3 l' [9 W2 I
    while A_i<=30 do begin
0 r7 _! J- X7 n        travel to pickaisle.con(A_i)
% C% L3 m; _, v( I7 I* \0 q0 T& k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( i- p  ^1 K$ c( {  f! Q, ]        else wait for 10 sec# |9 h& ?* n( ]% U1 _
        if A_i=A_leave then send to die
$ y& \/ ^) D4 |& _. J8 I7 J& T$ f) y        else inc A_i by 1# B7 Y$ K* U6 y; u" O/ L
    end
8 ]8 A; N$ _7 ^  P' A9 {: @end
5 G& @& k2 m, Q
2 X$ `+ l% n( E3 s6 `begin P_pick2 arriving. k! Y/ {6 x( `+ H% l
    set A_i to 11
6 W. Y' i, F# f( w# d  Y! M    move into Q_induct2
2 G9 a6 H$ L  D8 H9 h    move into pickaisle.induct2* h% h5 o* w( ~6 D/ W: s
    while A_i<=30 do begin
$ A0 R  w7 |( _$ r1 T7 r1 @        travel to pickaisle.con(A_i); l+ z4 [2 F8 x) j- f9 |7 a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  N$ Y5 h! M, i! b% g. q
        else wait for 10 sec8 `9 X9 w3 n; ^# x" E
        if A_i=A_leave then send to die! o8 c9 s1 ^+ t
        else inc A_i by 1, v- e( `8 `; a* k
    end
* i( [% Z, l% U0 A9 w; |end. ~, d. R3 c' ^7 H: D' y6 z

6 [: a0 Z! E' y2 T0 o2 Xbegin P_pick3 arriving
2 c7 z2 I& {1 y/ y8 T5 y  i0 |2 `    set A_i to 21! ]4 }4 a/ r8 F; p5 ]* d
    move into Q_induct34 u! z  T- o  q  T2 _1 {& f) J! t
    move into pickaisle.induct39 I- O2 \: t" Q5 |4 o
    while A_i<=30 do begin
: R6 S; V& V( h4 N        travel to pickaisle.con(A_i)- ~" Y8 P2 p2 B( i3 p2 p& y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 m* f( d( }; k9 _$ |        else wait for 10 sec
/ B1 S$ a* ]2 @  T9 Q        if A_i=A_leave then send to die4 ?* p4 H* ]  Q! m/ t" s
        else inc A_i by 1
+ r1 W- n2 ]( a0 a5 @1 u9 X    end; _+ {: s- F) Z4 o$ S: W
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是个什么东东?  a+ O& Z3 P. u; p+ |, U  {' J
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 q; @' H6 }0 @$ R) k

* A- v# H  I5 c2 K" YAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 B; W6 n& ~! G9 J/ Z; e1 i

8 J. L; D  {8 k7 w8 c& W/ c  O9 }: F另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 ~# i' l5 z: \3 J; R3 }& w1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! j8 ]3 r; T3 [7 Z7 H1 M9 e2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  d, ?! c1 _: m! v+ y- t7 R) d
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" ^# U4 p; E' @6 k9 n% o
begin P_induction arriving
- t6 B! E# m' E! I1 u    clone 1 load to P_pick(A_induct)+ I8 L% Q% _0 z+ p! I9 x# T7 m
end最大的系
! U8 g6 ]4 r. T; ?8 V& y. _1 A( \; ^3 j0 E' p
begin P_pick arriving$ ~1 r  L+ q; o
    set A_i to procindex * 10 + 1
+ \1 {; u( Q, A    move into Q_induct(procindex)
. u& j' x+ E0 d/ v    move into pickaisle.induct(procindex)
0 p) O- z2 }+ R    /*check the type of pickaisle.induct(i), for your last problem.*/3 c$ I3 X  }  a7 O

+ W, Q- }$ M% W2 Y    while A_i<=30 do begin
2 [. r: `" x8 J: e2 X( s4 X# g        travel to pickaisle.con(A_i)2 C9 T1 N0 n3 B/ m3 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# J" B9 n) e0 j& n' v& |        else wait for 10 sec/ J% X5 G, Y! j* J
        if A_i=A_leave then send to die* Y7 }3 b& k$ Z2 n
        else inc A_i by 1
0 f+ |6 M3 t+ Z    end
9 [7 @# p2 Y0 Y4 c! Fend- @4 k; x( j! j' D
4 h2 u: J; x5 M+ f& c
其中的procindex为整形,代表当前process的序号。
, X( u  E. H% }/ l% ystation和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-3-1 05:11 , Processed in 0.018676 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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