设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13103|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 A$ h1 q, }% U. ]6 h  @9 }  u( l$ C' U9 p$ d; p1 e+ P8 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中的数值,不知道会不会有什么不妥。
2 A1 a! S; t$ h4 r2 _
  ]$ j# @' B' p. Ubegin P_read arriving
2 [* o3 s# E; V    while 1=1 do begin7 {5 X. o+ U1 M" w0 \
        read A_tote from "data.txt" with delimiter "\n"
( V5 R% p9 l+ H5 b1 [7 R        read A_time from "data.txt" with delimiter "\n"
1 X3 l" @" H  e0 A, B        read A_leave from "data.txt" with delimiter "\n"
8 M# p+ k8 R: c( N. @1 w8 M# L+ [        read A_picks from "data.txt" with delimiter "\n"
8 @, ~5 M9 g+ H% u" M        set load type to A_tote5 o* E- V( A! ]5 e
        if A_tote="tote 1" then set A_induct to 1/ f# V% d7 q5 J
        else if A_tote="tote 2" then set A_induct to 21 V9 F% ^7 c4 p/ P( |
            else set A_induct to 3    1 g) ?& u3 ^9 }2 B' @6 o9 I  S) g, _
        set A_i to 0, U# A1 v8 o# y7 R! n3 ]
        clone 1 load to P_induction% d, o* h6 c$ _7 k* B0 e
        wait for A_time sec1 t$ e1 c  E) h! Y- F
    end# q- G& c+ ]4 L: y  p) @3 o' m$ g
end
: p# C2 R& w1 a( W, G/ ^% V0 l
5 D- a4 K+ T; q0 @; [begin P_induction arriving
7 M) f* X3 W# T' P- d    if A_induct=1 then clone 1 load to P_pick15 t+ i; v$ }8 |+ P4 v# E
    else if A_induct=2 then clone 1 load to P_pick2# h0 ^! I3 T' P% t. Q; v( F
        else clone 1 load to P_pick3
- \8 H6 X* w2 c( p$ Kend; h. C1 Q0 a( n3 g

+ C* O) B9 V) vbegin P_pick1 arriving
. t8 ~1 t! Y5 q* W    set A_i to 1
5 T7 i) `! T* o  g    move into Q_induct13 V5 t4 z' u8 t9 L, {
    move into pickaisle.induct1
* F( V. O6 Q; \4 \    while A_i<=30 do begin8 K% f; p, r8 d- @/ U; x
        travel to pickaisle.con(A_i)1 B) M' {5 v% [+ y$ [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 P* d: Z; w+ S, s
        else wait for 10 sec
) Y$ \8 g- V3 J# v& C, K: I% K        if A_i=A_leave then send to die5 X* P# w0 _- m/ `
        else inc A_i by 1/ @7 }3 k, Y; Q/ _0 Y/ C5 G! F
    end
6 V, N7 J  F% fend8 {7 p9 b" B& _' v. Y* q

9 f3 O5 t- k' r* V; y3 gbegin P_pick2 arriving" R' }& g3 v, x8 s" V$ C" i
    set A_i to 11
, V7 q3 K3 K+ |1 t* Y3 b: i    move into Q_induct2
* t; W' m7 \& e. u) x- a    move into pickaisle.induct26 v7 y+ r# l9 M& {: {4 r7 u
    while A_i<=30 do begin4 O8 G% ^( X: S$ X7 h" Y. @  f2 |
        travel to pickaisle.con(A_i)
, p% {0 _$ T+ r% @' C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! {$ O  Q0 S7 |        else wait for 10 sec
/ l& d" |* {$ r& ^5 Z        if A_i=A_leave then send to die
" C( ^/ Q: t! O) V        else inc A_i by 1
  f. b1 h) T! U* x! U    end; \1 k2 H7 \* m8 w- }2 o; x, }. M
end. R) @9 z% m6 ]3 J7 R6 y# E* Z
' j- u" Z6 ~! n
begin P_pick3 arriving
. w& d: b4 ]8 J5 |3 ?    set A_i to 21; j+ v2 R' C# v4 Q+ v# |! a/ t, L
    move into Q_induct3! V0 J7 V7 j3 K) t) }
    move into pickaisle.induct3
; M( e4 j4 K3 m3 d. E# h* j    while A_i<=30 do begin
- D% C2 U1 q6 X  x        travel to pickaisle.con(A_i)8 S* I0 n% i% l7 v) I( v: B. M( y; [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. \0 H5 c  \& X6 g; B* Z1 B$ l        else wait for 10 sec
0 X" t- L* H1 a/ f$ N        if A_i=A_leave then send to die) b5 F# A4 E1 ~8 B+ d: O% k
        else inc A_i by 1
# ?) X% w. I3 K: m% n5 k    end
4 M) C4 Y- v" f+ E) uend

最佳答案

查看完整内容

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是个什么东东?$ L) Z; }" F2 a$ D& z
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: P' |4 k* O% \+ B% v5 N3 s! D) i/ A, }
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 z0 N* @( c, j) S  {' A; |* ?
$ p) Y; {; c1 m; j; |另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
& x( k3 L1 u3 ^% h; l3 W! q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! M8 E) X" G- u3 Q& w) H2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( ^# U; y0 g$ ^( C4 W3 q# l  z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ M$ \+ L% U2 n( k
begin P_induction arriving" e- _% G0 n9 J6 {( }" v% Y. H# A
    clone 1 load to P_pick(A_induct)
* @. [+ R8 F% D( m4 @# c* H: Fend最大的系% S) t+ @+ u0 m
& Q! I% K* H5 H- p$ x- L
begin P_pick arriving
6 T9 c! J  l; i4 N1 e    set A_i to procindex * 10 + 1
' f6 c; t& i9 m: v! Z& b    move into Q_induct(procindex)
" w' |4 m5 N/ S    move into pickaisle.induct(procindex)( E  M. H  @  [; d
    /*check the type of pickaisle.induct(i), for your last problem.*/- G1 ?$ G7 b4 p9 S4 J) `

% ^' D2 q. R- y. _9 R+ r6 P9 P    while A_i<=30 do begin, d8 v* F$ o% ^
        travel to pickaisle.con(A_i)* a4 e- [: @/ W5 f; [. N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, X0 \) S* h: f  e! `! P$ D6 c  ~) E        else wait for 10 sec8 q2 |( K- W; @" h$ J
        if A_i=A_leave then send to die: T0 I$ N7 p4 K" D/ |' e
        else inc A_i by 1
  m9 ^& w( q6 |0 Z    end
. b! Q- f& P+ `' P0 n! X3 dend
, L1 n( b( B, Y1 _' O5 }5 G1 o
: P* t; g* F, s其中的procindex为整形,代表当前process的序号。: A  ^! @2 W' E0 K3 b
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-3-18 23:57 , Processed in 0.015857 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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