设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12976|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  a6 u/ j5 F# {8 @" H
8 {1 [) S) j. u  H6 u- {; [" f我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 y9 X$ @' e. {
- H! f$ Y9 m" s1 ^9 [5 |' A
begin P_read arriving
% ^& P2 C  G! P3 n' d  S    while 1=1 do begin& {+ s0 w* v% I! s5 g/ I
        read A_tote from "data.txt" with delimiter "\n"
8 t: w9 f; r& w# b8 D5 H        read A_time from "data.txt" with delimiter "\n"+ r! B# Q0 E% K* r" b
        read A_leave from "data.txt" with delimiter "\n"
6 y9 b, ]. n6 g        read A_picks from "data.txt" with delimiter "\n"
/ _* ^: t4 `& [  P        set load type to A_tote
& p5 \, U2 B* m3 \# ?( S) [& p        if A_tote="tote 1" then set A_induct to 1
, X' b% h0 U) C/ X        else if A_tote="tote 2" then set A_induct to 2
; o. B) r9 w+ M' O5 P$ B9 C            else set A_induct to 3   
0 `! \1 p4 x3 P2 W( }1 }' E. V$ x        set A_i to 0
/ d1 k7 I4 Q. B        clone 1 load to P_induction8 ?& [. X4 X" U* ?8 W0 {6 @
        wait for A_time sec- q: f+ f1 K: _
    end
0 v8 n1 ~; {: z3 i2 fend; x3 o# T7 [9 d/ k( L
0 A* q: ~, Y+ U$ u7 ~1 l
begin P_induction arriving
& V1 p" x$ I6 z. ]# a; y" |    if A_induct=1 then clone 1 load to P_pick1; W9 B! }/ p3 }3 g7 a
    else if A_induct=2 then clone 1 load to P_pick2- a3 ^$ E& l7 e  r
        else clone 1 load to P_pick3
5 ]( u* X0 t/ T' Send
& G: P6 B) }2 P3 p3 F, y1 M$ B
* {$ y+ C+ I+ F4 y0 O% ebegin P_pick1 arriving( `' c; J: R7 J: f0 [! i5 @
    set A_i to 1; ~7 B( F8 t# f% Q3 B$ _
    move into Q_induct1% {7 ?# G3 o0 J/ H! f# I# Z
    move into pickaisle.induct1
9 P2 z1 L( K% `4 E3 K    while A_i<=30 do begin
6 c5 _5 V' Q7 O- N1 v5 @6 i        travel to pickaisle.con(A_i)1 k+ K& r) s& K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 m" i6 j; \0 Z9 f" M        else wait for 10 sec
  _- O5 R# V1 `        if A_i=A_leave then send to die
4 f: ], T' ^7 q        else inc A_i by 1  M. B& i$ |$ |  X* g, I
    end
" G* f7 \8 j% K/ L6 d# G! {end, s9 z3 W' G9 }6 J3 m' V2 r
$ O4 y+ l8 q( s! i# s
begin P_pick2 arriving# u4 n+ U0 T+ C: _- ~
    set A_i to 11
1 V# i& V5 |* E2 `7 O    move into Q_induct2
2 Z3 c2 h6 x! g& r0 \  u" n- Y    move into pickaisle.induct2
6 b" {+ I1 F. B" ]. L* f" g    while A_i<=30 do begin  K! Z3 E- r) q7 x) d1 j+ I
        travel to pickaisle.con(A_i)
: f. q/ T6 k& B1 S* w+ `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 A1 m) c- v  E5 `! ^
        else wait for 10 sec, \" f, m. {+ K; b
        if A_i=A_leave then send to die2 j, b; X# ^3 W
        else inc A_i by 1
  Q7 I$ N+ Z  c# f( }" P" u    end; a; r9 e/ e; o% |
end
: S: d1 I, \+ F4 B5 J/ N" M" \) v
begin P_pick3 arriving3 `' v9 V. |* w' L: m) s- ?! S' I
    set A_i to 21
: T6 t8 K6 b- h0 D  d8 b0 c% @* k7 ^    move into Q_induct3# Y. K% Z" U3 s3 D' w% o, M
    move into pickaisle.induct3- v9 ~: o# R. `/ F
    while A_i<=30 do begin; F; x/ t3 K- ~0 o
        travel to pickaisle.con(A_i)
+ O  p- C1 y" Z! \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ Y' _% q" \3 N) M( w8 |        else wait for 10 sec
" t# L4 t1 T, w        if A_i=A_leave then send to die
/ I( ?, L' m7 h        else inc A_i by 12 H& v# e% F7 Q( e; ~
    end2 Z$ e. T/ k* \  v6 b! e) G- g
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 n" n" N. j. A! z4 ?- w8 J  Y/ jmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: ~& e$ U: _7 D0 G( C+ f/ u

" s" O4 Q- d1 o7 ]2 x/ uAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: h. Q; Y2 z- T

; h0 b$ j3 k# V$ Q! F另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* r/ |$ u! R( S3 b9 O' g/ A
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;6 j6 S% x1 w( K+ v$ @- {
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! R3 G. i$ F9 H8 ?
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ c8 L! ^* G8 D+ L# P3 o
begin P_induction arriving
# {" a' Z" [0 o+ J2 l% q/ N4 u% b    clone 1 load to P_pick(A_induct)8 ]3 @) S# x/ ^$ U" J  ?2 C) G+ f
end最大的系
5 b( U" b" T, ^; `0 V
8 F* Y/ n+ f% X" gbegin P_pick arriving- a! J2 H' i3 D) m
    set A_i to procindex * 10 + 1
1 J3 B% }7 d9 L' |+ l% ?    move into Q_induct(procindex); j* [- i4 I2 {3 p4 _$ M& e
    move into pickaisle.induct(procindex)% T2 Q2 w9 N3 \9 u/ }
    /*check the type of pickaisle.induct(i), for your last problem.*/
" {7 B! f# C( E6 r" v8 t" D, f2 z% V- \& P2 @# `: {# O( b
    while A_i<=30 do begin" H& ^  F7 |, b) H2 g" H: F# C
        travel to pickaisle.con(A_i)
# S$ u. R; Z( _6 x, l) u8 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 s+ j1 G( C# z0 \        else wait for 10 sec
1 l5 B% [" l5 Q, s: D        if A_i=A_leave then send to die
( O  g) ~. L  k- H        else inc A_i by 1& v! Z  x$ f4 ?3 v
    end  K% U' ~4 V" c6 m2 J/ x! m
end1 a. J; V' E* y# }% z" M
5 ~/ u+ ~6 @- s' l2 \' \
其中的procindex为整形,代表当前process的序号。! F+ U( ]# ?3 f. y- a
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-7 04:33 , Processed in 0.016009 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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