设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15151|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. ]/ W) z3 u5 q% S% h% l6 I
! u6 _9 R# d/ s  K$ ^$ N3 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中的数值,不知道会不会有什么不妥。+ o3 G6 A; g7 R  N8 ^
5 O& P; W4 b2 A+ T+ N9 }
begin P_read arriving% }3 q  Q4 {7 G0 v( J4 d
    while 1=1 do begin
  [8 Q$ F5 m* i0 S        read A_tote from "data.txt" with delimiter "\n"
5 D2 P! G5 T) [( Y        read A_time from "data.txt" with delimiter "\n". A. g% m0 q" M5 ^# _. u
        read A_leave from "data.txt" with delimiter "\n"
$ E, U  b. |: J. A  @9 y        read A_picks from "data.txt" with delimiter "\n"0 y; ^8 X/ T8 F/ l$ S
        set load type to A_tote
1 f  r/ n3 O# c# v        if A_tote="tote 1" then set A_induct to 1+ \2 v# ]0 B5 b" ]+ }; z
        else if A_tote="tote 2" then set A_induct to 2
5 [" N0 ]* ~7 V8 S            else set A_induct to 3   
+ d- j, f! }& P, J9 z        set A_i to 0: }! y1 M5 b3 N0 Z. Z0 h! @
        clone 1 load to P_induction8 g4 N4 x9 P# {
        wait for A_time sec
0 g6 @& p& F3 P: S# c  i" k    end. C( v( H# u/ l5 M
end
' _' `% i5 i/ i5 o$ ^( z4 g. `$ k' a4 d: Z* h$ j
begin P_induction arriving5 E3 V7 W) H0 q  z$ G
    if A_induct=1 then clone 1 load to P_pick14 M4 I* g4 s  Z
    else if A_induct=2 then clone 1 load to P_pick2
! e0 C8 c6 ~5 s$ m7 H  E        else clone 1 load to P_pick33 q" l7 I9 j& l* l" ~7 f0 ]% ^
end/ h3 b7 I" ~# {8 v

4 i/ m% r# X6 `begin P_pick1 arriving
. |, S6 M! h$ T1 E3 [' ~, G% ?    set A_i to 1( J% E) S( @: R" V3 B+ }
    move into Q_induct1
$ E" P) I; {, k7 v+ f- R: c    move into pickaisle.induct16 G( ]$ u7 c  w3 G; X0 x. ?* a" E! p
    while A_i<=30 do begin
9 ^6 t( Z& K+ G6 g: ]        travel to pickaisle.con(A_i)! g3 r% j0 m6 ]6 H! T) m1 z  d0 z7 \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ [( N+ u8 U# ^0 ]) d0 W        else wait for 10 sec
7 U! @$ f' Q( Z. E4 l" Y        if A_i=A_leave then send to die
7 }2 q6 p2 Y/ N        else inc A_i by 1, o2 Y9 ]3 f) r0 i; ?7 u( n
    end
& G1 n7 ~% s, G2 h& l1 Tend9 x" H# d0 U# ?2 a; p2 N
( J3 Y- H$ ?0 w; H
begin P_pick2 arriving
5 z% ~. d" s+ h    set A_i to 11' c1 p4 [$ J0 w- v! W8 V3 b
    move into Q_induct2
5 G1 i7 d! c, h4 N3 q9 m9 ?, G+ ]    move into pickaisle.induct2" u1 a! M0 K5 p
    while A_i<=30 do begin
# G' n; c; `; a  Q& r' D        travel to pickaisle.con(A_i)
: t1 h# a+ R7 t' W. o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 z! H/ {7 P8 ]* V7 m+ A* v' r3 F; N        else wait for 10 sec
' a5 R5 \3 D8 @7 S3 o) k+ P        if A_i=A_leave then send to die# W6 {* k) @( s& I1 I" g8 Z
        else inc A_i by 1# a3 Q4 E( n4 M; r
    end
2 x3 Q, X3 J! ]* j( bend1 B* n  l: G& Y
+ M: ]" `1 E* p& g6 ^0 W9 e6 ^* l4 J4 [
begin P_pick3 arriving
: P* Z* h  O/ p  a    set A_i to 21, O1 ~# f+ d' i7 C* W( ^: o
    move into Q_induct3
2 s1 f8 B9 C% b% u" L  Y5 Y    move into pickaisle.induct3
$ ^% Q! x: l8 Q3 U9 k    while A_i<=30 do begin
8 h2 J; C' d  m& a. U- y) }! T; R        travel to pickaisle.con(A_i)
: ~( N- a9 |% ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 k0 T) S8 v4 L& e( L( S  n        else wait for 10 sec
: p; `) F0 ^9 |' d& v        if A_i=A_leave then send to die
, ?, m1 G" X' ~) P        else inc A_i by 11 o4 a7 A+ y( f9 O: U% e$ Z/ M1 G4 H
    end
: @2 I& \- b. L2 \& j0 G* ^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是个什么东东?
- p' o* d2 z: H& q8 Kmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ [3 U3 z) X" M: i; z
4 M$ _% x, Q+ Y9 J
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  c9 \1 [  o# G) ]
  x6 }1 e) a$ f, g另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:( w' u% R5 I: I' W2 P7 U
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 v: w9 ?7 N: c8 E1 U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ A. i1 }2 r9 g" ~  A- X
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% B" m. q, b- S+ h$ K) E7 g
begin P_induction arriving
+ H. A6 e! w7 H$ ~    clone 1 load to P_pick(A_induct)
) N8 I# w  B1 X7 fend最大的系" ^' q" B5 U/ w

! r) V7 B) T) h) r, lbegin P_pick arriving
$ R# ]7 g. R# M/ m    set A_i to procindex * 10 + 1
1 G4 c% C( h( v, I; _    move into Q_induct(procindex)( X4 [/ q# w8 s" S  u6 T& |& A8 c$ H
    move into pickaisle.induct(procindex)* T% f. D0 _8 ?4 [/ N" y: t" z8 ~8 J
    /*check the type of pickaisle.induct(i), for your last problem.*/
) F# j0 N0 N/ a9 ~0 w. I$ I
0 p% g) m0 }/ P( a; S5 ~    while A_i<=30 do begin2 B0 E' R1 t& v% N1 V4 i7 h2 p
        travel to pickaisle.con(A_i)  `( ]9 f2 U4 K9 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 f: b) m$ K! C4 h' \        else wait for 10 sec
# l& t% ?6 J$ ~. P/ z  r; @        if A_i=A_leave then send to die9 B, m) U# y, v
        else inc A_i by 1$ n! X  _" T  D7 s/ a
    end
# {& v8 b% x" n. s6 gend4 K( }; K+ ?' _+ F* T; J" ~
. u0 i  A! l) Z' A. U' h
其中的procindex为整形,代表当前process的序号。. m, W6 a, r, h. t! Q9 ^' z  z
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-8-15 23:30 , Processed in 0.016344 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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