设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14212|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# ?. `- W& N; u  o4 o

+ h1 w$ D; F! T& t$ y8 R我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 N: S, g5 }8 l% ~9 ^" _$ N5 N. d

/ F. M! B% J/ A0 `1 X, cbegin P_read arriving/ u$ q' B- H4 k6 i: X$ |6 e
    while 1=1 do begin
3 C# `) ~8 n2 t& O        read A_tote from "data.txt" with delimiter "\n"
! k/ \$ ]! x) L& t        read A_time from "data.txt" with delimiter "\n"$ u# w3 E" `; e6 a) O
        read A_leave from "data.txt" with delimiter "\n"
# o! p" q$ F4 Q  N  }, D        read A_picks from "data.txt" with delimiter "\n"
- {0 C% a1 H- I. F4 X/ }        set load type to A_tote1 \2 L/ N8 p7 m9 d2 N1 A2 a
        if A_tote="tote 1" then set A_induct to 1
# X4 h6 y1 i- _+ \" |4 c1 I- v0 O        else if A_tote="tote 2" then set A_induct to 21 x  a+ c' J0 t  F0 z' o& B
            else set A_induct to 3    # [" x  m& d9 Y# d( f
        set A_i to 0/ R( F$ v. j! w* Q# ?) Y
        clone 1 load to P_induction
0 N6 z0 E: F$ L) K, `" S        wait for A_time sec
; A, }& y/ S7 l    end5 y- S, X1 o3 q. P/ Y
end
/ D& ]; ~+ P: H# d( c
8 l- Q+ b* e8 _/ w3 Dbegin P_induction arriving3 E3 ?/ m% G! n$ ^7 u
    if A_induct=1 then clone 1 load to P_pick1
, t- H1 C9 u) |    else if A_induct=2 then clone 1 load to P_pick2
7 a; c- S6 L8 a: n0 }* L        else clone 1 load to P_pick3
- z$ J5 f  W7 S' _; fend( T9 @* a! _. b7 X% H% J& [

, `3 ]) @$ Q- @+ p" t* \begin P_pick1 arriving+ z. b+ R! Z: K5 X$ x' Y6 s$ s) ?3 M
    set A_i to 1
. C- }5 c- D3 K# X( |    move into Q_induct1
7 }1 j% m6 p, |% Y( d* G2 f    move into pickaisle.induct1, T3 P; e9 C! Y4 h
    while A_i<=30 do begin2 W8 Z  b) o# _: T! L2 w& }: q* h$ R1 }
        travel to pickaisle.con(A_i)4 t# F2 ~0 V$ O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! n' K2 A- D7 R. v  m& u
        else wait for 10 sec
7 v% |, o  g; o3 Z        if A_i=A_leave then send to die6 U  h! l3 Q0 W. B
        else inc A_i by 1
9 e1 T5 a/ `) Z" v    end
: Q; p$ K/ d( {+ pend
- I" n, z  t- G1 p" `0 _( u5 S
4 ^- @' t: p- h& \' t" ~, vbegin P_pick2 arriving! `& L& a7 r# |( R( R8 A( K- m
    set A_i to 11+ o) b% U4 W, @: ^& S9 y9 Y" t
    move into Q_induct2
: ^4 m# q/ i# Y2 a    move into pickaisle.induct2
( c; _( e4 g( F    while A_i<=30 do begin" M) O1 }% b! _
        travel to pickaisle.con(A_i)0 X5 e% y3 c7 x  f2 r0 f# `  l1 N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' ^, d1 Y$ j# g' y
        else wait for 10 sec
) t& e* E6 T% j7 A        if A_i=A_leave then send to die9 I" _( G: \0 h* ]- w/ _9 J
        else inc A_i by 1
" ~9 H9 X& U# U" k3 V    end
* p, j& m, Q+ N; e/ \/ l1 cend
2 [3 I! H, K, [- i9 I$ Z1 e( u
1 _& T: \  B. e7 C/ Fbegin P_pick3 arriving
" N6 s: z0 V; K( K    set A_i to 21+ Z4 X% N) K4 l* }/ z  G' B" ~
    move into Q_induct3
) s- \" F3 i; Q; C    move into pickaisle.induct3) S. Z1 W0 z7 @& r
    while A_i<=30 do begin
  w! n3 t% J' T9 b$ M# a. C        travel to pickaisle.con(A_i)
3 R! S3 L: ^7 G& z9 N* K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" G2 _1 Q8 s# y) }  F0 I7 D
        else wait for 10 sec$ R# P8 h3 C& ^+ o" O# {
        if A_i=A_leave then send to die/ F% a8 j. _1 f) a. [6 v$ r8 G1 `
        else inc A_i by 1" `: H1 J& B; W2 a& @/ M
    end
2 R( s$ ^: r, z3 }/ c6 w* q6 l# e* W& Fend

最佳答案

查看完整内容

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是个什么东东?* k+ Z7 ~- l3 }9 F* u. K! v3 a; B
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& Z1 d" f" ?9 N. c0 a, H
* y+ K& [1 b# I# T- c: \$ _4 |
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: b, H' \" Q5 e! h, w2 L8 ]& ~- F0 B8 g. @; A1 e- e
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* m1 W8 |4 R1 s/ a7 F* K: }
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* k9 b: J1 ]6 }9 b- e
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 O- d2 {7 w; X+ |1 `. f3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:# n  t6 y; b6 n/ X/ r$ L: J" C/ Y
begin P_induction arriving
4 u8 u, B4 ?! K" b7 z9 I    clone 1 load to P_pick(A_induct); [7 S# T# ]3 f1 z. Q
end最大的系% W! o4 r- Y3 @5 H( m

# H8 d  o0 O4 V. k, P+ p! a2 E7 wbegin P_pick arriving
- ]2 O2 V+ l5 F, Z! l    set A_i to procindex * 10 + 13 C! Y2 Y# C% j5 B* u% f. |; B
    move into Q_induct(procindex)) Y. d: A6 k1 h3 b( ~) c" W; w
    move into pickaisle.induct(procindex), L" R, G' ?2 M
    /*check the type of pickaisle.induct(i), for your last problem.*/
/ }% {* U& K! v2 r: X8 ]4 J7 k1 B2 ?# S2 O
    while A_i<=30 do begin
/ m2 h0 N: q) @" j        travel to pickaisle.con(A_i)
0 u* W! \9 R% q  q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. j! ]% k2 P$ n7 A" ~        else wait for 10 sec
6 t1 F7 [& d6 L" l6 p* `& ?% F        if A_i=A_leave then send to die4 {6 t: e, U, ~7 B  E' O  z
        else inc A_i by 1& ^# p1 ?, @* W: D2 V2 ]: u
    end
* u( C5 m8 H- w: \- O6 m3 Zend
! \6 h( v3 d2 c2 y, W9 O0 Y! j$ J4 I& g+ i
其中的procindex为整形,代表当前process的序号。
4 C6 v- @# c4 V/ A6 l# \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-21 03:37 , Processed in 0.016458 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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