设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12830|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! x* h" u: K- h0 B

% A5 Q2 W' `  u1 ~$ B# 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中的数值,不知道会不会有什么不妥。/ a2 M# s4 ]# P. g$ y, A/ Y

' t! F, S% x+ c1 [8 X# e4 I: wbegin P_read arriving
6 L7 a4 ]) q$ Z( ~! Y    while 1=1 do begin
3 n- y9 X1 z) l  d2 w  |( c        read A_tote from "data.txt" with delimiter "\n"
6 l: U! s- I: X' C$ ~, e0 v2 F1 n% Z- I        read A_time from "data.txt" with delimiter "\n"
2 X9 m1 i" b! Z; c        read A_leave from "data.txt" with delimiter "\n"
5 S0 x5 r# w  W3 E9 v$ ]. R        read A_picks from "data.txt" with delimiter "\n"
8 F+ J5 T4 C4 V        set load type to A_tote4 d2 U5 [; W" I5 o# s- _
        if A_tote="tote 1" then set A_induct to 1' T9 X" F3 T5 b7 X" ^, n# y! F
        else if A_tote="tote 2" then set A_induct to 2" c! f$ G3 E4 ]) ?, r1 z
            else set A_induct to 3   
2 h; ^7 @0 o) `( \, d        set A_i to 0
! o! J/ }, M- Q+ w, u$ v        clone 1 load to P_induction
0 x0 w  L  u1 ], F. e        wait for A_time sec8 C3 U' k: j) q9 c' b. C
    end* P% W! ?: i- t7 `" l* T
end
7 p- t, A' r7 F6 i& c" T' ^* L6 ~! t$ E. W
begin P_induction arriving4 F, p" h- t! Z$ |$ d
    if A_induct=1 then clone 1 load to P_pick1
! X$ s0 c( i) e" w0 X8 V- j/ w- b6 r    else if A_induct=2 then clone 1 load to P_pick2) h! r( T! c( \7 A+ Y& `
        else clone 1 load to P_pick3
) \$ X/ f. R1 u) T" k+ w! Q# I; Kend! q: r0 y4 E  z) t
% A/ Q8 C& _( b3 n
begin P_pick1 arriving
- X) [5 R1 R* G; p/ D    set A_i to 14 L# v; n$ c' p
    move into Q_induct1
7 e! R$ c; c" C6 U    move into pickaisle.induct18 n3 Y6 k( p+ c( v( E/ l4 a* @- X' |; E
    while A_i<=30 do begin: `+ F* k: |7 A# x
        travel to pickaisle.con(A_i)7 Z5 S' s% V. u5 f1 _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 Y' `; r9 @1 p4 k
        else wait for 10 sec' @: P9 f+ J2 Y1 a) Q, Q
        if A_i=A_leave then send to die
3 v1 x% Y- \2 u+ c        else inc A_i by 17 {* o& w" L) T+ p
    end
- E& p6 k0 D7 Q/ `end! [9 v* w8 W, [

8 z! x0 {+ W  J$ V3 Gbegin P_pick2 arriving; B  j3 \6 R, E% U. c
    set A_i to 11( n! B' E3 R' v& ~
    move into Q_induct2
  ]% {9 |) R, F0 W0 p0 b    move into pickaisle.induct2
0 _3 h: {* u: f; r! \* N    while A_i<=30 do begin. H( F: E$ m  @
        travel to pickaisle.con(A_i)
# ~: L( p+ X5 Q" s" m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 O+ P- D! A1 G, |/ \+ z
        else wait for 10 sec
- B* t6 w7 s5 M) ]" m) p        if A_i=A_leave then send to die
- Y3 j) S, n! C! R8 P) M! J2 L+ s        else inc A_i by 1% s" h: s1 z) F) @0 s$ `1 ?3 T
    end
& d' f$ H' S% z' Q3 b# n4 [$ Y+ Tend
/ v- T! E( P# f, b/ F5 t  K$ {6 e$ Y9 g
begin P_pick3 arriving
4 V* L. e; Z9 i  E  C    set A_i to 21' o+ k1 |' b- M& w
    move into Q_induct3
+ a" w, q9 F' h5 ]    move into pickaisle.induct3  @! \# v) [. ], W0 n% j
    while A_i<=30 do begin+ k- l% @, f- Y& k
        travel to pickaisle.con(A_i): j0 z2 ]- O- t' g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  X) \( a' R5 n! B& f% v
        else wait for 10 sec
$ h* ]$ K' n" n% z) K* [- y        if A_i=A_leave then send to die
8 {% \% V9 u* s  v        else inc A_i by 1" x, T4 ^% z: u, R' B0 {% N4 `
    end
4 G  K. q0 _3 w" Y8 \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是个什么东东?4 q) h0 S' B# [5 f. X/ e% F6 j5 }
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?% ]  T) Q) V# M/ T* ]

6 {  T" ]* v; u4 D' TAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
+ h5 v9 U, D# t  |. @. s" P: i6 T+ k
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% r$ V2 x: ^- a/ T0 ~0 H
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 Y) G$ z9 T" N3 U+ l* D" l. y5 x
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! L- E" M* Y6 F/ P: W
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- [' k8 K1 L' z( R. V# D/ z
begin P_induction arriving
/ v* Q2 d' T8 O3 E% T8 a    clone 1 load to P_pick(A_induct)6 r$ p) c# K" ]3 {
end最大的系$ B+ m9 s% d: F$ E
/ J4 O# {0 g0 _
begin P_pick arriving
; ^  Q& p6 |. N* k    set A_i to procindex * 10 + 14 @  @# y7 W2 `8 v! D- O) [
    move into Q_induct(procindex)
8 D2 Z) b9 H; e: I    move into pickaisle.induct(procindex)- Y' |+ j+ u- @# w9 {% V. Z% z0 Y
    /*check the type of pickaisle.induct(i), for your last problem.*/
! I( _% w, E; a7 C3 X1 u% I) i! q( H- G
    while A_i<=30 do begin( G0 @7 Q4 _( T; G2 ?, a
        travel to pickaisle.con(A_i)# U7 j2 q$ h4 @1 e) f! k( ?9 X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! _& E- d* B6 G/ r1 U. J        else wait for 10 sec6 i2 p, h. S( Z$ h2 a0 W
        if A_i=A_leave then send to die
. d2 j( B0 g: r9 d' N        else inc A_i by 1) Q$ r. n2 S( f* `
    end
1 u/ D2 t  }) Z! S# {; pend* K! B7 }( {+ U2 r

# n5 w$ i% {/ f6 W4 O其中的procindex为整形,代表当前process的序号。% V* t! |; k( @7 M, l: r
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-2-23 05:19 , Processed in 0.015076 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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