设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6379|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( u+ R+ h' _0 v; _7 f# q8 z
8 o; t9 ~$ G1 O, C) E* O+ X我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 A6 \' q5 M; ?$ f# b: _. h; i  g9 w8 d' c# }
begin P_read arriving! A0 q# t8 r2 k1 T; C- G! o1 U& z
    while 1=1 do begin
( f, _* D( }1 x! y. o        read A_tote from "data.txt" with delimiter "\n"
3 H5 V+ q( B% u+ |' V        read A_time from "data.txt" with delimiter "\n"3 z9 H8 a! L& x5 w. F/ p
        read A_leave from "data.txt" with delimiter "\n"
: M& t' J7 X: z/ \        read A_picks from "data.txt" with delimiter "\n": d6 A% ^* M: q2 \
        set load type to A_tote
- w. V1 U+ y+ u        if A_tote="tote 1" then set A_induct to 1
. r, D- [. Y2 |# F2 I) U3 h' p        else if A_tote="tote 2" then set A_induct to 21 l4 V% ?0 E* v$ d
            else set A_induct to 3   
9 F  B3 {% ~: K" p        set A_i to 0
& {% S' s- A+ B& x$ D! a8 {5 @0 p        clone 1 load to P_induction
- H7 B) k: a/ M& l8 [2 ~- n- \        wait for A_time sec8 d, G' n" J$ I5 r$ C9 b
    end0 n/ f+ n% k( o* V; |) O
end
' X! h+ I  d* G+ }6 @% w! p, N' T
begin P_induction arriving" Y: B- @1 H( m- h! c
    if A_induct=1 then clone 1 load to P_pick1
, a6 K0 r2 t# o' `7 _7 B. \    else if A_induct=2 then clone 1 load to P_pick2
2 G' r3 a1 v! U3 L* \6 t- e        else clone 1 load to P_pick3, g1 i/ v! |9 J; Q# O4 Y& d) }2 `
end1 i8 C, O  x+ w5 P3 j# o3 I% C4 Z: S
1 ~, e* |+ g1 m2 j1 L  M3 a
begin P_pick1 arriving2 @6 `7 H; z: A+ I& s- n/ j
    set A_i to 1
) r) J8 Z+ k: Z& Y    move into Q_induct1, ~9 Q- E1 |& c  E' p$ s
    move into pickaisle.induct13 H6 ?* y" ~, y, A1 E
    while A_i<=30 do begin% V+ a, t8 }3 ]8 v0 E
        travel to pickaisle.con(A_i)6 U) M  N  b2 e* _8 i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; q6 X! c% z9 ~  o
        else wait for 10 sec5 _! n& s! A* k# t/ J+ }, y! x
        if A_i=A_leave then send to die
4 r; K; Z2 C* |1 I; C% q5 x* {        else inc A_i by 1
: P1 H) R/ i" R    end
* L6 g) W" a# Yend, o& H7 l4 F  u- \+ L* H" Y4 H4 K
8 e5 W5 b! F3 x, F6 ?$ I
begin P_pick2 arriving, ~. w3 h/ B0 ?* b/ ?0 Q+ D
    set A_i to 11
/ e2 @, c5 ^8 i" N- |9 V& @    move into Q_induct2
. L" e' ^/ {# `6 o5 Z1 L    move into pickaisle.induct2
6 W) f% t: D% _$ B    while A_i<=30 do begin  o$ R' x' H' ]8 A  e) o
        travel to pickaisle.con(A_i)( ^6 l; ?# p0 x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 O0 }7 d+ V) P+ X! y, C: O' T0 I        else wait for 10 sec
" O! K$ X% V/ N; ~        if A_i=A_leave then send to die7 @5 r8 i1 }) O6 b) \8 ~0 W
        else inc A_i by 1* y0 h' o: ?8 z4 ?$ c( g
    end1 \5 J7 x  D3 q. r% H" T# ?* K- w( J
end  _. E7 S3 g1 z* X$ Q0 I
! W0 Y& l3 ]4 e+ M
begin P_pick3 arriving/ p3 G) B8 k. _, d. R
    set A_i to 21
; _/ h$ W3 G, \9 O' V! G3 U7 P  R    move into Q_induct3# y+ q6 z8 t( Q7 q
    move into pickaisle.induct3) L1 R# X1 L  W0 ^2 W
    while A_i<=30 do begin
& c- L2 @2 k* P6 h! @5 ^" E* i  C7 a        travel to pickaisle.con(A_i)
, }- ?/ A) n! n: |; e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 r' G, g, r3 T3 k        else wait for 10 sec
/ j$ M" f; E# }# y. z        if A_i=A_leave then send to die1 x" N+ F- C6 _, Y/ J9 Z  u
        else inc A_i by 1
- z: l* U6 P" P# p  ~" t    end9 m4 J* S: p* V9 a+ j# R1 o
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是个什么东东?
; d; Y, `6 t$ d$ H& `% ?move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( W% t8 ~& ?6 Y- B& f
: v# I6 _' y4 w- W7 b% aAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" W- e6 p" ~3 ~4 }' v6 \8 r) Y  }9 W3 a  q- a7 n- _8 `$ ]( k7 b  s- {
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- C1 |. a; C/ v
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# ?8 n4 z8 e) D; e2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ p/ G2 W5 x4 c1 @( G' e! {* v1 L3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ _* ?* Y: L# [( I4 G5 ^
begin P_induction arriving
) b/ r) I) t- _/ `    clone 1 load to P_pick(A_induct)
% m/ R2 y7 J& H& m) k) ^/ {end最大的系
0 K; ]/ k2 I: t' B0 j9 U4 ?; D$ m6 \# l- N( c& P8 h- v5 C
begin P_pick arriving# q0 n' x3 U' r) E6 I1 I
    set A_i to procindex * 10 + 1
( i! Y- E' B1 m, o    move into Q_induct(procindex)
2 J& x4 g8 Z! M    move into pickaisle.induct(procindex)
* A# H0 M/ c, Z3 V8 d    /*check the type of pickaisle.induct(i), for your last problem.*/
. g  p6 @) T  f+ V  I6 K. s5 E2 G# ]
# Q. _- s0 K8 B, \. m- H) b    while A_i<=30 do begin
6 `3 f# B4 r$ b* l        travel to pickaisle.con(A_i)# {+ g8 i9 j' i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 W1 k- Z; _) S; u$ }0 D
        else wait for 10 sec& L9 n( g7 T7 q
        if A_i=A_leave then send to die( {  _; \; R, d7 P6 X, E4 x4 _
        else inc A_i by 1
! o& M* q! p( K  H. R6 Y6 Z/ Q    end
8 @% u* X: n) R" ~* Uend* n( w) B$ j6 K) V0 y$ a

& U" @: }4 U1 H9 J其中的procindex为整形,代表当前process的序号。
: v3 g* J9 v2 I2 M8 jstation和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, 2024-5-18 09:37 , Processed in 0.014649 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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