设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13811|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: e# y7 N, l+ L" l6 H
1 w1 c8 u& a" ~) B+ |( F% B
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
  e5 k- t! }2 ~& o
7 a0 A3 R/ O: {7 z) xbegin P_read arriving9 r& a6 s3 f) W! {7 @
    while 1=1 do begin' i% h- _% s3 N* K
        read A_tote from "data.txt" with delimiter "\n"! @+ e3 G, x$ U0 S9 b& {4 [
        read A_time from "data.txt" with delimiter "\n"& f5 @3 E$ W! _- u; q9 O5 @2 t- J
        read A_leave from "data.txt" with delimiter "\n"  E! W( k3 P/ c* w" j; R# w
        read A_picks from "data.txt" with delimiter "\n"4 I# {3 x! P$ z2 U9 k/ G2 K8 y* h
        set load type to A_tote
7 ~3 v& m6 c& A: p        if A_tote="tote 1" then set A_induct to 1
9 G5 h) Q$ _2 A8 B8 _' H8 F: I: _        else if A_tote="tote 2" then set A_induct to 2; L9 R: x' S- l% c3 x
            else set A_induct to 3    & s0 i! s& ?& d; {* [' k6 o
        set A_i to 0
2 {% F% i( ]/ @9 k2 J3 F, J, E        clone 1 load to P_induction
; P! x2 g1 c: b. J: ^, A$ a! ?2 i        wait for A_time sec7 z) ^1 ?; _/ ?! S6 F
    end
' Q+ y: x% M0 ?. I/ D2 L7 c1 Vend2 {3 B% E9 Q/ W$ j+ x! b& y5 U

2 ]: g* B& z( b; H1 v# D+ Obegin P_induction arriving6 ?$ U' @7 i$ G% O% g/ \: l
    if A_induct=1 then clone 1 load to P_pick1" A5 O6 y6 }; r- W5 Q$ P
    else if A_induct=2 then clone 1 load to P_pick2
& {9 b9 s" a6 D2 `        else clone 1 load to P_pick3' O5 o5 v% r9 C6 e$ [: m
end
$ C' O/ u, n+ N9 r3 U3 V7 T7 F8 q/ h8 m! l) b
begin P_pick1 arriving
. D( L1 f, R* C7 y" A+ e, [    set A_i to 1
. [/ p1 e9 H" {, _- e/ J7 o    move into Q_induct1, _, V8 K3 f- v
    move into pickaisle.induct1/ u' H0 Y! ~+ I" [; g
    while A_i<=30 do begin
: j+ v, y9 F: A8 V! y9 F2 f        travel to pickaisle.con(A_i)" l9 ^! [) p: _, N4 m) Q4 |  ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# c' x6 D  c8 v& E0 B, j- S! a1 K
        else wait for 10 sec
6 n4 D& V6 o% s, i( H        if A_i=A_leave then send to die9 m3 x  h% C$ C+ Q. r8 c! s
        else inc A_i by 1' i) K0 i9 W- h" e( x
    end! p' F1 m. R' ?  s" J0 x/ s
end
  f  z2 \, v& X  ^* g5 W# w6 o* `6 x% C' N/ E# R- s
begin P_pick2 arriving
5 T% N, k2 q' K    set A_i to 11
9 y+ h3 z0 F# J2 E& @8 Y    move into Q_induct2: v3 |# y+ r, ]- \7 Z% r
    move into pickaisle.induct2
) t/ s1 ~7 C1 D' G2 e/ d    while A_i<=30 do begin- t' k* z3 M0 h1 R  v1 s+ ^
        travel to pickaisle.con(A_i)
# i# t; u, j3 g. C# B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, z+ K2 b% w. v5 W! E7 S        else wait for 10 sec! ?( i5 _& \- B5 \
        if A_i=A_leave then send to die4 v) J+ G+ h& }- b# F7 B
        else inc A_i by 1! E+ w5 u; F, C( P
    end
  s1 L1 o6 G' |& U: f4 Uend
- C' f% i% Q5 }( F$ l0 L
: d6 @4 `/ |' h) O: ibegin P_pick3 arriving
3 r% ~+ d2 P/ d8 r+ T  H, i7 K    set A_i to 21
3 o9 y/ \, I. D# [  t* o    move into Q_induct3. D- @9 s0 v, r" c
    move into pickaisle.induct3/ ?6 U# v* }9 ]2 g2 A3 U  w
    while A_i<=30 do begin" t* ?  m* {, e$ k8 _- f4 U
        travel to pickaisle.con(A_i)0 K8 r" O2 M, \4 @, \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& ~% T( ^$ r9 O$ _        else wait for 10 sec
: m3 E9 r+ r% p! ]6 |$ z        if A_i=A_leave then send to die* m" X3 N0 _9 M. i# L
        else inc A_i by 1
+ a/ S  u8 W' f4 k    end
! x4 |8 ^( \8 S6 |  Qend

最佳答案

查看完整内容

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是个什么东东?% R8 s* B7 v& t5 {  D6 o/ Y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" m) Z7 ?! M. ^; E1 U  N1 A

0 P( s) Y" ?5 b8 l6 I9 r2 MAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# Q2 v) E, F' V0 h+ q7 ]
4 m: O0 @- f" h+ C# H另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ k$ y3 l. f0 K# D" z/ [# A. W3 \1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;6 x+ T" X- k9 [0 E# ~
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 i# q$ a" o, Q
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 z" B8 P$ V: L! T' P3 b, `, [begin P_induction arriving4 n9 [( }* I1 e7 r- E# q
    clone 1 load to P_pick(A_induct)
* n2 M9 R6 \& v& {end最大的系; `* \: R% l8 @& k+ t8 D  b
. q4 [7 S+ I) [% d5 K3 h5 A. x1 z
begin P_pick arriving
1 N- o! o; n% s0 Q/ p/ s    set A_i to procindex * 10 + 1
7 I6 @7 ~6 E, h3 G: s; D    move into Q_induct(procindex)* ]  f- v( S. b* v' \  |7 c' R
    move into pickaisle.induct(procindex)& L7 }( |4 L: u3 r
    /*check the type of pickaisle.induct(i), for your last problem.*/& H( j8 ?: N9 d, S+ b# i7 ]- F& p
; u3 s+ j9 ?/ E% M6 Z1 K
    while A_i<=30 do begin8 U! a  p$ y0 V/ s1 n3 g5 P
        travel to pickaisle.con(A_i)
/ q, [' ]/ ~+ S- [% _9 r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) {* v8 F: w  O8 y        else wait for 10 sec
6 z* ]5 q2 i; ]        if A_i=A_leave then send to die
; f& J& n9 j4 S1 G1 n; U3 p% p        else inc A_i by 1
2 H( W) Q* Y9 ?* ?    end
$ d# e1 q' T* \; |$ aend5 O% p9 _' F9 B2 @4 s
1 @6 Y; y" E; W# o; C
其中的procindex为整形,代表当前process的序号。
. U  O) z" u0 D0 Z2 T3 xstation和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-5-7 08:05 , Processed in 0.019608 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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