设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11994|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# c& W2 E5 R# r- n
+ U! \/ h' q8 H; n: b/ _  l3 G我的问题是,在每个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中的数值,不知道会不会有什么不妥。' [2 t% _( e6 H, T! l, ~$ c
+ B- y* W: A2 w+ L4 a: N
begin P_read arriving' m: k0 q! X4 T) b% K8 }
    while 1=1 do begin
9 a. _$ {2 {- `8 n1 N        read A_tote from "data.txt" with delimiter "\n"8 x  Y# ?; z9 l+ G" j3 O) a
        read A_time from "data.txt" with delimiter "\n"4 @7 D' k0 U" w: w7 X
        read A_leave from "data.txt" with delimiter "\n"
, Q' P0 T* t# o, \3 f        read A_picks from "data.txt" with delimiter "\n". z! J6 m9 i4 j* q
        set load type to A_tote4 `5 Y; E0 c% H  a: Q& D+ V
        if A_tote="tote 1" then set A_induct to 12 O! k$ k# X. m2 I4 D/ v/ Y; S. @
        else if A_tote="tote 2" then set A_induct to 2
/ Y9 x4 I9 L, J1 N3 }            else set A_induct to 3   
6 \1 D: H5 ?( }$ D8 J: r! _        set A_i to 0/ J' ?# h7 d, A. C2 h( h
        clone 1 load to P_induction! t* ?9 S  i  P- I2 J$ h
        wait for A_time sec! d; ^6 i: n+ R3 J
    end( p" L; \2 a% u7 W5 `
end& D  R( S1 W- Q: q

$ d1 ~3 j' s* [) Q) z" f7 Vbegin P_induction arriving: Q3 [# K+ u" P  K! _4 z+ ?' c0 W
    if A_induct=1 then clone 1 load to P_pick1
( ]' I( F2 Y4 r0 B    else if A_induct=2 then clone 1 load to P_pick28 o& y1 P* y) p" Q! T- O
        else clone 1 load to P_pick3
' s, |3 D- h, J9 a4 y1 a4 K% S6 wend" _7 [0 e: L) K7 _$ `" x
  b" N. g4 `; h
begin P_pick1 arriving
5 _! M) q4 d# [0 K    set A_i to 1
. b9 x5 W. {" h  V. |    move into Q_induct1
8 h# h9 y, w% q4 m" Z    move into pickaisle.induct1/ u+ R, A  ?' Z: T4 l8 E
    while A_i<=30 do begin
  t1 m" P8 O% F+ ^5 {: E        travel to pickaisle.con(A_i)" @& X: V$ @" T0 n! i9 ^3 S  L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 j- Y0 W8 W+ X1 r* N- ~/ y        else wait for 10 sec2 b5 _% A' h2 `* e# }& h
        if A_i=A_leave then send to die
, Y  w, V& z3 |: ~/ V' `        else inc A_i by 1( [7 L! w, o: s
    end
% E6 ]( X1 u8 x4 t# {end5 u: Q0 Q" M3 }) V
( |9 h% `8 @, E( }  z
begin P_pick2 arriving& N: b4 W0 J: o+ M' p
    set A_i to 11
/ w- b/ d) o& \* Q% Y9 \: S/ I) n    move into Q_induct2
/ J+ _2 Z7 p. g* i/ n    move into pickaisle.induct2, e9 R3 W; J% w5 Y' ]" n% W
    while A_i<=30 do begin
! \7 I' p! N, |5 M* w+ }8 g        travel to pickaisle.con(A_i)
# t# a6 r/ E$ R  ^; ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( ?# Z. [: X2 [  G% E' t! i        else wait for 10 sec7 E$ n6 e5 G9 `! P/ Z8 {( N# ?' e
        if A_i=A_leave then send to die
+ I6 ^& y& P8 i6 l. @        else inc A_i by 1# j  m4 @* r+ d/ C3 P. z* F
    end; M+ h: g4 V, Z7 ^
end
* J) s, z: k( M) N8 r& I
/ o: o& y* Y) n' p: V7 q6 i" x: s* R4 Hbegin P_pick3 arriving# W2 v& q: z& l  ^: H) ~0 a# c
    set A_i to 210 |* r( ]4 o/ k& X+ T( u
    move into Q_induct3
1 q; X( o8 L5 j! Y: ^: X; E5 e    move into pickaisle.induct38 L8 S8 I2 e3 o0 R4 {1 \
    while A_i<=30 do begin3 `+ L+ G! w9 |# u" }4 V
        travel to pickaisle.con(A_i)
: h" l/ p8 ~- ]6 T# y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, i" ~2 I; C: F3 M) n        else wait for 10 sec
  b+ n5 H& q4 |' i+ z  U" e2 i        if A_i=A_leave then send to die  o, z. G8 \2 A& U5 K. w
        else inc A_i by 1/ \' [* G. M6 o. G; F
    end* |" t- [! p3 ]( J8 M
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是个什么东东?; U6 c) t9 Q# x
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ O' y- `- h* \6 |, t+ J7 |- p
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. |. o- R6 ~8 P# e1 o; J* o) {; s- A3 t; W" f
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! l# `& q' m) t6 s. V& O7 G+ J
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; w1 ]% n( i: U4 v6 m& G
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 O7 y. S; Q7 ?$ d! R4 D
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 J" t3 |+ |0 d# M0 O1 W$ C8 z
begin P_induction arriving! I/ N. w4 P) U) ^
    clone 1 load to P_pick(A_induct)
8 z0 ]  f' L9 ]6 oend最大的系
$ d% r' V0 w, C# j" z& |4 d; b+ b6 b; M" ^$ g
begin P_pick arriving. i) `) k6 ]+ x! N) ]
    set A_i to procindex * 10 + 1
7 R3 J5 t: p/ }0 k! y    move into Q_induct(procindex)
) Y- i+ S, b+ J2 c8 R, w    move into pickaisle.induct(procindex)! n# X" J0 t: ?9 h1 j
    /*check the type of pickaisle.induct(i), for your last problem.*/  a3 V1 b6 G2 b7 K

9 V! F& F$ l$ G: w8 g    while A_i<=30 do begin
& F3 t% K2 m8 B        travel to pickaisle.con(A_i)
6 z6 M# e& f' q1 X3 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' y' R% H6 J4 I7 _* J, B; u; Q$ ?
        else wait for 10 sec- N! t& O: _% P( x: R
        if A_i=A_leave then send to die- M- z0 V" o% f7 ]8 V
        else inc A_i by 10 z, F% x1 {/ z+ g
    end
2 h9 n0 Q; l  l7 S: Pend
- S4 |9 C+ t, T& o( Q( W7 `2 g5 K3 y0 ~: `) L) X
其中的procindex为整形,代表当前process的序号。1 f" {0 |6 }6 _$ ~+ Q
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, 2025-12-19 19:40 , Processed in 0.028811 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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