设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14539|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! F+ I  O5 p6 ?+ t/ Q
: ?% `) Y7 @) I% T- k
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ c: X. W( n( y$ d/ W; E
# t1 h8 F+ K  jbegin P_read arriving1 o- n; P7 ]. Q5 L+ {+ M* a2 D
    while 1=1 do begin5 L3 x6 R0 b+ ]' k; B/ [
        read A_tote from "data.txt" with delimiter "\n"
6 c4 S3 t7 j9 G3 \" ]        read A_time from "data.txt" with delimiter "\n"
( i) E+ v) A) u& I' y& O# S- s; X# T        read A_leave from "data.txt" with delimiter "\n"" W3 L% R) ^9 i  g$ G/ d( _
        read A_picks from "data.txt" with delimiter "\n"
9 N6 K4 s+ f& k, g6 P& S: A) W  W% U        set load type to A_tote7 P0 Q. l( j6 K& G
        if A_tote="tote 1" then set A_induct to 1
/ k8 J" y/ {0 `9 |0 t: U3 d' n* Z! J        else if A_tote="tote 2" then set A_induct to 2+ r; D4 Z  N2 t4 C* ^
            else set A_induct to 3   
( u- W  u' g5 J! W        set A_i to 0
( s8 S3 l8 l$ p0 |6 n& U        clone 1 load to P_induction
; U# A6 |0 Y- M( l) u9 [        wait for A_time sec# Z; K. o/ k7 I0 B9 m
    end# Q) w; [! g6 c* T- B. }
end
9 M/ x8 F  Y( U. e" |; p! y
7 I/ \4 \7 i& Obegin P_induction arriving1 ?6 R4 t) x7 l2 |& A
    if A_induct=1 then clone 1 load to P_pick11 j) m$ i7 f5 P3 B6 W* t
    else if A_induct=2 then clone 1 load to P_pick2
  R/ l, B3 I- D- O3 w        else clone 1 load to P_pick3
( d" B  B. s6 f3 O3 lend. y$ w+ O. H2 P. ]3 Z

  Q/ S5 o, `& V, wbegin P_pick1 arriving5 p0 ~: m0 G) R/ _
    set A_i to 1
; ?& Q. e( B, }/ ^% I5 z9 s9 L    move into Q_induct18 H9 P0 \; p/ s9 k2 s
    move into pickaisle.induct1$ B9 M" I1 m  S
    while A_i<=30 do begin
; [' e( ^8 a1 C" Y8 `/ G        travel to pickaisle.con(A_i)# r: b4 |& R8 w( f/ A/ e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- K2 {: ?+ Z. m& G* H        else wait for 10 sec
+ O8 D/ B2 i" t: a( |        if A_i=A_leave then send to die
" `6 t. V/ m, s& y! R5 i        else inc A_i by 1+ k  j: E% @# O! m+ G6 V
    end+ @+ e5 H( ^2 e( K! D8 d& v
end4 ]2 `$ j' l/ c

7 H8 S' W, r. z6 Hbegin P_pick2 arriving8 r# Q8 V, r, ^1 Y
    set A_i to 11/ l0 U5 W# Q' n8 _8 \& e4 h
    move into Q_induct2
- A1 k$ J  [5 t- k) [7 p: }: d5 z    move into pickaisle.induct29 q+ Q7 P* z& A( C
    while A_i<=30 do begin# \1 O7 g8 |- N! w  V
        travel to pickaisle.con(A_i), M2 B- v0 y1 s+ b; R! Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& [* T: v$ o1 f2 d/ l
        else wait for 10 sec
; m! Y9 \7 d  K. \) U        if A_i=A_leave then send to die+ s# |9 a; ?0 Q# U
        else inc A_i by 1
3 r* o; {) W+ O( c/ J+ @. V    end
9 g. b" g) V2 S/ @1 W3 E# L$ J6 |end
3 w/ p* X  I* j  k% y4 w5 z
7 [. z3 O( Z1 N9 fbegin P_pick3 arriving6 u& b( F, }0 f6 Z3 _8 F& y
    set A_i to 21
+ e5 ?9 e! F% P$ }* _    move into Q_induct3; Q& S6 |: T# D- ]$ @# r% ]5 l
    move into pickaisle.induct3& y' \4 O8 q: ^0 Z- R6 F
    while A_i<=30 do begin
$ Z& W* m3 C# P        travel to pickaisle.con(A_i)* x# W: j" [0 n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, a/ J' l+ |; \* ]4 G
        else wait for 10 sec7 y. ?: ?/ a, h, f' S. w2 {
        if A_i=A_leave then send to die
1 U  }3 `* h$ b! f- x, j1 ]        else inc A_i by 1
) s6 v: l+ N; G, V- f    end
! F: H0 {" z9 g6 _2 xend

最佳答案

查看完整内容

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是个什么东东?% ?$ `6 G/ }4 g2 Y; a
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ ]( @- ^& f9 h' }" G

2 d0 b, _# V6 E7 s1 {1 e% HAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. \$ _: V# p+ w6 R& D% G

5 K) b- Y" ~& K" I. Q9 Z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 U  E( T% ~. J1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
7 d) U) o6 T2 n" r2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ |! b+ g+ g$ b1 Q* w! p3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' s8 x; p# A( x) _. `% @# F6 Wbegin P_induction arriving
" ?0 X& [' e0 ^2 `    clone 1 load to P_pick(A_induct)
4 @& w& d; I3 ]$ Y- l, _end最大的系7 P5 a' T& H% d1 ?1 a: L. U, l
+ w" _, _/ G9 j+ t- f6 u- w6 _
begin P_pick arriving; V& ^+ F# S- V" T/ y7 e7 V" u& |" o6 I
    set A_i to procindex * 10 + 1# C; E* T2 H1 }% Z5 b. X
    move into Q_induct(procindex)1 R+ P& |! {: i7 w
    move into pickaisle.induct(procindex)7 ?9 M# x3 G, ^' K2 Y- S! r
    /*check the type of pickaisle.induct(i), for your last problem.*/" E& l, ^/ g* R# y" V+ N
. d; V: V4 h' E; [3 ~+ Z: Y
    while A_i<=30 do begin' A4 U+ ~4 M. k* X; y5 c1 _/ N' W
        travel to pickaisle.con(A_i)! Q* ]: c7 u5 T9 P8 n  v/ ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" t5 U( f' G( |# e* V$ Q        else wait for 10 sec. U/ f4 D+ h% i1 ]) [! a
        if A_i=A_leave then send to die
& B( x$ Z1 g9 w7 e: D        else inc A_i by 1
8 a/ H; B2 H$ q    end
: n7 Y2 l$ ]3 k0 C0 G) x) O+ Lend
# `0 M1 r" `: J4 A& h# {
# ?6 U3 r* X- p其中的procindex为整形,代表当前process的序号。
& H, ]: W2 g. G) R/ \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-7-16 10:01 , Processed in 0.021873 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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