设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14000|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) c7 ~9 I* ?6 p( t, K; s, B

2 `0 e0 o& q/ h. k: ?2 r我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 @5 S/ H' F5 |4 ]+ z, {; c: V( z$ r. Y8 M  ?+ `. L) [. |2 e
begin P_read arriving
( U: J  P, S; t) I# ~7 M) y0 G    while 1=1 do begin9 E! v2 k& C0 h& m- Z! |5 i
        read A_tote from "data.txt" with delimiter "\n"7 _, y! p$ z0 E
        read A_time from "data.txt" with delimiter "\n"/ A2 S7 `' `0 T. E
        read A_leave from "data.txt" with delimiter "\n"
6 Y* J- k/ v" y- i" {  ?        read A_picks from "data.txt" with delimiter "\n"
# x, }9 K6 ~; x9 H% q9 c        set load type to A_tote
; m  g. H4 N; Y3 X$ ]# Y        if A_tote="tote 1" then set A_induct to 1  x9 |  W) F4 T  M" }. a( D  Y
        else if A_tote="tote 2" then set A_induct to 23 W& y% [5 f8 j
            else set A_induct to 3   
) t3 I8 T* [- O  D4 O' G; T        set A_i to 0
7 N9 G0 E, F. l        clone 1 load to P_induction/ Q' U/ A: q7 J. E+ k1 y1 z+ h  D% ?
        wait for A_time sec  I1 o4 r' F- S7 Z
    end
2 w( P/ z- f3 n' I" I% X; }end
; h) A( H. |: E0 s5 g; v  ^; y0 D' {# K9 S6 H: J& P
begin P_induction arriving% Y, u6 C3 |, ~# V
    if A_induct=1 then clone 1 load to P_pick1
) f: G6 |) p( r* L    else if A_induct=2 then clone 1 load to P_pick2
, C1 \/ W6 ^1 M& K        else clone 1 load to P_pick3$ \# U5 E1 g$ H1 t9 Y9 x: [
end
1 r/ L/ E) R7 ~# p( I- t- [2 U$ O
begin P_pick1 arriving
1 [- C, i2 J$ d  ]    set A_i to 1- d$ u" Q2 w& D4 p
    move into Q_induct1
5 S" u! {+ a; P' L/ C; m    move into pickaisle.induct17 J8 R' z0 X/ z& b
    while A_i<=30 do begin
; N/ `4 B3 L- t% y* g  t        travel to pickaisle.con(A_i)
6 l! Z. i- O# X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# V  I9 ]  m* R, t3 g& }        else wait for 10 sec- j2 D# H6 k- X4 E$ h# P
        if A_i=A_leave then send to die
& f6 c( v$ b3 D  u  [8 q        else inc A_i by 1
; O4 n% j/ C8 q( y; l4 V2 E- Q9 v    end- R* f: Y- b/ m+ {: s
end0 J8 J0 l3 Y& T, y1 t( V+ _

* R7 e1 ~7 [5 T# V7 A* hbegin P_pick2 arriving2 b: g9 D: ]' C+ c) Y0 `
    set A_i to 11
, i! y) C" m+ r$ d    move into Q_induct22 l  ]5 s$ q' A* C8 v
    move into pickaisle.induct2
% V. j% ^0 p9 m7 i! y5 M$ [3 w    while A_i<=30 do begin6 v! D  M- ~6 A+ j- S. W7 S
        travel to pickaisle.con(A_i)4 r" r- l! ^3 G4 [; B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 U3 q0 H- {2 |7 D
        else wait for 10 sec) K1 e3 |7 n! \( G: T# n  ?
        if A_i=A_leave then send to die6 |3 G. `9 u7 [9 {- Z3 p
        else inc A_i by 1
2 Z; n8 m3 s3 L& b    end
$ K5 L2 W& F3 ?9 t+ r0 t0 M/ nend
3 e. t- o# V8 K- e* Z# h* W; y
, _$ Z1 m* D7 y& y% Tbegin P_pick3 arriving7 Z4 I2 ]! S' u$ E! z; c* [
    set A_i to 21' k) X( u# C$ j
    move into Q_induct3/ B; Y3 I- N5 v6 i
    move into pickaisle.induct3
- V, @0 Z- }$ M  V    while A_i<=30 do begin0 w$ m1 I5 q, H' v( Q, z3 O2 E
        travel to pickaisle.con(A_i)9 W+ |  M! |% F" `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ a1 G" `6 F. M3 O4 c0 @) k* y        else wait for 10 sec6 Y* X# G: Y/ P6 Q  d
        if A_i=A_leave then send to die$ k& h- Y- S  C2 S
        else inc A_i by 1
: s# l  Q# V9 ?* B9 q8 o* M7 d& ~    end; e% P8 Z% _& e/ i. j2 I1 k9 R
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是个什么东东?
2 E" U7 Z# {4 jmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ l9 B" k3 i9 ~6 V- @  i3 ?7 d8 x9 |7 j. v7 @
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  B& C) Y7 U2 `! Y8 g, s& f- f9 B/ X( w% g- L9 x* t' n
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 y% R1 \: ?, [! Q' `' y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" j1 ?- ?- u9 [. M7 I# c9 g5 ~
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. q- w( p; R, g8 z. Z* C8 U, R
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: T) `4 I% ?+ O' N- `7 _) r
begin P_induction arriving
) C/ ^9 ?( n" X. d    clone 1 load to P_pick(A_induct)0 Z! ~/ ?+ s# M8 N! Y  H
end最大的系" b. x. D; G& L+ `3 F# T
  c# I$ W* J! c& S' t- L/ Q. s
begin P_pick arriving
; j8 }6 |8 ]9 T& t) }' d: g# k" P. }    set A_i to procindex * 10 + 1. ]( i- z8 c" E
    move into Q_induct(procindex)
0 e6 _# |4 V0 b% n    move into pickaisle.induct(procindex)
) W) K7 l. M( F5 O4 T7 @( d3 g    /*check the type of pickaisle.induct(i), for your last problem.*/' q) G( J/ |/ Z7 S5 C
$ B: r! Y& O2 a
    while A_i<=30 do begin3 }, X( R# n. P
        travel to pickaisle.con(A_i)
8 g& h/ f2 q- ~7 |4 q( M5 t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ ~) U8 |# Z" V9 \0 y$ p1 u4 J        else wait for 10 sec+ j- P' i' r( ~  T- h
        if A_i=A_leave then send to die6 m' x& ~1 f6 a( `6 U7 D5 g6 E
        else inc A_i by 1
- e" X; ?9 ~+ [3 M' r4 W1 P    end
" o. _- v+ Y! W" fend1 H) a+ M4 N$ m( x
- S: g6 \2 i+ _: M/ Q9 N
其中的procindex为整形,代表当前process的序号。
" G/ x1 ?  e, H1 I) j8 K  _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-28 22:39 , Processed in 0.016243 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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