设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13432|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 w6 R2 @0 s/ j+ f- U; Y9 A

: z: v0 s1 l$ {6 s' R- p$ u我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# ?/ Q4 J% g% k) P
! ^# |4 r$ ^/ Y  f- wbegin P_read arriving2 b& {" u! T$ Q, ~
    while 1=1 do begin
- i+ `  ~( ^6 K& I4 M) w( E7 [        read A_tote from "data.txt" with delimiter "\n"+ m# z  k/ w: q0 d& T
        read A_time from "data.txt" with delimiter "\n"1 m( c& v) o. N1 n( h
        read A_leave from "data.txt" with delimiter "\n"
# X# y- L/ E0 }( A+ ~( z& |        read A_picks from "data.txt" with delimiter "\n"  a3 Z4 t+ m  g0 k8 [
        set load type to A_tote6 i/ i* _0 n# u1 O
        if A_tote="tote 1" then set A_induct to 1
: [/ Y& |+ _( W! u$ J; }$ c        else if A_tote="tote 2" then set A_induct to 27 F0 q  i0 Q5 s
            else set A_induct to 3    + V0 h9 W. D( m+ g5 a) m
        set A_i to 0
0 c6 c! v0 \& W, @; }        clone 1 load to P_induction
# C% r* u3 F# u) |        wait for A_time sec& o& e8 ]* i# z' y- m! w
    end) L: K& n  p! n; L( S$ m4 g
end' U: G- L3 ]+ }' g

! i0 W& e) z7 |# gbegin P_induction arriving
! O* G4 y5 J* m; s+ l    if A_induct=1 then clone 1 load to P_pick1: i# I  C) {. K
    else if A_induct=2 then clone 1 load to P_pick2' A/ S2 r4 S" B4 t1 U
        else clone 1 load to P_pick3  ]- ~: R" W7 m+ l6 T
end2 ?$ M- s& k  o0 Q- H& }3 ^* w
4 t* O6 ~) ]  y' K
begin P_pick1 arriving
+ L5 T# }8 y! B+ A2 h/ \    set A_i to 17 J! y0 f& {$ z- }# Q8 Q
    move into Q_induct1
. m  z* Z$ q- \    move into pickaisle.induct1
9 {5 I0 a1 z8 ^1 [: ^! p. A. l    while A_i<=30 do begin
' D1 v) |$ F( s% b5 f        travel to pickaisle.con(A_i)
& ?  W% y: g( A0 u. k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* i& l+ m7 w' K' b" m# ~
        else wait for 10 sec0 A& _: u. h1 l; U9 G
        if A_i=A_leave then send to die
1 |3 ]  g. P8 o( F% W! ~/ `1 W8 f        else inc A_i by 11 N' d5 u) s' ?4 k! Z1 H9 m
    end
3 T9 l% F! V/ b$ ]  n% B3 y; Mend/ K. X" v! _" h+ U* G6 t

! D  W4 U. ~) o3 r- g$ V8 g- Tbegin P_pick2 arriving) k1 N: b0 O7 |4 u7 S2 G
    set A_i to 11
' H8 g; c4 }; ?$ I% A    move into Q_induct2
  _* [7 j4 G8 A# n( X    move into pickaisle.induct2
2 m/ X: h8 k% P7 k7 V+ m    while A_i<=30 do begin) }# `0 i/ j7 o" e5 h5 Y1 r
        travel to pickaisle.con(A_i)
& ?' D; W( o6 F6 F1 y' }9 L2 F' g; S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ e3 V) j; U( B7 f( X7 r        else wait for 10 sec
% m2 |7 Y2 F# D+ e, w3 Y, }        if A_i=A_leave then send to die0 o4 w+ \* S9 Q, q
        else inc A_i by 10 d5 V6 _8 b# @& P9 _# @
    end/ [  K' C2 b, t! w2 y9 |, x
end
* R7 ?) W; W* M) U' R) l! T! q: [1 Z3 V" P- h- w
begin P_pick3 arriving4 D5 }/ W2 t$ ]2 o) A) O* U6 }* M
    set A_i to 21
& ?4 E! o8 C# e    move into Q_induct3* ]- h; x8 o" w8 g7 S9 n
    move into pickaisle.induct3
2 A: {2 H. S# Z# \' v1 ?8 P2 {    while A_i<=30 do begin
0 x$ N/ f' C& d1 S9 S' q        travel to pickaisle.con(A_i): }- `6 g5 y$ u& f% |0 ?+ N2 I$ `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ M2 b0 r3 _' T) y1 l
        else wait for 10 sec$ e) s% n+ m5 E9 Y( a6 _
        if A_i=A_leave then send to die
4 i1 d" O. X% ^0 D        else inc A_i by 1
: Y4 H1 N; P/ a# j6 I' p1 s    end( b% p& P0 [7 P0 r' b/ j
end

最佳答案

查看完整内容

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是个什么东东?  P% ?# q& a1 S- h. G3 k
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ o% A9 V2 z, Q% z7 \8 u$ @4 n+ z) @3 d) E7 F* g& a
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ K; O. q: p" Z+ D" v( i* h
9 ^7 f' }/ I$ w
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 m4 I* s% l1 {$ R# n2 N
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# \" T4 Z5 B! ^) Q7 A1 K2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ F% o) W% c3 K4 ~, M1 y. W7 j5 c7 D
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 p5 r2 f  u4 u, [* J  n3 Wbegin P_induction arriving
; W6 O- S4 p( |& @3 |# W    clone 1 load to P_pick(A_induct)
5 m3 n) N, Z5 V$ d! {/ Oend最大的系# `+ U2 _: n2 h8 z& y; ~
1 _5 D  m: v8 a& x1 D
begin P_pick arriving
- J6 ]) j2 @# m! l( @    set A_i to procindex * 10 + 16 b& s9 E& O- y' h
    move into Q_induct(procindex)$ @' k' B+ A/ F% {. J* `2 V7 s% D
    move into pickaisle.induct(procindex)9 ?) ^) }6 e' x" I- l
    /*check the type of pickaisle.induct(i), for your last problem.*/7 `. G" ?3 }- ]

: p. |6 H! }6 g$ R7 g1 }1 g* o+ ^# t    while A_i<=30 do begin
6 d* i, }& C7 C( ?. Y) O- R+ a        travel to pickaisle.con(A_i)
$ n7 q6 U( ^; I( t6 w# v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 d8 `; @# q0 h3 y        else wait for 10 sec& D- x0 [; Y, m9 ?, E3 ~/ G. y
        if A_i=A_leave then send to die9 d8 u$ y/ f* k4 @
        else inc A_i by 1
( D9 v9 W' Z" ]* W  T4 v    end. b7 O: ^) v- _
end
! |! ~0 S7 y6 J5 N( I/ g, m0 z9 ?0 M0 y( k) X. d  R. _6 O
其中的procindex为整形,代表当前process的序号。5 l+ {5 R9 f9 X! ~
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-4-13 23:10 , Processed in 0.023822 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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