设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12995|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, ~9 p% c7 n9 R2 v3 z1 n

8 E. \! M4 P: C5 [% 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中的数值,不知道会不会有什么不妥。  Z: h/ }5 u1 O1 R+ V

! Z' a% W! B6 Q" Pbegin P_read arriving5 V+ L) }3 j6 w2 H6 v9 b: S! q
    while 1=1 do begin
  ]- _, f% q; j        read A_tote from "data.txt" with delimiter "\n"3 k+ W% r  s; D6 w4 g
        read A_time from "data.txt" with delimiter "\n"
3 L2 ~! S" p; w1 [( s2 m9 C" n        read A_leave from "data.txt" with delimiter "\n"
% I8 d6 C% u1 o7 J# o        read A_picks from "data.txt" with delimiter "\n"
. p% A3 s  [) P* P  X9 @        set load type to A_tote
% g, g" |6 d1 p        if A_tote="tote 1" then set A_induct to 1
& _# X5 _( L0 `5 e* @6 L/ O        else if A_tote="tote 2" then set A_induct to 2
1 a8 T- l8 }9 R* M# L$ ^            else set A_induct to 3   
& R, n& E/ I; P$ n$ C        set A_i to 0
$ F1 b+ F1 i- P  \' j# N" Q# v7 z" w        clone 1 load to P_induction: J# X" ^: t/ U2 Z& W" j5 ^
        wait for A_time sec
! b- [# u& w0 P! Z! ?    end
' Z( r. o5 U3 ]1 l' Lend
3 T- J2 a; Y7 b/ t1 T5 l( W% c. }4 o
* U; H4 l  b8 e& L# Dbegin P_induction arriving! [: ^4 G* {- B9 u, G
    if A_induct=1 then clone 1 load to P_pick1& d3 g& v+ G) a
    else if A_induct=2 then clone 1 load to P_pick2; w1 ~& i5 X! w8 w4 P6 m7 }
        else clone 1 load to P_pick3) H" U5 F+ y0 [& J& q
end
2 @1 M: M( i; j) v9 h2 P' N* A+ H5 c3 D1 g: H: F8 X
begin P_pick1 arriving
. J! D. J! G# y' F    set A_i to 19 N: M6 n9 T" R4 E  Q( \  [
    move into Q_induct1: X' N, N: R1 s6 }  I
    move into pickaisle.induct1
+ k( Q! I! ~- T, i2 ?    while A_i<=30 do begin
1 |( _6 o" I( y# [        travel to pickaisle.con(A_i)
/ B- p7 {- T6 ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ Q1 E3 V' M$ D% O" `! E        else wait for 10 sec' @0 u/ O1 U/ }8 u- V1 _2 I
        if A_i=A_leave then send to die
5 c8 g; J( O" [; J/ E: H! g2 P        else inc A_i by 1% o  }, }) j% s7 A/ s1 s
    end; u$ ^9 Z6 w, D+ C$ s, l
end
  O+ a) v+ |( z0 n+ `9 `$ O6 P( `6 w# \/ N- M& _# K& {( i
begin P_pick2 arriving- q/ s, o" H7 N$ t; @
    set A_i to 11
- q- B) P( K- Z    move into Q_induct2
) [% r- l3 k* y+ y7 H5 ]) j    move into pickaisle.induct2
6 K9 Y- R( p1 n    while A_i<=30 do begin
$ L7 |* d" N& d" {# h        travel to pickaisle.con(A_i)6 Y& y2 i0 c6 B! i! p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 J- t) m$ ^- G, e" N        else wait for 10 sec
6 o: v' h+ ~1 g( e5 V        if A_i=A_leave then send to die
0 q. j/ w" X% _) Q3 p/ F# X        else inc A_i by 1. k& E. y( k2 z2 a8 M- ?5 M$ p2 k
    end* A( \5 k6 B4 f" X
end; l+ E% O/ J$ M# |* {
$ ~' b( _( d5 Z& U4 f8 p
begin P_pick3 arriving. ^" n) m( ?3 z5 I6 f8 K
    set A_i to 219 H8 A& i% }4 d# J1 C! M
    move into Q_induct3
" u. I! V" a4 j' Z    move into pickaisle.induct3
* u4 Y2 g: c; A& z0 q& K9 ^% Q    while A_i<=30 do begin) T8 @# @4 ^- M: h) n
        travel to pickaisle.con(A_i)
7 Y* k" b& [0 g* }5 q1 L) d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 \+ K; [* n- \$ F& ]) ~+ H4 o# \' o        else wait for 10 sec
  X8 ~) u7 \( M. z        if A_i=A_leave then send to die
( r# l8 v, r* e8 x* n; a1 ]        else inc A_i by 1
3 t# E1 u+ Y$ {+ r    end" f( O( ?  M) S. V% x5 O
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是个什么东东?
8 t) I- k+ Z/ lmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 d& |8 H* E8 m+ W
0 K1 i- N, @8 r0 _: A$ Y" YAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- Z! k* j4 _: e; V8 U
" G$ l% C: E% R  m1 U3 ^+ h* U
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 Z! Y: H# y& l$ r6 ?2 M
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ ]0 R- S+ ?" M4 S0 G
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
* @+ U9 i7 q- l: X' J1 B3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. F6 X0 ]- [' ]& f% i1 B( b! z& M
begin P_induction arriving! X; ?/ D: G$ d! e# A
    clone 1 load to P_pick(A_induct)
- U, v# O1 `' K9 b: @# B: J/ Fend最大的系6 w! E+ k. b* Q3 f1 f
! H* s9 H) n- r+ i+ F8 ~/ x
begin P_pick arriving1 K% }- v9 C5 X- J( H
    set A_i to procindex * 10 + 1. M" Z& ~* p4 c7 a* c" O" N
    move into Q_induct(procindex)
+ p: G9 N7 H1 ~! i* P    move into pickaisle.induct(procindex)
- N5 A; b  n2 d, W    /*check the type of pickaisle.induct(i), for your last problem.*/
5 F; @. G( ]6 ]8 o  a
6 X% _. d8 s7 h    while A_i<=30 do begin' O' f2 r& j; O2 T; l
        travel to pickaisle.con(A_i)
2 t" J4 x9 r+ r. Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( N, H1 ^/ E" _8 j7 S0 ^
        else wait for 10 sec9 j7 R9 z9 R& v. ]! S
        if A_i=A_leave then send to die
$ `8 R& J# x8 L# w        else inc A_i by 1& g! {* _: }3 W6 V2 d  D
    end7 s3 l5 P4 ]4 a" Q' ~2 E
end
' Q2 L4 s" e1 m# t' w# I" q/ h) U8 U3 n/ q
其中的procindex为整形,代表当前process的序号。
. X* P+ ]: X1 F$ o( m/ ]+ ]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-3-9 12:00 , Processed in 0.015931 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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