设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12810|回复: 2

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

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

0 R- E3 {) z6 |$ w) b我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& Z% }9 {5 ~  }) J" t! |$ ]
( f% ~9 u7 V& @+ V2 ?0 R, Jbegin P_read arriving
( t8 }' E% s, g4 Q+ p2 I2 M    while 1=1 do begin
& q* b( w. }* [* k        read A_tote from "data.txt" with delimiter "\n"7 G' Z: p1 T0 A0 P) x8 |2 K
        read A_time from "data.txt" with delimiter "\n"- c6 E# Z& r8 o3 c2 e3 @/ M
        read A_leave from "data.txt" with delimiter "\n"$ ]! T3 N2 F8 ?5 T  a" Q/ Z
        read A_picks from "data.txt" with delimiter "\n"
- W; @8 L$ \4 y3 q& A        set load type to A_tote
, _1 S" x3 p3 s; G5 y        if A_tote="tote 1" then set A_induct to 1/ G; H# Z* L: f4 a
        else if A_tote="tote 2" then set A_induct to 2  @# U* N! ^6 i9 ~+ Z$ o
            else set A_induct to 3    8 q9 m5 ~' h/ g5 V1 |( p6 _
        set A_i to 0; l9 e& E6 p: f
        clone 1 load to P_induction8 J* k+ z# `' E3 F/ V9 A
        wait for A_time sec
' t6 y5 T) y$ R  u, [) h  N% D    end
$ w3 J2 g) d4 [7 O8 Tend
* |* l- S1 I2 a3 L8 S& n7 F2 W) ^/ J* a% E
begin P_induction arriving* T7 S: v- m- f5 J, }5 I" B
    if A_induct=1 then clone 1 load to P_pick1
0 u: F7 R3 \" f0 R7 a# |    else if A_induct=2 then clone 1 load to P_pick22 _  [: }. I' w1 S* x
        else clone 1 load to P_pick3
2 K/ ]; Y2 P+ c. j2 X2 a0 C# i( fend9 C& N) n) [0 h) t- H; j1 H8 ]' c6 j7 G

6 {1 ^1 `7 N# X$ ?1 _begin P_pick1 arriving8 I  }$ H2 ]+ H3 t% f! V: P
    set A_i to 1# b  o* d* e1 `: L, r. g
    move into Q_induct1
8 s' r, ]$ t% k& u& U3 h- Z    move into pickaisle.induct1; Y. p2 r7 ]& a3 b9 g5 g5 T- k
    while A_i<=30 do begin
0 ^- H5 |3 x3 f3 R. l: Z        travel to pickaisle.con(A_i)  X- }( v3 N  q( t: J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 W5 l6 N: K3 m2 \7 ?3 ]) O        else wait for 10 sec) K+ U$ }, B# y& w( g) [
        if A_i=A_leave then send to die
. H# P0 f  C, A6 Z9 ^; T* V        else inc A_i by 1
. h* c( i$ [7 A$ o7 e+ G  H' q    end6 ]; ~) e5 \6 q: A* l  D/ i
end, y2 q9 ~" ?- W
/ Z8 G0 h- Q3 y$ _+ M5 b" C
begin P_pick2 arriving
% J% q" Z# O& y# d' c' G    set A_i to 11
% m4 j% h6 R( X. Q# h; y1 x    move into Q_induct25 C% v4 a8 Q0 {
    move into pickaisle.induct2! _8 \) p. J+ u, N- W
    while A_i<=30 do begin
0 _/ f. n* C0 P. l. T+ v$ W* i        travel to pickaisle.con(A_i)
3 d4 ~0 R# W! c4 s# s  A5 k  T9 N" B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 f. L+ ~& i8 ?. W& Q
        else wait for 10 sec
% @! o! @6 d! b' g2 O        if A_i=A_leave then send to die
# e7 A7 L6 k$ H5 q8 }4 W4 G        else inc A_i by 1
1 `% a9 k# h2 b( T* V    end
" C/ a) c4 ]  o7 u5 s' ~& K2 m8 t& X. Zend
& d* S3 q0 F7 a8 i+ i3 k6 d' P% d3 g3 U$ i! A
begin P_pick3 arriving
8 n0 X6 X, C/ r6 n# N    set A_i to 21
+ o* a2 b1 h# |; Z    move into Q_induct3
1 ]& j; Z1 c; [9 F    move into pickaisle.induct3* b' N6 a9 `3 b
    while A_i<=30 do begin
' h% A- m/ |2 m% A        travel to pickaisle.con(A_i). t0 ~, u2 p- W* a/ V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 T4 z( }  R( M( @& D/ P        else wait for 10 sec
3 O7 V0 z1 H1 ]' a$ A, X3 e        if A_i=A_leave then send to die
! [$ q) k5 b  J+ w% d6 Z$ N        else inc A_i by 11 F/ s+ s6 d# ]* K
    end, m3 h2 f8 b( Q+ W8 o
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 @& A! ~$ {! f7 V& `" Smove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! [! \& l# t0 |& Z

' L+ s& u7 q) m2 L* e$ Q: yAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ t7 C* Q; L9 z8 C) a# Z  k+ y( W$ Q- @4 H5 J% z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 R2 t# U. x' R/ P. T1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
* L9 {$ n8 U  G4 ^+ N6 [& W2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# n  n0 M/ V$ p; \; V$ |3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 k& A% [; G2 h' x8 ebegin P_induction arriving( F- Z1 o8 x( I- F% E4 f3 ~% p
    clone 1 load to P_pick(A_induct), D/ B0 g' R  z% O" i
end最大的系) ?( o, A6 K$ M# A! `3 r
+ p' V4 d. I3 t- |4 k1 G
begin P_pick arriving2 @' k: ]( c0 }/ j% V3 D# a
    set A_i to procindex * 10 + 18 k3 S2 N$ K4 X3 ]: F
    move into Q_induct(procindex)
& w+ \2 q4 O& g* i1 R" I    move into pickaisle.induct(procindex)
( V6 h  w7 J  j! x    /*check the type of pickaisle.induct(i), for your last problem.*/* m$ f' y4 x1 l& P  C- n2 O

. H8 W, x) G/ m5 o    while A_i<=30 do begin
2 K4 K3 s& p; }) @* ^8 m        travel to pickaisle.con(A_i)8 {8 p  ~1 J5 e8 P, x2 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 w/ R% p- N  O: D! u; U2 F
        else wait for 10 sec: A0 w8 `, m7 h. I- t6 S) E7 D
        if A_i=A_leave then send to die2 G6 Q4 b* p- ~1 r
        else inc A_i by 1. E1 T, K7 I5 Q* Z* a
    end& A- H9 H" T2 Z4 E5 G
end
- j* G  a4 c" P9 E2 K
+ ?$ |  `/ ]8 W* G5 |" d其中的procindex为整形,代表当前process的序号。" d6 I' ^/ T7 _
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-22 05:51 , Processed in 0.017555 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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