设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13182|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 X! n9 n& }0 a9 M# J/ j3 A! p* t, z) H2 l3 j2 _) o
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 V$ p7 V* O  X/ q0 d
, J/ s4 m" Y" D. H7 q  Z$ Pbegin P_read arriving6 W& Z4 C, l/ Z$ G+ _. {: ~9 N( c
    while 1=1 do begin- [. Y) x' K+ R4 x( w- c2 f1 S
        read A_tote from "data.txt" with delimiter "\n"
. L3 `) e2 O- O+ }% j' a( B        read A_time from "data.txt" with delimiter "\n"
! [3 E/ F9 ^3 R9 `# u        read A_leave from "data.txt" with delimiter "\n"
2 V# M' E  c; T$ w' h/ p5 o        read A_picks from "data.txt" with delimiter "\n"
% V  t: \/ g* B7 p4 H        set load type to A_tote
! _: n- `* I7 T3 @$ Z  _( z0 ?        if A_tote="tote 1" then set A_induct to 1
& |* u$ j) C# E/ Y        else if A_tote="tote 2" then set A_induct to 2
$ {. N0 N# g- m& I: W: e            else set A_induct to 3    1 V/ v  w; L! A: G& X7 j, M
        set A_i to 0* X5 ], S# E0 P( u7 B
        clone 1 load to P_induction
" p: D0 m9 _! B( N$ g" o! f        wait for A_time sec$ H6 W2 d' o& r% E7 S
    end+ B& _" o- o( \3 T" A' Y8 b+ i
end* l4 ^, w8 c. T- v) {. t
6 |0 h8 i$ c( w; A! ^# l9 d
begin P_induction arriving
( ?5 q, j5 ]# b1 K# M    if A_induct=1 then clone 1 load to P_pick1! h, m  Q9 B" u; z1 r1 u- o
    else if A_induct=2 then clone 1 load to P_pick2
- l4 o  d! J) P, @4 S) g' p2 `4 v        else clone 1 load to P_pick3
0 s# m* k0 S2 o+ L# u/ yend
% L1 F+ y, v5 \9 W+ G% ~
# h& u1 P3 S  l" O/ }begin P_pick1 arriving2 I. p& k  q3 o; a% g2 Q2 e
    set A_i to 1
, r9 [1 z/ X; k% \+ C) q    move into Q_induct1
# p  X1 g/ K& ^2 t    move into pickaisle.induct1, G  i3 f; l; T# |0 N6 ~3 Q1 [
    while A_i<=30 do begin4 H0 x6 D" _" ~! o1 W
        travel to pickaisle.con(A_i)
  g: O* x+ [0 S- E' }! q% B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# b9 {; d/ H# t; `9 W; k- B$ }1 v        else wait for 10 sec
8 }+ L$ D* W! X0 }( d        if A_i=A_leave then send to die
7 t  X% b. J6 m. n5 d; A        else inc A_i by 1: c) J. |& W5 J. h+ C
    end# d5 S6 m+ `; T1 _! n, w
end7 B7 n& o5 P; H9 b
1 g/ A. o  e% _/ u, i7 e+ T* p
begin P_pick2 arriving
2 j# I& X" d9 H( @9 q& E* @# @, a    set A_i to 11
- L# h" Z9 D8 p$ v7 y0 B5 U% P/ \    move into Q_induct2
  t4 i5 h3 T8 C* a/ u+ W& t    move into pickaisle.induct21 J% `: n& W+ `5 B3 W
    while A_i<=30 do begin! n/ V2 u9 W, h% T& d8 L
        travel to pickaisle.con(A_i)
4 }* _: a* ?0 \/ |- ~9 \2 ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 w& V3 }1 D2 |3 Q        else wait for 10 sec
9 _& p4 E% T& |        if A_i=A_leave then send to die0 X4 s! S0 z7 o5 N
        else inc A_i by 15 i/ A7 x" R$ @% s
    end
" w1 d) c: {" l/ hend6 @' v$ ]' _! s
. x) y7 B" [# K( R, y( Q
begin P_pick3 arriving
* h, p' M9 [. ^( X" m5 [    set A_i to 21
6 z5 I  I1 R/ F) m) T% l0 I0 W    move into Q_induct33 y% H8 T. w. }& E# Z
    move into pickaisle.induct3
$ Y! L: M0 w/ b; A    while A_i<=30 do begin
! H$ x# |3 i2 h4 `2 a        travel to pickaisle.con(A_i)" n/ j7 S8 r/ ?. v* B1 p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: Z) T' Q: Z- F, e( V2 F
        else wait for 10 sec6 J) \- ]! U) Z9 r0 m& N8 r
        if A_i=A_leave then send to die
' y" w- U. @) w8 I+ x* B/ a' M$ U/ G! w        else inc A_i by 1( S/ Q+ S# k- r9 A; J& Z
    end
6 M) A! ]8 X; x1 Vend

最佳答案

查看完整内容

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是个什么东东?
: M3 M) m) w! x( B) Z( m+ v2 ]move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 d0 i. d1 x% J/ s; G3 o6 S. |: V. p1 n1 x% _4 c- _
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 ?' n9 V! G  s/ \/ n- r& u6 ]+ `! S0 j; c
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 Q( T. y( m( M7 W* A% t1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. J* O* h7 w0 T4 `; g
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- J( }1 I( w# Q4 [8 R! a7 B3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:$ i7 Z% I7 F, Z) x3 C
begin P_induction arriving
9 K: d( l9 V! J; l1 ?' S    clone 1 load to P_pick(A_induct)
4 b5 Y* O+ t  c, p, p6 g, C5 l4 Jend最大的系
8 [$ C( l" @9 Y- L9 |9 a- c9 }3 F
5 g  g- j, y  {3 u; E! T; p: Nbegin P_pick arriving
8 s2 f" f. _  N- `$ u2 G7 q    set A_i to procindex * 10 + 1/ E3 a. g/ o* A% V# c9 Y! I' z
    move into Q_induct(procindex)
# v3 x- L1 j6 [, b    move into pickaisle.induct(procindex)
3 B2 t4 x" M1 h5 O7 _* b( ]    /*check the type of pickaisle.induct(i), for your last problem.*/
( I# b6 l7 B! V4 E& n% j$ S; w4 y" o% G8 a0 P
    while A_i<=30 do begin
( F/ B5 u2 Y6 q4 ]6 ^) P' d  t        travel to pickaisle.con(A_i)
& [7 d0 X) y" O6 G( }3 T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 V# M* Q2 I3 V1 C7 W% }        else wait for 10 sec
$ Z7 C' A, h, C% m        if A_i=A_leave then send to die
8 t& D# q5 ^) B6 @        else inc A_i by 1* D, {. P. }% q& j0 A+ `, \9 o7 t: j
    end# [* w2 I, _" Y1 d) R# L  O$ \: ?: T
end
( m0 C% }5 [* x+ x9 e
6 p- Z2 h) s) }3 {其中的procindex为整形,代表当前process的序号。
/ l" Q. p+ W1 v% r' [  Bstation和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-25 04:50 , Processed in 0.018654 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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