设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13002|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% A2 H& r$ j) x/ v! Y
3 s. J2 Q  q7 l2 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中的数值,不知道会不会有什么不妥。
7 a  [% }7 {2 f$ R' k. N& Y# N9 @* q' O; ~7 l; a
begin P_read arriving
! P9 o" {$ k. S8 K# f    while 1=1 do begin
& z" E; `1 w" j, S9 m% o9 L        read A_tote from "data.txt" with delimiter "\n"; Z6 \! J' e' j. C3 V# z
        read A_time from "data.txt" with delimiter "\n"0 l/ {6 s$ f  Y
        read A_leave from "data.txt" with delimiter "\n"" m! _) J7 z! E- W( t
        read A_picks from "data.txt" with delimiter "\n"
) e: d, r( }3 B3 g$ s* [4 Z        set load type to A_tote, Y" W$ N0 C4 X1 V& z
        if A_tote="tote 1" then set A_induct to 1* j& m0 ?+ C& n; U: V
        else if A_tote="tote 2" then set A_induct to 2; v& q9 |% V; B" H$ |/ ]* ^
            else set A_induct to 3    ! ^- z# L* g! v! U
        set A_i to 0
' N' R' u6 n1 X5 B, t        clone 1 load to P_induction
# z( O' S4 H& m2 T! {        wait for A_time sec$ A' i+ g( z9 d$ j  U/ n
    end& s8 g$ H$ X' S7 O8 n
end  g9 d2 u* s- ]( E8 j3 W

+ S2 S& S, ]; I0 Kbegin P_induction arriving
% ^$ r9 r* B3 C9 @/ d" z9 c% U    if A_induct=1 then clone 1 load to P_pick1
/ v4 F* z, w* `+ Y1 O# O    else if A_induct=2 then clone 1 load to P_pick2
9 D& ^. Z$ k8 r/ X: ]3 P( z        else clone 1 load to P_pick32 e& J  k! `3 q5 z1 p" l# m( Y/ M
end2 W  r7 D4 u. G* |& P

% k8 O$ [9 _1 D+ W% V0 S# pbegin P_pick1 arriving" W2 t# ^- f- Y6 Y2 B+ D. F
    set A_i to 1" j: }  S/ y# i6 a: `$ x8 F9 p$ l
    move into Q_induct1
$ \* V7 y, r( j/ ?  }: l# z: ]8 r    move into pickaisle.induct16 l% l0 l; ^/ z9 q0 E
    while A_i<=30 do begin
* L# D; ?2 k, ~+ X/ I- T$ ~7 @        travel to pickaisle.con(A_i)" B3 `9 g* T0 Y/ \! P( k: i, n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 S) |7 w8 G8 \; I
        else wait for 10 sec' h2 r' m& u3 y! i
        if A_i=A_leave then send to die
! p) H9 R' O# j$ L, o. k. `) i        else inc A_i by 1
+ L/ _; q( l# Y; I: y5 t* O3 o4 p    end
% p% {9 A9 F+ C3 c- F) wend
3 ~* s2 S. V" w# d, u: G: M; \
: G' s: u6 r+ n1 E6 D3 Sbegin P_pick2 arriving; f- G+ o5 O' X# r
    set A_i to 11
+ v, i! {8 t6 O) f- a0 G& u    move into Q_induct2
) D' m- U1 b' E    move into pickaisle.induct28 C6 i+ ~: X/ y
    while A_i<=30 do begin
& z6 p4 C( ^3 E) ?        travel to pickaisle.con(A_i)5 s4 o+ g# e' n5 _# t: e& A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* u* |* a; T1 G7 S% ?, b" W9 `
        else wait for 10 sec+ B" g' N% w3 v. y4 J
        if A_i=A_leave then send to die
' r5 p: _" A8 M3 q        else inc A_i by 1  h8 s$ V8 A0 Z+ V) X" E$ C5 w
    end. n  h9 f0 b! d% Z, b5 S- B
end
# k# H* ^' \; `0 B$ A( H
! g1 ~0 N! p3 Y5 ^7 fbegin P_pick3 arriving  V) s) A: j8 }" ?* S4 r, G
    set A_i to 21! p$ q1 l% w; Q0 m& L0 l# S  P7 v, X+ M
    move into Q_induct3
4 D; C2 h0 _  p3 H    move into pickaisle.induct3
* i- q% }, P7 F$ U% }6 x1 H  C* ]    while A_i<=30 do begin
' m" d9 ~8 c7 N* c$ P0 L) l        travel to pickaisle.con(A_i)
( H. L% K0 a$ u& O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( c, W: n1 D( I& H% {% h4 z" a
        else wait for 10 sec8 J9 m" g/ M( n
        if A_i=A_leave then send to die; V$ d6 z4 F, y3 j: k9 j  x
        else inc A_i by 1! z" r6 d" i  c9 Y
    end
9 b; l! ?4 ?/ wend

最佳答案

查看完整内容

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是个什么东东?! c( i  P  |: m) d% l6 ~
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- F& c$ k0 Q" v/ t
9 x. y: R$ h& M) Y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 {6 ^6 O/ O  g# v* y  a% o7 G7 ^, ^, w' }
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, H" q8 q3 o2 t8 X# L6 I1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% e5 h& m# i9 L" @2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 z$ y! b* X+ E  ?3 @
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 v3 |7 x6 D. K* Y* s5 x
begin P_induction arriving
, e; S# L0 t4 D& e* K6 s6 U    clone 1 load to P_pick(A_induct)# T8 a$ J/ I# c( X; O8 S5 Y& h
end最大的系) H  c+ _- Y# \* v4 l
2 G' D2 v: @! \6 q$ V/ N
begin P_pick arriving
* l+ X$ W; S3 i+ F    set A_i to procindex * 10 + 1
5 s& S/ X& G" `" Z    move into Q_induct(procindex)
& ^( N3 e7 j2 L! u    move into pickaisle.induct(procindex)9 [- P$ u+ p' F- z" ~
    /*check the type of pickaisle.induct(i), for your last problem.*/" G6 k( R* H9 Z8 k
2 r2 B: f5 h! y& i; K8 ~
    while A_i<=30 do begin
2 H# K# ^$ ?: W# Y7 Y# q7 D( G! V9 B        travel to pickaisle.con(A_i). V2 y' Z" g- L: Q; Z' r9 r* n+ Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  J0 k6 ?- [  ?! K; Z* Y, i
        else wait for 10 sec
) m" F, `( _3 [        if A_i=A_leave then send to die
% ?8 Y8 e  }4 X& R( e" [        else inc A_i by 1
5 i7 D) W2 j" U" Q( [* W( Y    end6 @- j* W9 b4 Y, k& v* e5 F
end
1 y3 Q+ h8 ^5 I
- u! B& l. H. o" Z. U其中的procindex为整形,代表当前process的序号。
  o1 X; S% o) }* q1 kstation和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-3-10 03:56 , Processed in 0.014264 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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