设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15227|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 d$ A; m7 i/ z4 T
7 b, F! q+ s9 Q, P% 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中的数值,不知道会不会有什么不妥。
2 ~5 k1 t0 k8 L7 _! w$ k6 I' q6 [2 c1 W0 K3 Q
begin P_read arriving  r& o& @1 O6 N2 _0 `
    while 1=1 do begin: O$ w* }1 z& C! ]+ Z+ F: T
        read A_tote from "data.txt" with delimiter "\n"
4 ]0 z3 L8 r6 p2 {6 s        read A_time from "data.txt" with delimiter "\n"3 z* T% i8 P- r) R
        read A_leave from "data.txt" with delimiter "\n"
( V2 L9 c* J+ O# r; ~        read A_picks from "data.txt" with delimiter "\n"
& V# a; C/ h* Y# s. _% j* N) Q. z        set load type to A_tote7 Z; k9 o& k* J
        if A_tote="tote 1" then set A_induct to 14 H8 u0 F# f& ?
        else if A_tote="tote 2" then set A_induct to 2; @+ [' M- o: R/ d. B
            else set A_induct to 3    # }: s; [( V8 E* k7 N
        set A_i to 0* i9 d5 r5 f% Y( a; s. m
        clone 1 load to P_induction3 p# j5 J2 v6 F6 t
        wait for A_time sec0 @( Z$ v* L4 w! B( W
    end
- y. U& [1 L* F; _6 ?- Rend
2 Y2 ^' X5 m- H! n8 Y, o0 N
, e1 P- W1 E3 |3 \  z( o  y6 mbegin P_induction arriving
" E4 o2 W3 p( ^, E    if A_induct=1 then clone 1 load to P_pick1) b7 Q$ z1 H# {$ e1 r) ^
    else if A_induct=2 then clone 1 load to P_pick21 d, U$ a3 Y$ q+ h, r
        else clone 1 load to P_pick3
3 \& K& F% z9 N$ qend4 V$ R3 v/ [5 m6 z& [/ g) d( H0 ~

) T, o0 \# [4 M. I/ z" Rbegin P_pick1 arriving6 x7 w! i* n) V% r" O; s0 D* p
    set A_i to 1
: H1 @9 I3 c$ f& G) P# R/ i+ t    move into Q_induct1! S  e- U; i. w0 T8 ]
    move into pickaisle.induct1
  D; S8 L& P0 V  \. i1 v+ m3 z    while A_i<=30 do begin
. `2 |* ^4 i, }" x5 c" F1 q, G        travel to pickaisle.con(A_i)! w. u: Y  q+ T. X: R1 }5 o  F$ W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ g1 n8 t6 s' Z3 \9 Z        else wait for 10 sec0 k  h+ M3 D, {! ~- c9 W
        if A_i=A_leave then send to die( `, g0 G  p; U$ p. a
        else inc A_i by 1) c: H' a/ c: A+ O
    end) d+ E0 O! F4 G0 c) Z! @
end
. d7 s, @/ }2 J) H
2 f+ Z* A- I0 a: F1 ybegin P_pick2 arriving5 g" G: F  l9 q  l
    set A_i to 11
' `. S2 N9 M2 j- D: Z) D    move into Q_induct2
- h" z0 V7 r* Y: s8 _# a    move into pickaisle.induct2
4 v' R; z  y( J$ S* Q    while A_i<=30 do begin1 I2 A, I( r) ^
        travel to pickaisle.con(A_i)
6 V/ J, }) J; J& \3 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 N! M- n8 @" c% M+ t        else wait for 10 sec& m5 w( D  F3 a/ \
        if A_i=A_leave then send to die
8 A$ A5 Q9 o: {5 t& x  _  a        else inc A_i by 14 o$ N0 H4 c$ y/ q' {
    end1 _( a/ X' h! L$ K$ L: m0 O
end1 e% t% z; ~7 m, X' {$ J( a
# W; G  \9 z4 s* h3 R3 k+ G' |
begin P_pick3 arriving
6 B3 m; J& P6 s    set A_i to 21
& \% L0 X9 H; a- i6 U) ~    move into Q_induct35 W- T  J! l# p- A0 [
    move into pickaisle.induct3
# o' N) N6 t% O7 y    while A_i<=30 do begin
5 t; A; N: \) x6 ?8 {$ d6 W        travel to pickaisle.con(A_i)2 s: g- ^) i( L- V6 E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 `/ M3 E& w7 A1 e) ^        else wait for 10 sec& K3 N, d% w, o+ c2 ^7 Z( D- W
        if A_i=A_leave then send to die
* G# x$ w" Y5 u  \# H        else inc A_i by 1/ ~8 E! f6 B! `
    end
5 Y$ B/ G2 R+ J5 X$ [5 ]/ Wend

最佳答案

查看完整内容

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是个什么东东?( v# W9 A' z) a1 I2 r' a
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ P: U. \9 H. l6 y3 P* W2 l' x3 B4 z3 W. U! a( \( y7 l2 b; K* [3 n
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。1 `# O" v' E  ~3 v7 r9 ?9 M
' r: r& ?% c/ l; k
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ \* k) f" P0 W! h$ k% u
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 g$ E4 M. X1 K  s" f! u- \# ?8 e2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( R6 q  }* M, a* S7 V2 z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 q4 ?9 Q" W) }5 l* Y) {* Fbegin P_induction arriving3 n, V# t! I, u: ]3 h" k
    clone 1 load to P_pick(A_induct)  |: }* o) P9 x3 V: P
end最大的系# M& e$ g4 y# t* N$ L

* n9 F6 |& M6 m( O0 P/ [: sbegin P_pick arriving* ~6 i" L3 f! M" t8 M$ u2 u
    set A_i to procindex * 10 + 1, A7 E' S- w. B. o+ l' Z- S/ P% P
    move into Q_induct(procindex)9 W; \1 Y8 {& a# [. z+ W
    move into pickaisle.induct(procindex)4 w- O; H2 G5 Z  L% A* h0 R1 A
    /*check the type of pickaisle.induct(i), for your last problem.*/+ s& x2 _+ ~4 i& A# t& [

! m, l& ?. P% U    while A_i<=30 do begin+ {' n# T4 V3 d- x
        travel to pickaisle.con(A_i)
- T* A1 ?3 y: d  Z8 I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* m0 W/ x7 d7 K* @; L
        else wait for 10 sec
: `8 @4 Y& O  \: |6 i        if A_i=A_leave then send to die/ @9 o. z) ]" X
        else inc A_i by 15 K8 u+ \7 H1 Y' M0 h9 U% D
    end
0 s1 f$ G8 z! b& P5 nend
1 I& `7 \+ D/ k: J
. z6 b* R+ N8 @5 Y. V; K7 S其中的procindex为整形,代表当前process的序号。
, H' z) n7 q9 f7 ?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-25 10:08 , Processed in 0.015544 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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