设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12009|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, J; P: ]/ D* d5 F9 ]$ @3 `
) d6 M" \; s7 {) c
我的问题是,在每个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中的数值,不知道会不会有什么不妥。, p+ g) @  s1 n; e$ k* d
  M  l/ ^) ~; H) y" Y5 V4 @; S
begin P_read arriving8 O5 O- F3 w8 o6 x
    while 1=1 do begin
4 e5 O9 W% x: C# H8 _& j        read A_tote from "data.txt" with delimiter "\n"& E- b# B( h7 Q" e" Z8 P
        read A_time from "data.txt" with delimiter "\n"
( I4 }3 [% F6 y6 u4 Q        read A_leave from "data.txt" with delimiter "\n"- A, Q6 [1 z& n( R
        read A_picks from "data.txt" with delimiter "\n"# W" X5 r  |& A1 |( [* d! H/ Q
        set load type to A_tote
* x3 z" ~* ~; N, q  h' m        if A_tote="tote 1" then set A_induct to 1  y8 r9 I# U9 `
        else if A_tote="tote 2" then set A_induct to 27 j- x7 V! S( |+ f9 H
            else set A_induct to 3    / ]% x; u9 |& [0 l5 m# I
        set A_i to 0& Y) e& C. o2 I+ e& Z! U; t
        clone 1 load to P_induction/ n/ b8 z) L3 T
        wait for A_time sec5 |* u# k4 ^' e
    end% W/ `3 _) F8 Q* M/ W
end: `4 v( f" t4 Z0 G/ e

2 s$ O  |' c8 v+ @5 _begin P_induction arriving
7 B! ]! H5 m& ?! B    if A_induct=1 then clone 1 load to P_pick1- W: C1 d( _# G9 O6 I
    else if A_induct=2 then clone 1 load to P_pick2
( @% v. E4 U# S& u/ Q        else clone 1 load to P_pick3
3 N% E4 @# E& L7 k/ S/ c- kend3 Q+ ]; a; _: h2 _
# V2 F- P7 c3 W& ^) R
begin P_pick1 arriving2 X1 V- X# S# g
    set A_i to 1, x0 T7 b7 }( v; L" ~7 \
    move into Q_induct12 z# B0 |4 q3 p( L7 ]2 M+ s
    move into pickaisle.induct1
9 Y( p: ?: O7 @3 v0 O    while A_i<=30 do begin
: i) ~6 g7 A& {. g7 C        travel to pickaisle.con(A_i)
' X4 M0 W: ]; p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- x) g$ S" U& `8 {( c' a: T# {        else wait for 10 sec3 [  a8 J  j9 V9 ~2 d4 O
        if A_i=A_leave then send to die1 y/ V3 Y( {! I( Q) q2 c
        else inc A_i by 1% K" W& p( D5 Y1 F' D9 h9 f
    end, y+ V1 c- }& T, z7 V5 t9 \
end
7 k& |- D6 L* F1 |2 ?6 b/ D$ m" \% v- V. M  X0 T5 s" E% P
begin P_pick2 arriving
6 h5 c0 L( u, E/ R" ^! D    set A_i to 11
: B6 V  [( l+ r- w- Q  B    move into Q_induct23 h; f- C+ l3 E, Q4 a& d' ~/ h
    move into pickaisle.induct27 P* K, z3 U1 q1 I1 C0 b
    while A_i<=30 do begin9 r3 x: V& k& D" ?" m8 L2 E
        travel to pickaisle.con(A_i)9 d7 @- P! b  @% A  Z+ n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" d# J3 a9 L3 c) x
        else wait for 10 sec
3 P8 s, k1 S) O4 O! l- f- ]        if A_i=A_leave then send to die: ~$ G: z1 }$ p' [( K0 J
        else inc A_i by 1# d! m) ?8 o6 z+ S- g  m$ w
    end
. I# b, R6 l4 F2 a$ W4 D5 ~, Zend/ E+ \0 d3 ?$ I0 Y
! |2 P+ p- S7 h: J- r
begin P_pick3 arriving
. r- k! D7 g! c/ B7 y* R9 S7 C    set A_i to 21
% y3 G5 J6 R/ N; C& r7 E1 Z4 d    move into Q_induct3
2 _- {( S& R# F# ]0 p" v' {1 B    move into pickaisle.induct3+ Y; w# \# n! m! |. h- T' ]
    while A_i<=30 do begin
! W$ R8 a) X8 t8 S" z- Z& S, K        travel to pickaisle.con(A_i)
9 f7 e* u: p) {" u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. Z7 c3 e" {2 E4 x* K5 F        else wait for 10 sec/ W  z6 G6 p! v' @
        if A_i=A_leave then send to die+ c0 n! }! W$ p) u
        else inc A_i by 1+ n& d; e! X; {( L
    end/ r3 C: u2 f6 N$ l; u$ w- l
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是个什么东东?7 J8 Z/ U9 n/ v- w4 m' g3 o
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 \& s6 Q8 A# }0 k% z
& L2 M- e; L$ V! g8 C
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
2 Q# W, ?- @  n; Q, S5 J5 A* ]6 |) T2 F2 [3 j7 {
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" g. `1 t7 c8 [0 F1 [" F; N
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! i' X3 `- N+ ^& V
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) ~. ]& z8 ?2 j1 p2 c
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, \# i  f1 j, m9 K
begin P_induction arriving
- g0 P# E3 V2 |    clone 1 load to P_pick(A_induct)
# ?. U% z2 y+ m8 Gend最大的系" N5 o7 u9 x; a

: {7 T7 C5 \; G, \* w5 o& v- Pbegin P_pick arriving  H! d' i5 X3 C
    set A_i to procindex * 10 + 1
- F3 e: v& e# j6 r9 Z0 m    move into Q_induct(procindex)+ I( {# a' ]% h$ t6 n0 C# a
    move into pickaisle.induct(procindex)# P0 _" F3 g/ p6 t
    /*check the type of pickaisle.induct(i), for your last problem.*/7 U- T" U8 ~) [7 B

& n# k' n4 `$ }, F+ L    while A_i<=30 do begin
# B6 f. F' f: W* s) C        travel to pickaisle.con(A_i)4 A* Q6 I3 u" q5 U1 V' q) h8 c( _5 O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 Z9 _2 @; K$ ^; [/ A        else wait for 10 sec4 ^) V9 B. V5 s& |5 H
        if A_i=A_leave then send to die
. F4 D* Z7 u3 y2 u; o        else inc A_i by 1, R7 q6 H: f$ P. W; x  V
    end
9 o1 {- x$ G% f5 U$ E% }end
0 c! D4 U! `$ p  V1 V: V+ h4 C+ c4 U" A2 N
其中的procindex为整形,代表当前process的序号。5 O6 [, y9 h5 u' G+ {! p
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-12-21 01:34 , Processed in 0.020004 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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