设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12969|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# J! x9 b2 `/ i: c' E/ ^) O0 `2 l* L9 n3 C
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. }0 W1 C' x4 R  [7 F  k' j. \, R. U5 i& ?/ ~& U2 A2 {
begin P_read arriving
0 H8 @! o2 G+ G' C" x6 ~    while 1=1 do begin/ x1 l/ I- R3 B/ U) r6 Q
        read A_tote from "data.txt" with delimiter "\n"
' ]5 @/ T6 f) A        read A_time from "data.txt" with delimiter "\n"! B5 ?0 ?9 ?$ m. T
        read A_leave from "data.txt" with delimiter "\n"
  g1 V7 Y7 E" T$ f+ Q' Z. S  e        read A_picks from "data.txt" with delimiter "\n"
8 x( e# G; s5 S8 X        set load type to A_tote. Z9 I  q- g* ?* Z' t' N. o& @7 B. T2 q
        if A_tote="tote 1" then set A_induct to 18 h( Q  U; W' E
        else if A_tote="tote 2" then set A_induct to 2
+ e/ [: ?  a8 a: g! y( }8 q            else set A_induct to 3    2 U- e; P% l3 z8 j. P# |# O
        set A_i to 0
- c% L9 z2 W& f7 T7 a4 W) I+ M        clone 1 load to P_induction9 O! {6 s7 S0 U5 J! w: S' C
        wait for A_time sec: v5 W5 M9 H& |7 o1 T$ Q
    end
/ U: j6 _+ C# _$ a' Q' m+ [end
  P! F; O- ?2 C( t7 |& c" J6 Y5 K7 h4 C8 ^
begin P_induction arriving) T) m& j; Q* P, F8 A
    if A_induct=1 then clone 1 load to P_pick1, o, F4 X6 b) V* K
    else if A_induct=2 then clone 1 load to P_pick22 k$ r( T, ]& D9 g
        else clone 1 load to P_pick3- Y& n+ }" s$ I- E+ g2 B5 T
end
5 `0 g& i) W9 d, @- E, a2 ]: F, }  ]2 j
begin P_pick1 arriving
( z- ~" P& v% T: k3 `2 ~# m/ j& e    set A_i to 1
, P9 _/ U8 A- D) l: P! f6 u    move into Q_induct19 ?. C1 B1 h8 _( L  [: b* p9 c
    move into pickaisle.induct1
) t) X& w0 m8 D/ {+ L    while A_i<=30 do begin2 r. I" F6 Q2 j( ?# X
        travel to pickaisle.con(A_i)
: L& {! ?& T# Z5 J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- M/ z% K/ E& m+ Y! k9 }, Y9 s; J' `        else wait for 10 sec
# }0 X0 Q; x  `5 ^# D        if A_i=A_leave then send to die
5 l" y& k( Z- f        else inc A_i by 1
, v  O9 t) S% F" g5 p    end
1 [. y( x' s/ K; mend. H4 A5 z) Z: Z+ ]6 }! V
9 r4 m3 z* u2 v' m
begin P_pick2 arriving
9 P( x5 L6 a% w, H, R8 ]; m$ w3 P/ u    set A_i to 11
; o3 e5 c/ j6 X+ b: Y    move into Q_induct2% {) C+ k1 I! a. |& X
    move into pickaisle.induct2
5 l- i- n5 f6 E# i/ N# t  v    while A_i<=30 do begin
; K8 I8 a/ \+ O! d! X1 e; Z        travel to pickaisle.con(A_i): e& L$ P3 h, p& X$ V5 K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, Q8 R. y% k" y% W& K0 v        else wait for 10 sec
6 ?( g! E% p2 ~! z: D  f- D+ F3 M1 ]        if A_i=A_leave then send to die% m. c( G. |  R, ~
        else inc A_i by 1
/ @# h! q) ~7 A/ i    end9 b0 {3 B' ]1 Q: K, h  q1 n+ `. r
end; o8 J) z$ `# ~9 E8 F$ \3 `% z. E

) I9 V! I. |5 A, L8 Mbegin P_pick3 arriving- p+ n$ d6 c  ^& x0 B3 C
    set A_i to 21  w) @* }/ b3 I+ L4 T
    move into Q_induct3' S& u# ?: S6 T) a0 z# ~
    move into pickaisle.induct3
* k$ z8 d1 n2 [% \' o: L  n    while A_i<=30 do begin  w0 p9 v, N6 \, [0 J
        travel to pickaisle.con(A_i)
1 ^$ z/ a" F6 p: X$ C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 i- k6 w% c2 \! w& U- Q5 b5 }        else wait for 10 sec- r8 `  ~) i) m; k' {- [
        if A_i=A_leave then send to die4 r" D" O9 d- Z) j
        else inc A_i by 1
4 h/ ~- u1 D1 c! k) M7 b$ w    end
7 a8 Y& t7 w0 o9 m& \1 J* 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是个什么东东?& o4 Q9 h* X9 B+ W
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 t0 G9 c2 J5 s3 _. O- F
- w5 ~7 t% V* v3 {3 zAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 D: e: S# m# I: S# Y7 c/ |3 q& Z% [
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
) G9 B& O) g- T1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 F5 J  R7 a+ s8 L/ p/ }
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! Z3 X0 c8 y; F2 |9 b8 N: {3 ?
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 @( ~, Y: u. b! E6 C- Gbegin P_induction arriving
. ]5 W& N9 C# d( e! y/ L    clone 1 load to P_pick(A_induct)
- Q: g/ `* |* d5 fend最大的系
9 V3 _; Z" b* M& U1 s0 ~6 s0 }$ d% l8 b' H; h
begin P_pick arriving
6 z* z! B: g5 L( P    set A_i to procindex * 10 + 1: ?: A5 e9 W. g1 j
    move into Q_induct(procindex)
' j9 Z# C: {# h& |% I$ B6 |1 M    move into pickaisle.induct(procindex)
1 T% t# M) m& _5 R5 y- @    /*check the type of pickaisle.induct(i), for your last problem.*/& G$ w# d1 v8 D8 f
# t% v  y1 v" u1 Y3 o; a+ O5 D
    while A_i<=30 do begin
' T; s7 q$ B! U  r        travel to pickaisle.con(A_i), ~2 L) ?6 P  j- @) k% J& o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  U0 X# m% n1 f8 V) u+ W9 m, }6 e
        else wait for 10 sec
' J0 M0 ~  N' g) X8 H  |5 g2 P        if A_i=A_leave then send to die, Z+ T7 E0 L* K6 T
        else inc A_i by 16 r4 J( E+ i0 a; n
    end
, s' O8 E6 P8 q1 xend! w4 L& }9 {" h" E; g

' T7 W( L4 V. H8 @' _3 I2 J9 z其中的procindex为整形,代表当前process的序号。
  \* G, e* o2 S% ^( m8 w: P+ P: S1 Wstation和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-6 08:02 , Processed in 0.025440 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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