设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15178|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 K7 `8 ]- C1 C/ z( p( b
) [$ p3 i- e! N6 J& @9 y2 t  R6 e. 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 v; h: X5 U
  k7 x6 R% D/ f" Q; f1 d
begin P_read arriving
" G4 s* g6 G8 r! m3 a! ?    while 1=1 do begin
- E; n) p8 R, H        read A_tote from "data.txt" with delimiter "\n"
9 f6 U* E9 a+ e, H( |9 x) c% Y9 t        read A_time from "data.txt" with delimiter "\n"
2 A$ t' K$ H3 {7 H! S& o- o. x5 a        read A_leave from "data.txt" with delimiter "\n"
/ V+ r% m  c7 m# ]  i) ]        read A_picks from "data.txt" with delimiter "\n"
+ _: V7 v+ l# c        set load type to A_tote( j& c5 S5 g& D& z3 x
        if A_tote="tote 1" then set A_induct to 10 v5 K' o( s# [
        else if A_tote="tote 2" then set A_induct to 2& z) C1 K! {8 r+ g# e8 ?; y
            else set A_induct to 3   
& \+ u: i" L# ]3 Y- ?        set A_i to 0
) _2 o* l  c7 c1 }        clone 1 load to P_induction
! a' {0 ^" n+ d- K        wait for A_time sec% X) f) s% k2 O( g& B# V- N
    end3 X7 O4 p' s" O* S3 {8 @
end* Z% \! i" B2 r3 \2 \1 E) y

) z+ A& ~: G( pbegin P_induction arriving" R& o9 S1 |. I1 {. K
    if A_induct=1 then clone 1 load to P_pick1
* m: |6 l, L. G7 v1 K    else if A_induct=2 then clone 1 load to P_pick2/ n" j* H; G5 \: F
        else clone 1 load to P_pick3
! I% j5 l: k9 oend
( ?1 H& ^3 B) a. o4 f" Z
8 f0 s: L1 R7 S$ l  w: c  |begin P_pick1 arriving
4 m( s+ _  @* V* `7 ?& g    set A_i to 14 p4 I: X! q: ~* z6 g: W
    move into Q_induct1
* m+ O! d) L4 W6 U    move into pickaisle.induct17 ^* S3 W) ?  {* p8 ]& d
    while A_i<=30 do begin
; e: S! z4 o" P% g, ]; Z- m* ]        travel to pickaisle.con(A_i)
  Z6 J; _6 X4 s/ y2 d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% _: o# T$ q2 R        else wait for 10 sec
6 I- ?" e2 v) p) q        if A_i=A_leave then send to die8 x8 {0 @6 S4 O% h  c1 B
        else inc A_i by 1
# B# Q0 ?/ Y' L2 v5 @2 `$ z! |    end
$ m% S0 X8 n! _- r" E% r. F0 c. Z! Wend
, U7 ]1 L0 ~& h/ f8 {8 `: Q0 |* y
begin P_pick2 arriving
+ Z( X; U* o& ?9 ?    set A_i to 11
" K! |$ r  f% k    move into Q_induct29 V7 K5 k) d1 a
    move into pickaisle.induct2
8 B  O6 @" V/ k* z: ^    while A_i<=30 do begin, I1 ^- H4 y1 ~: E3 n+ T
        travel to pickaisle.con(A_i)
0 H! \( ?7 c" y  G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 P0 y) }) P) r+ C        else wait for 10 sec
- _, J8 f2 c/ Z5 F0 ?        if A_i=A_leave then send to die
7 e/ ~" A4 h. \& \4 g" v        else inc A_i by 1
" G4 n: ?4 a  v1 L1 I0 I    end
" o+ w; O9 N# Q7 K& X) Vend
1 y, g6 n( a$ p: |+ r  P6 \4 P
! ?2 G. w5 f1 t- u( ^begin P_pick3 arriving
( ]- H9 {7 ^& \- _4 `) {    set A_i to 21
; W3 t. o" l. l9 J5 }$ m9 P    move into Q_induct3! d! U! u0 ~) `: ~1 I6 l: ^
    move into pickaisle.induct3
  ?5 Z& ?- e" D1 r4 `    while A_i<=30 do begin; t/ ~7 ~" m4 W% I' f
        travel to pickaisle.con(A_i)
8 V+ |% {$ u( i1 m' E# N( H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 u. e. D2 i) A) F        else wait for 10 sec8 x( y" ]7 K2 B1 W3 M( N& v
        if A_i=A_leave then send to die
* a, \5 d; ^" s5 q% H6 n" r5 R        else inc A_i by 16 y, X- [3 s/ H* |/ k
    end) S2 |! B: M# X- d( ^
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是个什么东东?0 y& M& M  t/ s! P: k
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 X& q8 f9 `2 h; H5 Y# h. Y' D" M: O8 i2 ~
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ B1 {& V7 l. W$ s2 l+ L
8 C% B4 X% }% J  _, v
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 n# G& M$ C! T1 j$ u
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 j, D: h$ N3 v" q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 Z/ A2 C% M$ S7 h$ n' l
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, R) c$ I7 F% h, ]+ l' l1 C$ t
begin P_induction arriving6 H5 R5 j6 d2 Q. A. Y/ S
    clone 1 load to P_pick(A_induct)$ T$ S  ^' F, S: k& Z' ^0 Q2 p( o/ H
end最大的系! ~+ Z+ ?  x% N& f$ z
6 U$ g* A. L/ i9 [" N6 t/ x1 x
begin P_pick arriving
1 ^7 x- p% G. k8 n    set A_i to procindex * 10 + 1: r# ?# G3 P. w
    move into Q_induct(procindex)6 q, t  h. V- {# D% T
    move into pickaisle.induct(procindex)0 F. r/ l/ e/ o% z
    /*check the type of pickaisle.induct(i), for your last problem.*/
- p9 n  T% W% h8 \
$ V3 r2 E1 c. Z- U2 ~& ]    while A_i<=30 do begin
; I6 K2 u, A4 e, J/ ]! K8 a        travel to pickaisle.con(A_i)5 j/ t) f* B7 p3 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# D  \! m; F* k" N5 j
        else wait for 10 sec! ?+ K( c3 Z0 Q, _* ?; x/ O% Q  z: u
        if A_i=A_leave then send to die
0 F( G  K' R" c* a( |, E- `        else inc A_i by 1
" s# t# `4 f6 K& q. N5 S$ `1 Z* ~    end* q1 G0 K& ^8 v+ u+ O3 E4 j7 M- D
end
7 n! H& F- Q* }. }: N* L: I' z0 E' f5 J7 G
其中的procindex为整形,代表当前process的序号。
- B) O4 l0 @, `9 ^0 _4 k. Xstation和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-8-20 03:02 , Processed in 0.016687 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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