设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12153|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) P1 H# k0 w: N# f4 }) d1 p) B  l4 L9 A4 [) @) S
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ v( N! S$ S' F
' t# D0 H8 x6 {/ d3 `$ z+ _! p
begin P_read arriving8 E$ ?% X: o, V  Y! s! X  I
    while 1=1 do begin
; n! g) x4 D$ i+ C. r        read A_tote from "data.txt" with delimiter "\n": w, {) t, h' \& s4 g5 l5 c0 M
        read A_time from "data.txt" with delimiter "\n"
# g8 g4 |! n! _1 `# V: y% J        read A_leave from "data.txt" with delimiter "\n"
; y5 P# l# B+ ]$ h        read A_picks from "data.txt" with delimiter "\n"
- Q; N9 E. p7 W0 Q- `) {        set load type to A_tote
# G7 Q2 H2 j, m/ K9 z        if A_tote="tote 1" then set A_induct to 1
; I, V" A5 E" Y6 t+ `2 C; J  h        else if A_tote="tote 2" then set A_induct to 2$ a: a( `1 H! O$ ]% E' d$ C. _! b" k
            else set A_induct to 3   
1 p+ N0 S4 z) F, v8 v$ o# C$ ~        set A_i to 0) B0 F# z0 R5 e; X
        clone 1 load to P_induction7 t7 b# r+ ^/ |1 E
        wait for A_time sec
( @: N- C: P) s! ^8 P  K( m    end
. [5 K! M5 K, C1 @+ d! lend
+ S" t" J0 O( ~/ k# h6 P( {
: V! {) `+ V# v  cbegin P_induction arriving
6 l6 B& s' f. ~2 @$ Q    if A_induct=1 then clone 1 load to P_pick1
: S& M; Q7 ^) G/ }% L( _    else if A_induct=2 then clone 1 load to P_pick2
" \- H" Z) n9 k# O! r3 `7 N2 Z        else clone 1 load to P_pick3
) t3 F) g' X  @6 O" lend# _4 c' |; c& L3 J5 T: |
* s% L$ Q/ M( F  a# h
begin P_pick1 arriving$ K' `9 i% W! d. J( q
    set A_i to 1$ X2 v" }7 m5 r, b) \- `* S. O
    move into Q_induct1
9 t$ t( f( `8 \- H$ y( W    move into pickaisle.induct1# F. D4 e+ N; I5 P' u( j# U
    while A_i<=30 do begin
9 F7 e- j7 V3 p% X        travel to pickaisle.con(A_i)
3 T3 z3 h% X  ?; ~5 o( Z  o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 V2 G7 {4 d5 F$ F& g, Q( |) Z        else wait for 10 sec+ P  ^" ^; F' G; t3 T
        if A_i=A_leave then send to die# i- z$ _2 I' Y7 Y/ g
        else inc A_i by 1
- n1 A2 y) K5 r    end% h# E$ ~! y0 i0 o
end
% Q3 S* a5 D. e$ G' ?) {6 ~& p
: i# N% V( W& {: lbegin P_pick2 arriving% I3 Q( [* j( C* j/ N" e" F
    set A_i to 113 Y" W7 q  I2 _) c4 r. o; \9 k
    move into Q_induct2# T5 E$ e. C0 A
    move into pickaisle.induct2* A! g3 M  {; i: D4 n& z
    while A_i<=30 do begin  |( [# m' G8 E2 i8 {; Q
        travel to pickaisle.con(A_i)
* `$ U$ Q0 w! c0 M* I$ d! y5 H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 N+ D# P- k/ G: t( {$ f        else wait for 10 sec0 w  G0 O: ]1 V
        if A_i=A_leave then send to die) j) m: E3 h3 h' ?! n  R/ ~
        else inc A_i by 1
1 K+ g1 F+ @* H( n" h9 k    end
) S/ @. V+ z0 I0 k6 v; {end
8 m, C! U4 R" c. n% P2 j: ?+ |' N$ U" j( W
  E3 i* S) f8 V& F9 i& p3 V* Xbegin P_pick3 arriving/ L1 N$ u8 `. X' s
    set A_i to 21
3 t) ?" X7 t' `9 m    move into Q_induct30 P8 F0 k5 N& i( ~
    move into pickaisle.induct3
9 S1 [& I. r: d/ g' e9 F8 h' R    while A_i<=30 do begin
( G  v* t5 ?( T9 {        travel to pickaisle.con(A_i). A! h1 b$ h  f/ G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- A6 u; G) T8 u) t' r5 R5 \
        else wait for 10 sec
* q9 M0 S, m; i2 c; M5 Q1 `' Q        if A_i=A_leave then send to die
% L6 G! ]+ [' g& q* l1 [. [        else inc A_i by 1/ Y- |* w; C/ e9 e' Q( U6 h% j
    end
! u3 Q- G( _2 @0 Vend

最佳答案

查看完整内容

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是个什么东东?
+ p/ _7 O+ R) ^6 Kmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 a/ }- ?+ U. H1 f: z0 e/ o
3 z4 t; ?+ z' v( B
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' D+ ~$ r9 X$ }" Y1 @
' |0 w2 N  ]- d' t2 _
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
# M4 h9 X4 {, Z6 D1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 R" o5 k  c5 Z( I
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& M" U5 D$ r2 {3 n% ~$ O
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  d: f: k, C" j; w
begin P_induction arriving4 R+ t' w+ B- {
    clone 1 load to P_pick(A_induct)
! R/ I$ C+ T8 ]% o/ k6 i: g! g8 L2 nend最大的系# C0 A1 R8 Z3 D

5 C$ k# [- d- p9 k; K- {begin P_pick arriving3 B- S0 c2 m9 S: K5 j5 T: B$ g
    set A_i to procindex * 10 + 1
. A, K* b0 U) _  b    move into Q_induct(procindex)
/ Z3 E" N; V+ o8 h) P    move into pickaisle.induct(procindex), X( e9 P; R+ V1 p
    /*check the type of pickaisle.induct(i), for your last problem.*/4 Q& U2 J# z- x" `; S+ O

% R7 u( P5 d- a6 i4 Q    while A_i<=30 do begin
# i' ^/ I1 O, F        travel to pickaisle.con(A_i)
9 f" w9 j! h  m3 a( b+ X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ }2 a/ }4 O  d/ M9 @& e        else wait for 10 sec* o4 ~- ^: w- {& h3 t
        if A_i=A_leave then send to die  G6 J) z- B, }% R
        else inc A_i by 1
" |1 p# N1 v! E& c6 P7 }% T    end; A4 C( o% [/ {% d/ X* H
end; m. j3 t2 Z' o7 }9 C
* x5 b3 t9 i. W  ?/ Z* O! K) X
其中的procindex为整形,代表当前process的序号。
  L% m2 o* n' z1 Qstation和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, 2025-12-31 22:34 , Processed in 0.019381 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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