设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13453|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* _' R% z2 U# e) s1 j
7 x! @' V( j. @2 m; G我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% e& q  V, m( i" i1 ?7 U" b1 s/ ]( T
5 Q( [2 y3 d5 S' dbegin P_read arriving: Z5 ~2 A8 G- F/ g+ e0 k
    while 1=1 do begin6 W5 {, A' e( d9 r$ ^0 W7 J( R/ w
        read A_tote from "data.txt" with delimiter "\n"5 Z. d+ j# O" c# y# s
        read A_time from "data.txt" with delimiter "\n"
; t3 d1 w' I/ Z6 P        read A_leave from "data.txt" with delimiter "\n"
$ I6 o# ~. c" L5 N) T+ A        read A_picks from "data.txt" with delimiter "\n"
; ~- t: @. a; p% e9 K: ?7 ~" r        set load type to A_tote
+ A' U( |9 U; B" g: Y. A* z+ o5 {        if A_tote="tote 1" then set A_induct to 1/ q8 c6 l5 k( s& J) A2 |, ~
        else if A_tote="tote 2" then set A_induct to 2
2 C7 d$ @/ D; y! J0 H            else set A_induct to 3   
; l, y0 \; o3 Q. c+ w. V3 n        set A_i to 0
+ W) B7 {$ J# f        clone 1 load to P_induction
: a. C8 O; U. C! A        wait for A_time sec  q1 `) |! p7 ~! ~8 `/ o. t  Y
    end! e: G, R3 y8 Q; V
end1 A2 |& d0 ?% v* J7 R& ]! g

- o! a" H, t4 ?3 E. ^begin P_induction arriving
: B9 [7 T' u* b' t. `# H7 ?. i    if A_induct=1 then clone 1 load to P_pick1
! X& f) I" f9 t# f6 L    else if A_induct=2 then clone 1 load to P_pick2
# {% B6 k6 j2 ~# z+ J        else clone 1 load to P_pick3
; U) j) i. w$ ?; @) V4 G* l: hend! ]% {8 Z9 C6 l; b- Y: u2 @

; {% R( R- Z' s8 [, z; Y# Gbegin P_pick1 arriving
& v3 L" U2 a! v0 u- u) `+ Q& ~    set A_i to 1+ W' d2 g: ]. R  I6 n4 s  y0 I
    move into Q_induct1
9 ~# A4 i! S0 }( E: @4 \3 ^    move into pickaisle.induct1
% E5 O9 K( y% Z1 O    while A_i<=30 do begin+ ]4 C0 m  W) k+ `* l! o' _! F; \7 a
        travel to pickaisle.con(A_i)
3 n& J9 B; S8 Z( P9 ~% T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 j6 u4 A5 m! e! X( t( o. ~: s' s        else wait for 10 sec
) P2 |' H/ M+ K3 w        if A_i=A_leave then send to die+ g' n$ B# n! D8 j
        else inc A_i by 1* x& Y+ B. B: e0 ^) f4 D3 N7 }
    end
! `2 Y1 ]. ^3 N1 `end4 v% I# \6 R( k$ P) g1 z
# p2 u( |4 O5 b" b7 A6 B. a& d
begin P_pick2 arriving6 l4 Z" O$ r: r- L: ^
    set A_i to 11  P: i2 i' R  W# o
    move into Q_induct2
3 F6 d& R7 g  F% r    move into pickaisle.induct2
  V% _. T: @# c+ W    while A_i<=30 do begin9 P% @3 h" |: x) U7 O
        travel to pickaisle.con(A_i); Z  V8 [2 ]; z* ^$ y7 R1 {4 o" |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 T+ h0 E' d0 b+ Z. E        else wait for 10 sec  a7 X1 F, P! ?: l
        if A_i=A_leave then send to die6 C2 v  A# B+ ^7 d& {' W; s. Q
        else inc A_i by 1
3 o$ Y6 |# \! ]    end: h9 I$ ~, Y9 L' j& a( w8 E
end/ h* }) g/ P" X5 n7 r( {) U; |

- i' h3 ~- n4 bbegin P_pick3 arriving
9 S3 c& ~) E+ \    set A_i to 21! B4 ]5 j' i& w8 t; [
    move into Q_induct3! [+ w( T6 y, v5 \- o+ Z+ [
    move into pickaisle.induct3. H& B* M. p! l5 G* K0 f
    while A_i<=30 do begin
% B% {2 \  x2 P6 `8 T' H        travel to pickaisle.con(A_i)
3 L; k! B7 {- U7 m! L$ s0 h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 V. A2 n9 Q3 ]/ s1 a9 Z        else wait for 10 sec5 L  z+ ]6 m; [. ?& H8 _- y
        if A_i=A_leave then send to die
- ^* ]# C+ U& v        else inc A_i by 1
/ z! D8 `- ]# |, `: I. m0 G9 k: a    end5 K) o0 Y* }9 H& 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是个什么东东?
) w- A" E  R' Z+ }move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. c: p7 S6 ~* G, y+ ^- z
' e* U( v  n, n" b# h
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& q: N. M( [8 h. J5 d8 {: i3 d8 f/ [" n  \1 {+ \% ~& F* W! }  \
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% ~6 |% s% k8 R, x1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
7 M5 ^) B+ H0 E" y' L& E# k2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 s0 N' d& r3 D7 }3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! }6 j; g! U* w9 y. |, Y
begin P_induction arriving
. r. X. t: m9 q5 g: b    clone 1 load to P_pick(A_induct)
3 ~5 c4 o7 ]4 `% {end最大的系6 ?5 A5 _4 T- K7 O% g8 q/ T

  r3 L2 Q2 `- Y- \2 a, O( V* a- Kbegin P_pick arriving
3 e' ?7 L- c7 k, Q    set A_i to procindex * 10 + 1
) @8 k2 Q, P9 F2 s    move into Q_induct(procindex)
! H5 H: M% H, B: |) L5 F8 ?    move into pickaisle.induct(procindex)
. \" I/ Z8 e% }% U1 v" z6 L    /*check the type of pickaisle.induct(i), for your last problem.*/$ b" r' G! \% h& Y

( @# g- v5 }6 L9 {1 P5 z3 V! B- W+ N    while A_i<=30 do begin$ ?) H3 R2 c1 {: T
        travel to pickaisle.con(A_i). H+ ^3 d3 X1 j) C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% g$ ?' M! w% n7 x/ L; `4 x( C        else wait for 10 sec. w4 O0 g; G! e7 i- I1 o
        if A_i=A_leave then send to die
1 r( c3 Q4 o' h, x" I  P& E        else inc A_i by 1' B5 z; ]: R" ^+ j4 e8 R. Z
    end
  V: Z3 k/ H/ o6 _" V/ f( e- Xend
; }0 z+ d& l$ {" G' c; i5 h5 \' Y( g+ n$ b: B
其中的procindex为整形,代表当前process的序号。
/ O  L2 }# \' N- Q) _2 Q9 Mstation和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-15 11:43 , Processed in 0.015364 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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