设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14021|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ e/ F0 t9 V8 H3 ]$ x. r3 X
. S- O# b, A; X. c3 ?. c( H# P我的问题是,在每个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中的数值,不知道会不会有什么不妥。& M  s* @! m: u+ i& M' `

0 k; e2 U3 y( _begin P_read arriving2 {6 ~5 k" _' P0 A
    while 1=1 do begin
+ \* ]% w' c: n9 r        read A_tote from "data.txt" with delimiter "\n"7 z# f1 ~9 {& C8 Z: P" \
        read A_time from "data.txt" with delimiter "\n"
. Y; |% d1 p/ h" C+ U% e2 J        read A_leave from "data.txt" with delimiter "\n"/ u: |* P7 p+ h. a2 {
        read A_picks from "data.txt" with delimiter "\n"3 D  S, f7 U1 P! r- U3 t
        set load type to A_tote
# M2 X5 m4 ~: x* o        if A_tote="tote 1" then set A_induct to 14 [* [4 g% j7 q
        else if A_tote="tote 2" then set A_induct to 2
/ U3 `* E) Z: O1 I" `            else set A_induct to 3   
3 G3 l' |) Z8 S" b0 |8 `        set A_i to 00 q! v5 B7 Z; j( @8 z, M. z
        clone 1 load to P_induction
& _; a- [; @# ]  ~- ^, d        wait for A_time sec
8 T- j) [# s. B8 s: A+ _! t+ L    end
. J. o7 \% r* ^$ R$ r2 ?  Lend/ r8 Z5 B8 U' i. i3 m( w" W; h

1 L' W. D0 h1 V! k& \# I+ Lbegin P_induction arriving
4 o. G( [6 x0 c+ \, m, k    if A_induct=1 then clone 1 load to P_pick1
2 S( ?: ?$ P6 q: r+ O    else if A_induct=2 then clone 1 load to P_pick2/ m3 m# q1 k0 d" ^* u/ |( ~
        else clone 1 load to P_pick3
  ?6 Y/ b, I; ^; w# G) z- O. Wend
) G. x& ~6 G4 G2 i1 A$ l# k! ^; V; a, y( r
begin P_pick1 arriving: \/ ]3 P, M6 C9 O* ]# o
    set A_i to 1& K- \; j" d& D" j& P' v; y
    move into Q_induct1
% t( @5 h6 n/ v    move into pickaisle.induct10 r6 \  T: a9 @7 l
    while A_i<=30 do begin! v; r# k/ D+ P. T7 p7 j+ b0 ?
        travel to pickaisle.con(A_i)/ V; ^- v% M  s  J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: z2 E8 J" S. j4 o
        else wait for 10 sec* Q: A. d: r; ~; `0 w
        if A_i=A_leave then send to die
, n( z7 P  J1 |        else inc A_i by 1+ V- M; D2 ?: O" s+ f3 S! ?
    end
0 ]. S8 ^7 C, V0 g9 Jend1 S% @! J6 A1 E3 r) N) K7 _
' G$ Q! h/ h' g  U  E
begin P_pick2 arriving6 I5 @/ l% a- C
    set A_i to 11
2 E! i  `' p, O7 c! v+ f* l    move into Q_induct2, N2 |! \! n, H4 {2 i
    move into pickaisle.induct2
1 d& G7 J& e6 B6 }( _  K; O5 T& J    while A_i<=30 do begin$ @, m1 R! K5 q" g' [
        travel to pickaisle.con(A_i)
% Q; `; {' @$ \# a2 p% G( X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: Q- S3 ]" R0 y( A2 @* e1 [
        else wait for 10 sec
. P: y$ p8 g9 u( A1 p        if A_i=A_leave then send to die+ Z4 M/ c2 `& o: {8 V" I
        else inc A_i by 10 i" _9 r/ f& B2 H
    end
- e: O, P' {. O& r! W- Uend
- H8 p& j- l$ A! ~( [0 w! ~' d
5 ?, Q' ?. G4 Obegin P_pick3 arriving* p4 t" x# N* K, r# I( Z, x
    set A_i to 21& F- w% H3 s% \* @; ~/ e7 J
    move into Q_induct3* D- J4 w5 j7 E& c1 R! P$ A
    move into pickaisle.induct3
+ i% E! b) Z" E    while A_i<=30 do begin3 f- {. e; R9 E, B: o2 c7 H" I
        travel to pickaisle.con(A_i): E3 H0 l- a+ p% v3 d( w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* k) ]+ Q( U9 a# O, ^7 C        else wait for 10 sec) k/ j3 L. q! {) F9 L( g, v5 ]
        if A_i=A_leave then send to die# u% \6 G% U- `$ S4 {1 [( |8 g
        else inc A_i by 1
, b! t- @8 z5 O& {2 ^# N' f# a    end, G3 y) S$ |. F, @) f
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 K, k  h6 Z0 k, \$ ?, Z; lmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 }: {4 U6 v6 n, w" s( j! b: P# t: r
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# o- D6 y9 I; x. k# ^/ D
! v/ i# U% {8 u( I6 d7 D另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 S# ?3 }. Z# Y. j
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- W/ W+ `: i) c2 W7 G2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. O9 H4 I: a# y+ y' a
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 M7 b2 ?% h- n8 H& `begin P_induction arriving2 a  U, X% a) Q& R9 C0 z2 N
    clone 1 load to P_pick(A_induct)! `/ z/ F$ e$ }4 \0 r9 v# o
end最大的系
/ ]- \  s/ P* r; Y; M& A3 Q1 S9 J4 T4 [; ~. e. [1 v
begin P_pick arriving! {+ A4 ~- N. e+ {
    set A_i to procindex * 10 + 1
+ B! _$ r. K# O+ [" \    move into Q_induct(procindex)+ n6 B& U  y2 O" o# S
    move into pickaisle.induct(procindex)
# o# T, |3 B0 v. I9 v  _% e    /*check the type of pickaisle.induct(i), for your last problem.*/2 q5 w  J4 {/ Y8 Z5 o

' w# c  m7 L( G  g9 G: i    while A_i<=30 do begin
, U! Y  H/ A6 j! ]        travel to pickaisle.con(A_i)
) O# Y7 X4 o7 G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ~7 g9 T9 q7 u: d# v7 J  h/ O
        else wait for 10 sec
3 J, ]' T1 N. X) p+ \, _2 D4 O        if A_i=A_leave then send to die
! B& E- D, J6 h8 v; Y  g( `" V( _! t! B- n        else inc A_i by 1! H" s+ o5 S0 r! B
    end: s: Q  a2 a. m6 k- ~
end
) H5 e% w. s5 B& C
# Q- _8 m0 g9 ~( V' Y3 c. ~( e其中的procindex为整形,代表当前process的序号。
. y' h' f( h  {, |6 ostation和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-5-31 20:07 , Processed in 0.013629 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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