设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14810|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 ]2 ]! O" G1 b* h  t$ ]6 ]. X

. I. l/ J& N- [( T3 J6 \我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% e4 I! t" Z0 j% K0 ]1 I
5 G6 v4 |3 `0 R* S$ k* P: Ybegin P_read arriving. S3 A/ R: K- D' S. i: n
    while 1=1 do begin6 [+ K2 p* v* H- Y/ j. ^( l
        read A_tote from "data.txt" with delimiter "\n"9 ~3 M+ G. L+ }
        read A_time from "data.txt" with delimiter "\n"/ c8 x  _* ~; U! A# o) a
        read A_leave from "data.txt" with delimiter "\n"7 ~( }3 X+ |+ @0 K* [4 P- i" x
        read A_picks from "data.txt" with delimiter "\n"
* R4 n& q6 _! E% A        set load type to A_tote
' s* v. {5 m: Z; d0 z2 D        if A_tote="tote 1" then set A_induct to 1. Q1 o" {9 d0 O* A4 m
        else if A_tote="tote 2" then set A_induct to 29 t2 p  m  I: u5 F2 a, N6 c
            else set A_induct to 3   
) I7 p9 x2 j* c: l2 J0 a8 z. }' k: ]        set A_i to 0
& v+ b4 `; C9 G+ p* d& s: z        clone 1 load to P_induction
2 ^0 e. H' C; o- ?( h$ v7 B        wait for A_time sec  L- V- W1 {1 D. f4 U4 n1 S
    end; h! ?/ e4 i, a" D& ^( k" @' {
end
8 e6 s0 T! ~# |; Y2 `" P+ s  p) {  Z* L' j/ q
begin P_induction arriving
/ E0 y; P# P$ _! Z/ ]0 Y* u    if A_induct=1 then clone 1 load to P_pick1# e) @$ ~8 n. h3 S0 Z
    else if A_induct=2 then clone 1 load to P_pick2- l3 h9 H/ q8 u0 C8 }/ Q/ u9 P
        else clone 1 load to P_pick3
- r& r1 K6 V3 v2 o; h8 ^9 P7 W5 bend
3 N" t# W7 _% c) Q$ F- _# u; _: q8 r1 J4 d: T0 _! p
begin P_pick1 arriving
3 B9 Q6 {5 U$ z% g0 |    set A_i to 1
- F: g+ g1 g1 y    move into Q_induct1- i. r8 z) X4 s2 M
    move into pickaisle.induct1
, u* l% [( `, p! U9 {& m7 M' k    while A_i<=30 do begin# A2 Y. v5 q7 u7 V; A; R
        travel to pickaisle.con(A_i)
0 z. y) q+ y/ x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: H, F* ~4 ^  J; t  f" I" W8 J9 U! v
        else wait for 10 sec
+ [4 k. m( W1 p" C( l        if A_i=A_leave then send to die
; i. e- ?; d+ K4 Z; D6 C        else inc A_i by 1
0 V5 |) d' ^; A) G9 T    end5 v6 Z: r0 \: w% ?1 J! b2 `
end
6 m$ h$ E. v& g9 u5 H; l4 {, z* l) q' z# p
begin P_pick2 arriving
' J! h  @2 a+ o: a9 K6 p8 T    set A_i to 11
+ }: [* B: O7 L( v) }, r    move into Q_induct2
- Y$ m. a: \8 x0 T  o. ~" E    move into pickaisle.induct2
. l2 P' |! I! ^    while A_i<=30 do begin
, \* _: ]4 h0 Q: T3 r        travel to pickaisle.con(A_i)
5 ~# s- E/ Y& u. e; e& [5 {: ^7 {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 Z/ }! z6 _1 E/ B5 g
        else wait for 10 sec
7 t- |8 ^4 ^0 L( s5 H        if A_i=A_leave then send to die
) f9 b; {# U6 s7 ^  W        else inc A_i by 1
4 `7 {& `% i) Y4 k% A    end: S1 ]& P- @0 ]
end, M8 H: R8 l# n. M0 x$ P4 s* Z0 U8 n
3 ~5 F* M' t0 X- Z, E
begin P_pick3 arriving
. _7 Z' h/ V. H. u% A+ b    set A_i to 21$ e2 g5 ]# u; g6 K' [% x" N3 |/ `4 Z
    move into Q_induct3
, K0 O! p5 X4 O* y* U, L    move into pickaisle.induct3
6 l$ T/ i$ c; Z5 e, b! P    while A_i<=30 do begin  t( n# F8 P$ Z5 a
        travel to pickaisle.con(A_i)' W+ j  n% x9 Z1 f6 d6 H, Z. _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 n: ~, _8 Y- _
        else wait for 10 sec2 B6 Y, e) p' w- n7 ^
        if A_i=A_leave then send to die5 S3 }5 F4 l( U* Q4 L
        else inc A_i by 1# H4 j% P; I; }" p- V
    end
+ Z# |4 V& G& b! C/ F5 m6 yend

最佳答案

查看完整内容

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是个什么东东?
' N6 q; }! K' l9 a1 o! C& y, Tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 b) K' e) R% M6 n9 T8 i

% u' i+ A# M% }) x4 `8 k; W1 KAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! j+ s2 `; e" m' v1 J
+ T( ~. Y$ b  U另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! v- X% u% t0 M7 j9 ?' |1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( I  e' F& _% h* N/ {$ [) }& p4 T$ i
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# q+ `2 T0 R$ Q2 z8 u0 V3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 w# W6 E8 d- G* Z& q9 t
begin P_induction arriving
8 S  y- e7 K  a% J- h. l    clone 1 load to P_pick(A_induct), _7 s- W3 x! I' ~/ K3 x
end最大的系
, B; }& ?* Z+ K
6 O. q( q. g* o1 k5 }: Obegin P_pick arriving2 C- L% B3 c) E
    set A_i to procindex * 10 + 1
5 w% Z( e9 F3 t    move into Q_induct(procindex), y; ]! d: r- L; s2 l
    move into pickaisle.induct(procindex)9 q/ p. t$ x4 S& k5 X6 |
    /*check the type of pickaisle.induct(i), for your last problem.*/
3 Y6 J3 E! A( h6 h' D# B. c7 Z# c) |/ I7 p' t6 T
    while A_i<=30 do begin! ?4 v: g& G3 V& V' v. m
        travel to pickaisle.con(A_i)  X: |/ y+ c/ J' R& j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ }! r% D2 E0 l. U& S
        else wait for 10 sec
; g3 p: k3 `* a; W        if A_i=A_leave then send to die2 X/ U# q2 M4 }* X0 A
        else inc A_i by 1
$ p" i0 N! D3 i* H1 f    end
# d5 P$ V8 {# T0 J" m8 G  G( }end! z2 m$ f' h4 s+ K: d% B

: ^! k: t! L. p其中的procindex为整形,代表当前process的序号。
7 q5 u; }% `; J+ [5 f& o1 Tstation和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-7-27 09:44 , Processed in 0.016597 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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