设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10385|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 r9 u& [0 \% a; ^. G+ ~% G! I1 V4 B' d- y; {& u  f: z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' K, Y* G3 }) o9 i8 `
% {9 f% z  U* {  Z, Ebegin P_read arriving5 t/ x, Q1 J" n% ?' F! C, A
    while 1=1 do begin
$ ~: `) y# \$ B) d$ A, h        read A_tote from "data.txt" with delimiter "\n"
- i0 L& K3 l" Q2 p        read A_time from "data.txt" with delimiter "\n"
5 ?* o7 ~. h6 }3 I2 o* W        read A_leave from "data.txt" with delimiter "\n"
4 g: n% b  c; Q# c; i- _/ j5 T        read A_picks from "data.txt" with delimiter "\n". a0 S$ z$ `2 W" g  D1 S2 H4 ]
        set load type to A_tote. |& O& d# N( D
        if A_tote="tote 1" then set A_induct to 1( h' N- z. W4 f, ~2 y* O
        else if A_tote="tote 2" then set A_induct to 2& j, l/ A+ r1 ?7 c: W4 b
            else set A_induct to 3   
1 q& M. f! Q% }% c5 ^        set A_i to 0
  l: Z2 c1 a$ e. u# y5 F3 `        clone 1 load to P_induction  u7 d5 T% o6 h1 _
        wait for A_time sec, Y0 u9 e( Q9 J( ?
    end/ P$ _8 a( \9 U8 B
end& c" R$ l, o& p: O2 q  u
$ K! y; u2 E$ U, M
begin P_induction arriving
* W/ g9 t2 y  ^9 B3 q) B( F  d' p- t    if A_induct=1 then clone 1 load to P_pick13 U2 A/ d& l1 x6 {5 B, T" s
    else if A_induct=2 then clone 1 load to P_pick25 D* \) {7 W. e: X" R& i' z; @# W# ~
        else clone 1 load to P_pick35 F$ p1 ?/ v1 A( K7 o' v. R# p
end9 I0 B9 G* n$ z
# |0 A' ~& Y4 M9 l2 I# g
begin P_pick1 arriving
1 A- y+ f! P3 d" \" e$ {, C1 z    set A_i to 1
# v- _& }* c, R1 f7 Q+ r, B    move into Q_induct1$ G" T9 b" P  l- A+ y: P; c
    move into pickaisle.induct1( N4 b! o; Z/ z. i+ L! y1 [
    while A_i<=30 do begin$ K' O/ c' P7 g) f+ X- W
        travel to pickaisle.con(A_i)0 s) D$ F' n% T: y! ]$ U* h* {) A# D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- Q* b% U7 G  A- O  W5 d$ j
        else wait for 10 sec8 c6 t+ I7 V) }* H3 [- m0 N, X
        if A_i=A_leave then send to die- h2 F- j# n% L; c7 p3 {
        else inc A_i by 1' D7 C' r9 G; @( g3 i$ U: Y
    end
8 I0 H9 ^4 x+ k$ Jend
$ l: N8 f( u- @* V! a! |
6 a% p0 ?. G9 ]) h7 @; qbegin P_pick2 arriving
% s  c, c8 L, |, k    set A_i to 11' ?- i! j+ ~  p; A
    move into Q_induct2& y2 Y1 `/ a, q5 ~
    move into pickaisle.induct2' T  ?8 C( E; ^: @8 D
    while A_i<=30 do begin
$ x1 g6 n! j- _        travel to pickaisle.con(A_i)$ C# a/ ?* {+ z: Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 a1 J/ C9 ], s0 J
        else wait for 10 sec6 @" n$ ^5 @6 ^9 u+ g
        if A_i=A_leave then send to die
* Z; U: ^( Y  ]        else inc A_i by 1
; x5 U3 C; |& {- p1 y/ y/ r" T    end
. m  ]& p8 b* W: v* A( T: Jend$ l9 J4 U6 J( d" i. |" ]& F( N

, C( R7 G$ B6 hbegin P_pick3 arriving1 l1 b# c* t6 m/ {: q/ z
    set A_i to 214 B( H6 h2 B) s8 K
    move into Q_induct3- z. g0 B* U7 O, ~5 i
    move into pickaisle.induct34 `0 L, z2 f5 o
    while A_i<=30 do begin
% \" l" `3 j/ P  \        travel to pickaisle.con(A_i)
) ]+ {5 t( f( K& X9 M$ i& c* H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. G/ R$ M3 ]5 P/ ]3 x        else wait for 10 sec
% m* S+ E) J6 L# c9 V3 b/ ~        if A_i=A_leave then send to die
& O# K3 R- P6 n0 \        else inc A_i by 1
, |8 N$ P$ i) ^; v. N6 n    end
. U- I% K3 O" `' S  F) b- Zend

最佳答案

查看完整内容

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是个什么东东?
! T* n8 N0 b% v8 K7 c' @move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?4 F+ z9 Q% o/ ]; {+ v
" g! ^" h, I6 j1 N  g/ Z
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 e- L' ?6 u' X) M% D4 i

6 B, N5 U" D9 a% q  o- F另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 u; q0 V; ]# {7 u9 O9 A2 J, i3 x1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;  N; ]: O3 a0 x) c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" h+ j6 u+ Q+ P6 G9 O- _8 p, m3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& v" n; C5 J( m% e3 }
begin P_induction arriving
+ h: V; N! O$ l1 ?9 g    clone 1 load to P_pick(A_induct)+ w1 \( s7 e8 \6 X4 V. K$ M/ K
end最大的系
6 l$ V7 l) g: z; a( h: H' U* I
* i( _9 X7 }/ {9 e5 E0 Zbegin P_pick arriving
4 S, c( |, g. n: |* d" x; y    set A_i to procindex * 10 + 1) l; a) d& R6 u4 g7 \" E
    move into Q_induct(procindex)
- B/ V+ G7 P8 D8 t9 B- ~    move into pickaisle.induct(procindex)
! L2 \2 T; V9 Z    /*check the type of pickaisle.induct(i), for your last problem.*/; l3 M( J- A7 I) {; A* l: A7 f  _

9 I3 w& k' Q4 O* y1 U" r' ]! E) Z    while A_i<=30 do begin
) n9 W! |( [2 K  K8 O        travel to pickaisle.con(A_i)* z6 J- w) c) O3 Y* z* N0 \0 Y! z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 w7 V. w; y( T- I3 T" {
        else wait for 10 sec% e# H. y' ]+ B& y& `$ o- i+ H* {
        if A_i=A_leave then send to die5 |# C: u% c3 E
        else inc A_i by 1
/ F- W. X1 B8 j, H    end
1 S) ?# F+ U2 ]) D9 Y. Y& K$ oend
! z- A2 N* L6 `- M9 n
4 V* Y5 Q) l7 E  x其中的procindex为整形,代表当前process的序号。% I! {  U7 A. i* W0 T& o2 W
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, 2025-8-27 13:16 , Processed in 0.013560 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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