设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15262|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 Z+ M1 B7 }  r% b3 ^! Y2 u$ _9 w. q, T$ O6 m, ~9 X$ h* U
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 B/ G. N4 \8 e& f! R
5 s7 q9 u" p" D4 w8 \5 h/ G- @begin P_read arriving  c% {" Q" T- R
    while 1=1 do begin$ X- m; n  @( A1 f
        read A_tote from "data.txt" with delimiter "\n"$ n9 |. E" G5 _" P  Z
        read A_time from "data.txt" with delimiter "\n"1 K8 f' L; w  t# v. c
        read A_leave from "data.txt" with delimiter "\n"+ [) @2 x2 r' K6 Y$ I
        read A_picks from "data.txt" with delimiter "\n"# E6 U* E1 T. a$ g  ]; L/ _
        set load type to A_tote
2 L* ~- E! l# P        if A_tote="tote 1" then set A_induct to 1  \2 p9 p, b6 [; j0 M$ x- ?
        else if A_tote="tote 2" then set A_induct to 21 @4 Z# ]) D/ D
            else set A_induct to 3   
3 [( ], G9 q6 C  }4 P/ E# V" y        set A_i to 0
3 [$ ^; f4 x6 n. ^        clone 1 load to P_induction
  K2 R1 q) ~* e( @1 n4 E: M: l        wait for A_time sec
+ Y2 }. |/ [% w) u* @! ]    end
1 L- `& a! W- dend  R( j8 o" v0 h0 t  \

0 V5 Y( t9 h" r- f; U1 hbegin P_induction arriving2 j% ~9 N$ p0 }8 a( R% u, v8 v$ {4 X
    if A_induct=1 then clone 1 load to P_pick15 z2 e; d( [& K- ?" \' G$ P
    else if A_induct=2 then clone 1 load to P_pick2
5 ]" z: B) ^1 e1 [( p1 k        else clone 1 load to P_pick3
& m: B1 j, A" O( Yend
. K  \: o3 z- [" y* J/ d! T5 z+ l0 |5 A$ x' x( ]
begin P_pick1 arriving
9 y- ~! ]  z3 {# I7 S5 z0 n    set A_i to 1
: i; `5 d& _7 y2 Z5 U    move into Q_induct1
7 D) H% [# P1 w' [  ?9 b% A    move into pickaisle.induct1! G5 _2 S" ~) G1 ~3 z# _
    while A_i<=30 do begin
# o1 }# t' s% {1 ?) k* |* n        travel to pickaisle.con(A_i)& K. G# O5 S& Q: ]6 ~8 z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! F- _' o9 z0 G! p! c1 g- F
        else wait for 10 sec5 K  t. ^1 x7 }0 U; L
        if A_i=A_leave then send to die+ L; n) P( I5 V0 N2 s+ ]# t
        else inc A_i by 1
( X$ |3 x& M% k' l/ o# A+ {    end
5 q1 @/ c% U1 C, `. M3 O7 `end
+ \; p: r) @/ Z$ O1 ~8 L) s- ~3 m$ A* f4 e( I$ {5 W9 u7 A9 H- A
begin P_pick2 arriving! D! V3 d6 E/ X% B1 y
    set A_i to 11
$ P9 ?6 ~2 o; A" l! i: a    move into Q_induct2
# C3 K/ M7 ]5 j0 @    move into pickaisle.induct2$ L, d' V/ n1 [
    while A_i<=30 do begin! p. M  j) N8 z- O/ \
        travel to pickaisle.con(A_i)9 J! ]1 i6 c2 U4 @6 \7 C( J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 N: @1 T: D( u( {
        else wait for 10 sec
4 }) t. t$ ~! s9 @5 X( F1 K  e* b        if A_i=A_leave then send to die
/ k! n) }  |  s$ W. h! V- [        else inc A_i by 16 K4 o+ |, l" [* C1 |
    end
% g) v9 ~( k2 F8 aend) @8 M! @) e3 [2 x

( a& E/ O( y( H7 g: @begin P_pick3 arriving
3 l! u+ C. \, |0 F. ]    set A_i to 217 a" [# q3 m" A: r0 w4 D1 `) r  t' q
    move into Q_induct3
# Q: [2 O9 K, J2 J    move into pickaisle.induct3, i8 S- w$ E5 F1 c
    while A_i<=30 do begin
4 Q' W9 z: x( x9 J0 Y) ?1 n. u        travel to pickaisle.con(A_i)+ x& m8 S2 c  G4 C$ C) z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 r% o. e: z; }) ~1 F) r        else wait for 10 sec
8 ]2 R' S+ e/ A        if A_i=A_leave then send to die, x+ n% Y/ T- E  J) Q% J
        else inc A_i by 1
, d7 M& E# I$ G( Q    end! z4 z6 i2 x  N  v& e
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是个什么东东?
$ t8 B$ O: x" \! }% Rmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, H: I3 ~4 B0 {

2 X! Q* ^7 @& ?4 P3 X( B" nAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! n! T" }% W  Y) H( P% k) N0 q9 ~" F' }! I+ z) J
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 h& ^& ~" k5 @: O+ k# i/ L
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 O( b8 A, N2 X2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
* N- A7 o* U* j  S$ N0 k( K% e0 P: ?$ z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ y4 f. ~4 G' Z( C# O
begin P_induction arriving
# }7 n+ [; i0 x5 b5 L# C) \    clone 1 load to P_pick(A_induct)8 ]( `5 p& H7 R4 R7 C9 z7 g
end最大的系
% U* _9 {- F! A* K% T' P) e1 @2 h
  b/ @: d- R4 E$ K$ ?begin P_pick arriving( J- J5 ^$ N* r5 e
    set A_i to procindex * 10 + 16 ?! X2 r( m% o+ j; D
    move into Q_induct(procindex)4 u& f; s5 ~4 S* g& A8 x5 n7 R( x
    move into pickaisle.induct(procindex)3 n! ^' @! X! d
    /*check the type of pickaisle.induct(i), for your last problem.*/4 n7 S/ `& [$ c9 D/ C; u1 V

# I& f, |* u$ L- D1 Y( E9 z    while A_i<=30 do begin
7 c: G/ ]* K) ~        travel to pickaisle.con(A_i)- l2 Q3 y  X) y/ f4 x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ Q/ v) p" x3 b' S( A
        else wait for 10 sec9 J. j: m; H9 h% B% Q3 l" N6 F$ Y' q
        if A_i=A_leave then send to die
, p3 U1 o; ~6 }: p' M        else inc A_i by 1
7 y' q$ l3 i6 y+ H    end
- I( Y) M1 d. b" C$ g3 [+ Lend
. c; J+ V0 g7 |' K# w9 U
+ C7 u. M. K* y8 M其中的procindex为整形,代表当前process的序号。, l0 U, q7 ?2 W* w' q9 d9 W' s# x/ p- s
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-8-28 07:03 , Processed in 0.015915 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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