设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14159|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  @( a$ I3 F4 n1 k

' s9 [" ?7 a; O' S: ?我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 R  t. n+ |8 o1 F2 W5 {1 i' M$ \

8 L' Z! t2 v. Abegin P_read arriving
$ Z% j: l4 d( R& |3 _  ]' I' P) B1 l    while 1=1 do begin5 A' P" c) j) r* K9 R5 O
        read A_tote from "data.txt" with delimiter "\n"
5 H( ^: e8 H3 G4 o% J        read A_time from "data.txt" with delimiter "\n"
  S8 X  h" H2 C( P& K. t4 G        read A_leave from "data.txt" with delimiter "\n"+ p% j2 K, ?6 }0 w1 e: \; d
        read A_picks from "data.txt" with delimiter "\n"
1 h( {* ^7 @' H3 a5 A3 }2 t$ s" E        set load type to A_tote1 S& z& ^" U: l6 I* \" _' p
        if A_tote="tote 1" then set A_induct to 19 f2 x  z: S( ]$ e5 Q) c% Y
        else if A_tote="tote 2" then set A_induct to 2
8 _8 o8 _3 v  D9 p, p- b            else set A_induct to 3   
) q. y$ N" t9 W! }7 c/ S        set A_i to 0
( R" t' \; w, @' H, W$ D- y        clone 1 load to P_induction
+ h: g  E# O1 S+ W; x% c        wait for A_time sec
# B9 H7 s" c4 `. h    end, O/ w- Z  i- u
end+ k8 v. _+ b1 |* o$ G2 N" K* {% C2 I

0 {  ]4 Q/ U, ?! ^$ F! t/ Nbegin P_induction arriving
( l, a/ x% B: ^' Y5 y: k    if A_induct=1 then clone 1 load to P_pick1
1 t9 Q  D' {; k* B# q% V& l" [    else if A_induct=2 then clone 1 load to P_pick2
6 x  Y6 ?- i. Y: g' G5 a        else clone 1 load to P_pick3
6 E' A1 x" ?/ h; B0 Zend- {8 ?  i- u) S" q5 ^
( F" {( @' O& o" [7 t6 Y
begin P_pick1 arriving
2 h: R  M1 L8 M) W/ o' s$ X    set A_i to 1
7 J7 ]' R: W# ?+ X: G! m    move into Q_induct1
+ @* f- S8 d6 t) u& j" X    move into pickaisle.induct1; s9 b. f- B' x) e; m; G
    while A_i<=30 do begin
4 A4 Z" A/ h. H+ I        travel to pickaisle.con(A_i)
, o( ?2 K  m, Q, N/ |% j, C, ^+ o: D7 J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( `: X, b  q# u; H        else wait for 10 sec
, k) k0 Q( P, c" ^+ e% ]# i        if A_i=A_leave then send to die
# ~4 ^7 N% G. `, j( Q- |9 e        else inc A_i by 1+ w9 E+ h/ a' K
    end' T( Y9 v5 J8 h+ B2 P2 I) f
end8 d1 I0 ]6 {0 C( O

: {! b' N3 K& Cbegin P_pick2 arriving; z5 `, J$ e0 p- z
    set A_i to 11
8 N9 G% j+ Q  o% p; ^    move into Q_induct2& D/ B6 P6 N# s
    move into pickaisle.induct2& J' N6 V3 P0 o
    while A_i<=30 do begin
% y  h* q0 A6 K  d9 b& B7 C' K        travel to pickaisle.con(A_i)
: q# I% k: q! }( C  ~* C$ X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! G+ R# i+ i; H, V
        else wait for 10 sec
( m8 y, o7 y( d$ I        if A_i=A_leave then send to die: J( ?7 M& y0 f) r" e) L3 F3 _
        else inc A_i by 1
9 N/ f1 w; g7 z4 E' N* d4 _    end9 T: K& o2 m$ I, w/ O1 }4 l7 d5 S
end
9 R% y8 @9 c/ |1 |5 r6 K' W0 u: J% V& J3 c( J' r2 Z
begin P_pick3 arriving2 s4 O5 ^- {5 ^/ A+ a
    set A_i to 21
2 O$ H' ]5 K8 f6 f( C    move into Q_induct3% N+ a4 \" _$ S7 Z# W7 e2 |
    move into pickaisle.induct3- H% J7 S! o0 K% \+ h0 i) N, _% v
    while A_i<=30 do begin
7 Q8 Z- h( j9 t& z' N        travel to pickaisle.con(A_i); p; m) H# i6 O0 _/ B, y: X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) `9 {1 x+ k* w# |3 {8 J
        else wait for 10 sec
) _3 k4 d( l9 |0 F* v& n        if A_i=A_leave then send to die
2 [. S5 f6 `4 x        else inc A_i by 16 b% C7 v) d3 f" i+ ]
    end+ v- o5 [  E: s; B4 u
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是个什么东东?, y) O$ E  Z" m5 u' g; I
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ I; [' Z/ J8 L9 g$ G0 x3 ], [/ u- y, W% r$ ^6 p7 w
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
( z0 r1 h+ l1 Z) v4 j7 r  ^- m- w( z) c
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  V, K4 p: U9 Y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 ]0 U% k+ a; f8 J1 S# z2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) X/ ?  a+ y5 `: N: n( a6 f3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:$ _% ]/ a& i6 [& r: @( }. Y$ g
begin P_induction arriving
$ q. i- p+ v5 ~& b    clone 1 load to P_pick(A_induct)) {; B) c  m) H+ t
end最大的系' X9 T2 J& m/ C- J. F: ?2 p- ~
6 V( U8 I7 V- m4 _' z
begin P_pick arriving
: q6 ~/ R% a& j; f0 e    set A_i to procindex * 10 + 1
$ b" G6 b; R" Z    move into Q_induct(procindex)
8 [5 z# O* V1 ^1 u; C    move into pickaisle.induct(procindex)
+ M2 i6 X# U, ~: d- ^8 E2 T    /*check the type of pickaisle.induct(i), for your last problem.*// C6 f1 z4 N$ Y6 O' Z  {. Y
- y9 V9 t4 T/ I! L
    while A_i<=30 do begin
/ I% Q% z) z2 `3 Z        travel to pickaisle.con(A_i)
: j% G1 t! V8 q1 I8 H9 n- b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; y/ ?+ N1 c6 {  U6 ~        else wait for 10 sec! |3 H( F! z6 j8 A  C
        if A_i=A_leave then send to die7 e7 Q2 z$ i+ ]7 Y9 w. n$ _% [' l
        else inc A_i by 1
4 s7 I* ]3 O, i- M; D* _    end
) c) h! W* k- {- j1 C; B: bend
3 E% s" T$ \! p5 `! ?  V3 M# ~" j" R+ @5 N' w* ?' Q
其中的procindex为整形,代表当前process的序号。$ v, m6 B3 w) a2 a- 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-6-15 18:28 , Processed in 0.013546 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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