设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15147|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 l3 I! M7 Y% z; X
1 c) ?# c! ^7 E4 }% g. `7 X我的问题是,在每个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* c/ Z4 j7 |% }0 |; D( P6 j- D% m2 W- G8 q, @- G
begin P_read arriving& d5 G7 ]3 D0 ?5 X4 @& d
    while 1=1 do begin; t$ w+ j% z( _* c7 x
        read A_tote from "data.txt" with delimiter "\n"
# V; i8 y9 ?3 O: l        read A_time from "data.txt" with delimiter "\n"
; t% n8 U& o5 z: E1 b# r0 N- b, y        read A_leave from "data.txt" with delimiter "\n"  v# X4 @9 b$ p( f. e$ p2 }$ l
        read A_picks from "data.txt" with delimiter "\n"
+ o" ^& L+ r/ O: n, {$ F9 H  [        set load type to A_tote
. W1 k7 T: D  V4 ]6 b. L( T: z. o        if A_tote="tote 1" then set A_induct to 16 N% {$ |( ]4 R5 _/ D; t2 m- |
        else if A_tote="tote 2" then set A_induct to 2
0 Q6 x7 O  R& K! ]8 M; q            else set A_induct to 3   
, c8 I0 Q% ]) i/ T2 n5 A        set A_i to 0
9 \, X% c, G$ g7 `6 c: U$ y7 c$ |        clone 1 load to P_induction
& A$ U) h) c! L- e        wait for A_time sec- Q" Q' y8 Y% @: L1 J& ?
    end0 A1 }2 S" M8 o' _; {5 V4 f  o; W% |2 G
end
( a  H! g6 O; d" b4 d3 r! X2 b, n( t
begin P_induction arriving+ }2 a. [$ a+ ^9 G
    if A_induct=1 then clone 1 load to P_pick1; ?8 {4 W6 ?0 \# T, p4 ~: Y; z
    else if A_induct=2 then clone 1 load to P_pick26 c8 N4 w' s1 n; M
        else clone 1 load to P_pick3
7 f- t5 w: m1 ?9 ?( {, ?( Uend- i% l8 K% K: `9 ~/ Z' ]
" G* q7 E/ H5 C3 f
begin P_pick1 arriving4 \7 j3 v( y; B$ w$ y
    set A_i to 10 k) a7 u9 y$ N8 E+ {9 i
    move into Q_induct1& d& ~/ F3 P5 H( Y* ?0 P2 }
    move into pickaisle.induct1+ v; y9 L* i' e4 b
    while A_i<=30 do begin
/ S* ~+ Z7 b  b2 v1 b        travel to pickaisle.con(A_i)& ~. V6 I/ E+ s! e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ b* D& B" {/ g. o' O# q4 |9 N  T
        else wait for 10 sec
0 a+ z7 P/ L' @( _: s3 R& T        if A_i=A_leave then send to die
! j% {0 {# g/ T, V        else inc A_i by 1
8 K' y) e6 y+ \* f    end) F: j! j; f0 v( l
end
* v6 p+ c$ I2 Q4 L1 y* l  D( j. b$ H- a$ L( ]+ H
begin P_pick2 arriving
: j# N+ p. q0 v! \( w5 A2 {6 p6 ]    set A_i to 11' e$ p9 \% {& x1 b! r# ^$ c" O
    move into Q_induct2
' x- g- \* H! a- {& S/ H) h    move into pickaisle.induct2- V6 X" G( A+ J9 V6 t
    while A_i<=30 do begin% W* }) H. k5 n' i* A3 P3 |0 G0 z) u
        travel to pickaisle.con(A_i)# C2 Z9 W" Z$ S6 G  |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 B- J9 ?  U* m1 {% {- S* y, h        else wait for 10 sec
8 ^) O( R& B' O: F" L2 S1 ^. Y        if A_i=A_leave then send to die
! d# R) l. i: ^( Q2 Z7 ^        else inc A_i by 1
8 b  M% A5 n$ S! u" [5 Z$ v& `    end% N7 j% G; x" A* W4 C) C9 q
end
6 D- K$ B. F4 a9 ?
1 u/ q, Q- M" |# s: Ubegin P_pick3 arriving
  H5 x7 p8 ?8 i    set A_i to 21
" h0 l/ I3 N% U/ W0 D4 M    move into Q_induct31 U% b% n& R7 M5 L) w5 F
    move into pickaisle.induct3$ o8 u! R" u/ z" e! e
    while A_i<=30 do begin8 s1 p/ O% r  G; T) a+ J0 m7 i. t
        travel to pickaisle.con(A_i)& \- n+ U) V& S* |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, R$ C" N# L# Y' j- l" M2 b        else wait for 10 sec7 B& y& E7 E- W
        if A_i=A_leave then send to die( R/ f5 ~& w" ~
        else inc A_i by 18 b2 h" G7 j  @8 h! Z3 ]  N, A
    end
+ x& f9 @; m  }4 Kend

最佳答案

查看完整内容

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是个什么东东?8 T) `, t1 v0 X3 U1 y5 [
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ q, x2 Q' U/ c

5 n$ Y$ A1 l. g5 Z& xAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' m( `7 Y1 \5 [0 B6 s/ c

7 L4 l/ M1 h) s, j另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. F0 z  f$ _* H; l: j2 |
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 c$ }2 x7 ]# A2 b% f& U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;0 u! F; I3 e' S& Z6 ~( l6 b" V# ?+ ~
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:* |/ R5 l6 ^! Y# S+ ^: ~: B
begin P_induction arriving
+ }7 w3 O3 I' v8 `    clone 1 load to P_pick(A_induct)
' D, P) J* Z, R) cend最大的系8 R( x- ^- ~- [7 Q& J; s# L

( A( G0 N0 Y2 ]: ~  x9 |begin P_pick arriving
9 f& r; b6 z# j9 |3 ~4 L* X1 u    set A_i to procindex * 10 + 1
1 s/ x7 ~8 d4 a) M, {4 Z    move into Q_induct(procindex)3 P2 ?& B4 M& ~, p
    move into pickaisle.induct(procindex)
; }% t4 I, r% y* n% r. n, o" e    /*check the type of pickaisle.induct(i), for your last problem.*/1 l# B/ ?8 m* P: r; _

  h2 S: E( i' m3 B2 c% P/ M" S1 o    while A_i<=30 do begin/ g: M. P$ b6 f( U% e/ B9 A9 V
        travel to pickaisle.con(A_i)
: Q# e! }$ Z- g) o7 k( T( m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! M. c6 d  ~8 ?
        else wait for 10 sec
2 t- H3 L# Z( h8 p+ e6 k& C, g        if A_i=A_leave then send to die
- b  l2 q! z0 }' t( j" i        else inc A_i by 17 g6 o) ~$ H) l1 o8 v! @  J1 D; ^1 ?5 j
    end9 s( b/ ?; o2 f, Q! t: f
end
7 G* {1 m- L3 G
# G1 T8 ^4 I% y8 Z% [其中的procindex为整形,代表当前process的序号。
$ n0 c9 g% K4 D; \8 Y# _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-8-15 09:50 , Processed in 2.834984 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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