设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14010|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ a0 i4 ~: R( E: Z( i
; O: S3 o. j4 n% _! \/ M8 C
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 t/ {& Y0 P% }' i% A7 h; R/ q$ Q0 \: w/ U
begin P_read arriving
8 J( e* E* R1 W. R% i/ R    while 1=1 do begin
6 e6 f' x/ f/ K8 `$ J" z+ k) h        read A_tote from "data.txt" with delimiter "\n"
+ N& v( |& }2 j        read A_time from "data.txt" with delimiter "\n"2 m  z$ o' M4 E" b& [, ~2 U
        read A_leave from "data.txt" with delimiter "\n"/ x$ Q# h2 f( b3 O" r% s
        read A_picks from "data.txt" with delimiter "\n"
; m( J' G$ j. n; C5 e& v# s- u        set load type to A_tote
  Q' p8 M( S0 q# `! O4 I        if A_tote="tote 1" then set A_induct to 1
( B% k* P1 W1 |# L3 M0 z        else if A_tote="tote 2" then set A_induct to 2
( \3 S: N/ b- p& Q1 p' H$ f            else set A_induct to 3   
2 B  D- i& P( [. S! D' N5 r/ Q        set A_i to 0/ {2 F  \0 f  W" r
        clone 1 load to P_induction, g+ i5 }) V0 i
        wait for A_time sec
7 I7 ~7 z& D& k    end
. P& _+ a8 k. wend7 k- ?1 `, d$ V) j

6 _: b& n' N+ z- l7 Q& Ibegin P_induction arriving8 u- X; j% J  G- r7 [# x0 X; y
    if A_induct=1 then clone 1 load to P_pick1
- \$ ^9 r" K) ?    else if A_induct=2 then clone 1 load to P_pick24 }- v+ }& T: W5 n
        else clone 1 load to P_pick38 W+ w* W2 X% l/ |; w  L
end
  {- @8 b& J' C8 w. s5 ?# H2 j; c
, a7 w( g4 k' k; ]  M5 p) u# i& mbegin P_pick1 arriving& x9 }7 A! V5 k0 {# @$ Q# D$ I
    set A_i to 1. H7 I- g, L$ ~- [
    move into Q_induct1  C7 ~0 H2 y5 W3 Q' n1 ]
    move into pickaisle.induct1& @" ~& H7 h9 f6 a& a8 U: k7 ^
    while A_i<=30 do begin
! E& @2 v3 }. ]8 T        travel to pickaisle.con(A_i)
! Z2 P9 z& `6 H' i/ q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 B2 j  o4 o: f! \        else wait for 10 sec
) X3 O* |8 x: I& [$ F6 _: f        if A_i=A_leave then send to die
; E  \* u( J! t9 j' g8 `        else inc A_i by 1
6 p) i, M* Q2 ~6 }" z+ {    end
& C/ s; J8 t) c& }1 o) wend( y% m- o- A- `. B

  _/ r. g4 b0 h/ J$ e, kbegin P_pick2 arriving
' D$ G9 e7 q+ Z9 y4 F2 K) {    set A_i to 11
7 @3 G* d& X6 B; x- `, D  ?$ ]    move into Q_induct2% Y! m& k0 h0 `" v
    move into pickaisle.induct29 X8 ]! x$ ^: f& o
    while A_i<=30 do begin
7 T8 H7 J* X/ T0 Z, [- Q! P        travel to pickaisle.con(A_i)3 k9 F+ S6 u4 Z/ h: F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% J6 l3 m  i. N* ~        else wait for 10 sec' o) c  @0 X+ g9 _% X1 V& Q
        if A_i=A_leave then send to die. ]/ e! z! ^: m  p7 O
        else inc A_i by 1
3 o( V" u* I" \" P6 [2 H    end0 a, x# L4 Y4 n" `2 g0 ~3 ^
end) h1 v, a5 g; i4 E! d
9 O* b7 {; Z+ s2 m" x; p8 S
begin P_pick3 arriving
$ J& r2 ^. K; x    set A_i to 21
9 y: R  z' @  l5 ^/ X2 ^+ y6 D# S    move into Q_induct3
- l6 L7 j0 ~. ?1 M8 \% ^    move into pickaisle.induct3
$ E9 B5 C8 Z5 k, Q. k    while A_i<=30 do begin9 v5 ]' M7 n. l, F) d* r
        travel to pickaisle.con(A_i)+ @+ j" a! k$ N5 V, f4 L; G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) A% k) w! ~8 e/ w. i# P4 P( v) b        else wait for 10 sec
7 W& B3 j  H" B# ?        if A_i=A_leave then send to die
2 q* x+ D5 J5 I        else inc A_i by 1
% Q9 F9 v8 y. t! t3 l    end6 s) B/ S5 _! j1 [& D9 T
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 D' `! K$ T9 Y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) m5 \5 [+ Q; S' D" ]) G8 `

" P% R  D& g: |AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 U, f# J! m/ U( X4 C/ Q* c, t. R' E1 o& m
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:; f* i1 C: c; G# M
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& |. Y* n. v/ q9 l; b8 h. _9 R2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;# \: h# j; L3 T/ h7 g* ^8 i0 M
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ W$ Z1 a; j7 a% D( U, M+ ?* g$ L& Abegin P_induction arriving' r: t, W2 {+ ], X3 _* p6 [
    clone 1 load to P_pick(A_induct)2 j/ ~+ g3 J) y: e) a+ L( ^* }
end最大的系
7 L! z4 S6 f2 U
# f  h9 s' a3 Y. E! `0 V7 q2 Hbegin P_pick arriving1 O9 v+ m: o4 U0 n
    set A_i to procindex * 10 + 1
0 |* {9 v. |' w5 M    move into Q_induct(procindex)
/ y7 {4 u/ L) E1 H2 B    move into pickaisle.induct(procindex)  A, f; m0 z$ }* J- S
    /*check the type of pickaisle.induct(i), for your last problem.*/8 X2 {+ v2 Y) D% M  o- M( ~* {6 T" b
! G) @/ E+ r, l2 o( R2 [
    while A_i<=30 do begin
4 ~! i& M0 T# R' f; U2 K" U1 C        travel to pickaisle.con(A_i)9 j; Y! @. y5 E7 F- }/ |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# {( s7 p( N) R5 g0 r        else wait for 10 sec$ P: o% F3 z3 h$ }0 G2 Z
        if A_i=A_leave then send to die9 I. Y- N% A8 ]. Y5 @2 h8 F$ s
        else inc A_i by 1  ]7 d2 U5 `, o2 T
    end
& `! ]( X; ]8 q) H0 Gend
, o  }: [9 A, ]  Z; f/ y# G0 s8 y! N- F1 D8 e) k
其中的procindex为整形,代表当前process的序号。
& R3 X2 K0 A# I/ ?6 ^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-5-30 17:32 , Processed in 0.013705 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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