设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15475|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% N3 \  K6 Y" e! Z
% H( V0 j% S7 a9 V我的问题是,在每个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, j; K1 n2 c( r% o( E6 Y8 ~& g. u
begin P_read arriving# [  X$ l0 F& j. B+ d+ t# A6 n8 d
    while 1=1 do begin
8 v  S+ Q$ b) Z+ e        read A_tote from "data.txt" with delimiter "\n"$ v& Z( M. |" I' m
        read A_time from "data.txt" with delimiter "\n"
1 B; i: L' m% w; S* L        read A_leave from "data.txt" with delimiter "\n"2 Z6 G/ }2 k; g. Z/ X1 P
        read A_picks from "data.txt" with delimiter "\n"
4 e6 v7 @0 {# M        set load type to A_tote: V4 O0 S" Q7 _& z
        if A_tote="tote 1" then set A_induct to 1
9 p8 K! L9 n0 B1 E& x        else if A_tote="tote 2" then set A_induct to 2" B0 N- M6 s6 ^* G$ \* A
            else set A_induct to 3   
7 W2 d$ Z" c( z& ~/ @0 O        set A_i to 0
4 P) V; J" W$ L; I        clone 1 load to P_induction
8 I4 A/ e4 [+ |: \        wait for A_time sec
! D( C4 \2 H- m4 x4 R, u7 X3 F1 O    end
9 k. u0 w  W) R* [end& @  x& r6 u8 T- t3 W$ @, _% a

, Q4 z0 @, T% i+ S2 P9 \begin P_induction arriving
# O# D; V! U* d6 s7 ~, R$ l    if A_induct=1 then clone 1 load to P_pick1# W8 s  A! l2 L' G- Y4 B, m* a
    else if A_induct=2 then clone 1 load to P_pick2
7 w' n/ S- ]5 l7 h2 A        else clone 1 load to P_pick3
! ~; K! H: j) P+ g4 B, o' d# I" M4 Y; `end: X! y( H" b( L2 ], [% B1 R

4 B. x2 q& W- D* D7 x/ |4 zbegin P_pick1 arriving& a: v3 n- |3 H  \
    set A_i to 1% O' }, S: s5 ^8 X! H) O
    move into Q_induct1/ L$ g! L0 T& F' P/ A3 B% [. W( o3 @
    move into pickaisle.induct18 j9 C& q- f. F  q. K2 R
    while A_i<=30 do begin
1 x: I; J9 `5 X; ?; I        travel to pickaisle.con(A_i)
$ U, V( M/ u& r% ?! G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 B0 a/ f7 _( g: J
        else wait for 10 sec. ], f/ I* g  ~( A5 }6 E0 U
        if A_i=A_leave then send to die
0 f; D2 F& W- \$ Y        else inc A_i by 19 P9 @  |7 |' x
    end
/ O) Y3 m9 F+ C( v! I) vend+ U  R! `7 z- c: H$ s6 S

4 O9 [4 |( c- ^/ ~begin P_pick2 arriving
2 X  Q+ m8 j9 v7 A    set A_i to 11
( w+ w1 h# a+ Y# Z    move into Q_induct2
: K) Y" V# l) ^3 C    move into pickaisle.induct2
0 Z! s% p5 R( [: p    while A_i<=30 do begin
6 e" T  w# {) N8 n2 A; `% o        travel to pickaisle.con(A_i)9 |2 l; l$ i* B* z. E; d- a4 t7 A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) G/ z! L0 s! k0 e' F, e: V$ O, w
        else wait for 10 sec' e) O" v$ F% i
        if A_i=A_leave then send to die. f  |  N3 Z9 [- {1 f5 |* i- u
        else inc A_i by 1
' Q3 Z% w1 q: X+ ?4 r    end7 \0 G: Z) W# Q. ]
end" U6 b! R3 E4 C, m4 B

2 i0 ?4 U" B- G8 E8 mbegin P_pick3 arriving
& E0 T: `) }! [& v+ X( B" B    set A_i to 210 y9 i$ c3 z5 i( b2 |
    move into Q_induct3
* A# r4 L; q5 ?: s8 S; h' G" q    move into pickaisle.induct3
- H2 G! z2 A' v, R  s$ r- q- D    while A_i<=30 do begin
- c! ]( M6 V" ^! D. i" }5 S        travel to pickaisle.con(A_i)
) J4 D0 g$ |* j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; t3 d  K! q( U  Y) a" w
        else wait for 10 sec, R  d1 Y- U+ j- S$ C: [  O
        if A_i=A_leave then send to die: _2 s& f; z8 ]8 k0 ]. j5 c
        else inc A_i by 14 P8 W0 M2 X# b) p  i# p! W, Q: @
    end
8 f, o" s) V/ A& K$ Qend

最佳答案

查看完整内容

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是个什么东东?
, w" t* G& W0 y- l3 u( Xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" [% e7 H( k, g4 T! p
$ e' [% H, W- x0 K  L* q* ~) LAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: A& k4 c' i, ?+ a0 A5 D% K
" N: c- e2 [% o/ i$ c' ^另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:6 E1 T- ~0 a8 E& j: T
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 `9 D6 Y8 z9 [, }1 U# T2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  V. T( y1 W& X: q
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  \8 @+ [" [4 B7 e; }/ ~; u2 N  I
begin P_induction arriving' }: h0 Q) t  J0 A6 k& N
    clone 1 load to P_pick(A_induct)
: k/ }" m  r7 F* d, X5 ?* Cend最大的系* [# C& b- p' O& V; S& r& k8 s. ^
# V7 T8 B/ E0 z& @2 c( n* M
begin P_pick arriving8 W: l! e. q3 Q8 z& `2 q9 U6 U
    set A_i to procindex * 10 + 1  j! c1 v# o  {5 P! k( Z: a
    move into Q_induct(procindex)$ X3 d+ Z: j! c) L% z
    move into pickaisle.induct(procindex)- q/ G8 O- V. t* C% i% r
    /*check the type of pickaisle.induct(i), for your last problem.*/. c% P% L* l( `1 V. n" y' L

1 u" Y+ Y# y0 V& {) E' A3 b6 A    while A_i<=30 do begin
7 g! h% ?. @7 N/ j        travel to pickaisle.con(A_i)6 j5 d5 F9 t- _. v8 _2 w; q9 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ t' \. r& i. t2 A/ f+ t7 h        else wait for 10 sec/ a8 o& v  [* J) P0 n7 L# O; p) P
        if A_i=A_leave then send to die: s" i# N; v3 L* E0 O$ d, M
        else inc A_i by 1
- i) O7 {3 I' H% ]4 g8 Z; [: X) Y+ r/ A    end' @- v1 ^2 [* P
end/ y+ y: k9 O! o* z8 `) T( z$ a  I1 Y
& ^3 c4 E  z9 l$ V3 T
其中的procindex为整形,代表当前process的序号。/ x0 t& Q( B2 O; Z) y
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-9-13 13:13 , Processed in 0.015323 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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