设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14303|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- W) T% p3 v+ f1 C3 @* G5 Y
9 D( N' D4 ~+ ?6 f  y2 a& k/ 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中的数值,不知道会不会有什么不妥。
+ w# T8 {' U8 \3 v7 Q4 G; v+ j4 U& R9 w# z
begin P_read arriving
9 c+ Z7 w: A7 B( A    while 1=1 do begin, d3 J8 C% i" c. F9 W  H& n
        read A_tote from "data.txt" with delimiter "\n"
% c2 Q% j  B( t5 |: p4 ^9 ^& U        read A_time from "data.txt" with delimiter "\n"3 H) ?0 r  W. B" e3 j
        read A_leave from "data.txt" with delimiter "\n"! p0 N7 o" U) Q0 g3 _* {
        read A_picks from "data.txt" with delimiter "\n"( P, A' m, a- q* I! c
        set load type to A_tote1 M$ y/ b1 E- S4 A, z
        if A_tote="tote 1" then set A_induct to 1
7 h1 ~! x$ i+ U! ^+ |4 D- b        else if A_tote="tote 2" then set A_induct to 2& T; a' T/ W; y
            else set A_induct to 3    - A* u' _; X4 e7 u( U, s" v% T. W
        set A_i to 0* d0 t6 @) a" E9 y2 l2 q% }0 d
        clone 1 load to P_induction: v" X; I2 `- J# S7 u4 p/ P! P
        wait for A_time sec1 ]: P7 a( R$ U7 r8 d0 u! m: G
    end# D" v# C6 |2 q6 D
end
1 v/ w$ i- t/ d
% s* e! D* B# `! F5 ^& [begin P_induction arriving
+ ^  W3 o( |5 |, r* x    if A_induct=1 then clone 1 load to P_pick14 F* Y9 A- C9 f: p/ |
    else if A_induct=2 then clone 1 load to P_pick2, [) J" B- G0 H3 }6 `- H
        else clone 1 load to P_pick3& O6 e1 a# F1 Y
end
0 I( n, u, \2 M$ Z- Q. R6 A
/ n0 g+ l2 d- n3 v; `) T, d' ]8 gbegin P_pick1 arriving! k3 M3 j) I7 n' ^% R9 K
    set A_i to 1
3 g. U* N3 s5 Q9 L0 b/ ?    move into Q_induct1
' G, H) R' ~* V7 C* |" A    move into pickaisle.induct1
4 d8 F* f' y" [1 P3 C. l+ Z+ E    while A_i<=30 do begin+ W1 O4 ]$ {* l" W* |0 c$ u" z1 V
        travel to pickaisle.con(A_i). E2 \* W! n/ @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 _" }9 X% E/ p, Q$ J0 ~, i) z        else wait for 10 sec
/ [- x5 s1 V  u/ V$ T$ i; @  V; S        if A_i=A_leave then send to die/ |7 O2 Z5 V$ V! y4 s
        else inc A_i by 1
. c" G& L9 I& x2 F$ A    end
/ y+ X. p: R2 w, Lend( t! w6 x5 G" d
; ]& d* G2 L2 F: Q1 }; g
begin P_pick2 arriving4 K+ K% C4 u# n# T7 W! G& {6 s
    set A_i to 11( ?  u  }; e$ V6 A/ a
    move into Q_induct2* ]) S  E0 Y0 a& S7 v  S* M
    move into pickaisle.induct2
1 P% U2 ~4 p# _& \7 ^    while A_i<=30 do begin, k. u" T0 H- T, L$ {+ w: M. L
        travel to pickaisle.con(A_i)5 I& F  n' w* r7 b% k6 ^4 J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: h( `' s1 E9 Y# T4 D' m- \! @) f) \) ]
        else wait for 10 sec+ C3 Q' b4 j' G
        if A_i=A_leave then send to die" i2 L! U/ ?* H5 E* Y; \* Z, O
        else inc A_i by 1% f! ]5 ?; c& U5 W( f; }
    end) O, y5 ]- C( t6 R4 y' {
end4 V( c9 ]: I8 P! m6 n1 q

+ W8 Z. v6 X/ F  Ibegin P_pick3 arriving
: @1 y9 e% i; |, \  [6 h& Z/ n$ Z    set A_i to 21
( R7 |% T* Y$ O6 P8 I7 s5 N( h3 W    move into Q_induct3" r- l- d$ ?0 _& L9 ?
    move into pickaisle.induct3# s9 d/ }7 W4 M1 I" q
    while A_i<=30 do begin; Q2 r) N9 t% v! K
        travel to pickaisle.con(A_i)
* s; I. u3 V; O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 S" x. A- ^' \' O" A% {, U- M        else wait for 10 sec
4 S1 V2 v$ \  h. @1 @        if A_i=A_leave then send to die
9 s  h/ K# e8 R& L3 u2 K        else inc A_i by 1
& y4 L5 Q4 t; L7 z+ ?8 S) N, r+ ?    end: M1 W4 P4 Q6 w9 d
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是个什么东东?  k9 S3 }+ j! g
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. b& g# n9 k% N4 G. h4 r1 o/ M; L

6 c7 A! ?; P; F. P5 a4 gAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; J" e# M  v, {. B) a

! T" T" J3 ~& ~, H另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- }* N$ n- }+ U% ~& v1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 t: j) e: H3 m! H' o/ T
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 s+ U! a' [* y  j. K8 l
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:$ j' \0 K9 b# C0 X' S/ t& }) p- C! ~
begin P_induction arriving
4 |5 ^" Q6 }6 |) V2 P" u' [    clone 1 load to P_pick(A_induct)9 L% U, p4 Z& ?5 E6 J  m2 ?
end最大的系( q- s, ~( b9 |) a6 H# R1 R
: s" ]8 w7 n5 n$ ^/ [$ e
begin P_pick arriving8 W& a) q' H' ~( y9 x
    set A_i to procindex * 10 + 1
1 l9 C5 L* r: @, W2 |( M: i    move into Q_induct(procindex)
0 g: i4 X9 z* i2 m/ F, X6 [    move into pickaisle.induct(procindex)
5 P2 w, O8 i+ b6 k6 ^/ s; I4 f    /*check the type of pickaisle.induct(i), for your last problem.*/
  U4 E4 J. `7 w: x2 U3 |+ N. @0 s
    while A_i<=30 do begin
% [  e5 l$ T% @& I! E+ u* l* l        travel to pickaisle.con(A_i)0 n( p" W) X  {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' k0 r! W  X9 g2 ]2 F$ z        else wait for 10 sec1 f: J  ~: L; @' d! Z3 d
        if A_i=A_leave then send to die
( \: R6 x1 e3 `, w* g' g6 ^; T        else inc A_i by 1. s, ~. t) \0 n: [
    end
! p" s. a& Q5 N4 \4 Gend
" w' l) S+ [+ W+ Z; Q& Q5 u, |8 I4 `% t7 n: K6 X: T" M
其中的procindex为整形,代表当前process的序号。% j* r" j6 B7 T1 d+ w/ I9 M
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-6-30 08:39 , Processed in 0.014062 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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