设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10624|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) ?9 D" ^: d0 Q6 H5 n
# h  G7 R9 H6 A8 i
我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 H8 J2 d! p8 J7 p7 t$ X2 a  s

6 u3 Z6 t$ d. f2 \5 y5 i& tbegin P_read arriving, g  R* z# k7 i9 z: e
    while 1=1 do begin
9 b7 I, ]/ V, j6 H, m9 Z2 ^7 D7 ]        read A_tote from "data.txt" with delimiter "\n"
4 G: F" n4 U" w5 }        read A_time from "data.txt" with delimiter "\n"  G" V* M* q; O* I' f
        read A_leave from "data.txt" with delimiter "\n"# L. d, r$ ]2 |. x0 N
        read A_picks from "data.txt" with delimiter "\n"6 {0 P4 H  u" ?* e# ~5 D7 H
        set load type to A_tote! f6 ^+ ?3 }% }3 P( Z; t
        if A_tote="tote 1" then set A_induct to 1
% O5 l1 ~/ p- E- Z! e8 H% c) R8 x0 j3 f        else if A_tote="tote 2" then set A_induct to 2
* X6 H& x& Y% f) Q+ ^- o            else set A_induct to 3    3 m/ j& B  ~4 h* t  n, s
        set A_i to 0
& q4 q& q7 o. [1 z3 |2 j        clone 1 load to P_induction- U: ]( O) }! P
        wait for A_time sec
# e% ]* J1 o' y/ N5 T0 E    end
6 E) w( U; `6 Z; j0 _0 q; \4 p) Kend
+ x2 O# d# B  T* e' [* W5 ^
' J; N" u% L( U3 h* @begin P_induction arriving
% c/ F+ x; G+ e- B$ [. z+ R    if A_induct=1 then clone 1 load to P_pick11 f/ Z6 L9 ^$ v# V+ E
    else if A_induct=2 then clone 1 load to P_pick2# @' o1 l+ ^) y* Q9 D
        else clone 1 load to P_pick3
/ r, L( V% C3 Hend
3 L+ y7 _( X8 @# W; M& Y
  l9 C" M! b/ H) H" a' ~( B/ V# vbegin P_pick1 arriving: O" U  G& q0 B$ K1 U
    set A_i to 1
* K- ]7 Q8 t; Y8 o9 e' u    move into Q_induct1
. p1 k* w% V  R* H, f    move into pickaisle.induct1
# S& g6 H( ^& p- D4 p% e    while A_i<=30 do begin+ p; c4 x1 ~% b1 Y0 |
        travel to pickaisle.con(A_i)( |8 B. K, E* P  X3 B, Y  i) ^- ]' N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 i% x# ]1 l& ?9 _5 P* Z4 F        else wait for 10 sec9 V0 t+ _8 Y4 d7 k; }% A
        if A_i=A_leave then send to die4 D4 }8 I% I' I3 F2 P# d
        else inc A_i by 1& @/ W# ?7 Q1 I- L6 x
    end/ z- L2 J# H5 s+ S2 k
end( u: u0 H7 q# c6 y9 d

% C$ w/ H: U( u5 \0 R6 l) c* pbegin P_pick2 arriving2 }. i  U7 m6 d. Q3 G7 q5 e
    set A_i to 11
7 c8 H3 G( H- }' `8 J. A& e    move into Q_induct2
) F/ g; S6 P+ K, V1 V" K6 a    move into pickaisle.induct20 q, c. l0 E5 d! w8 f+ f" v
    while A_i<=30 do begin
: s( g/ C  ]8 f! d8 O9 j. Q3 g! @        travel to pickaisle.con(A_i)! I0 f6 g& `7 D8 C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) I2 r% J/ L7 k  H1 H  a4 A        else wait for 10 sec' ?6 M5 D1 U# G/ i" h
        if A_i=A_leave then send to die/ c4 B$ p7 p9 w6 N, P3 T
        else inc A_i by 1
  S* g/ b% z2 ~) g# u5 G1 o' s    end( |, F" b% M' A4 m, n/ h( \  o& y- ^
end- L7 l% W7 ?, C+ \
& Z! Z: n" \- \  J1 }! t& ]
begin P_pick3 arriving. |! Q/ m* E8 L5 O( T
    set A_i to 21
& N( }' k7 n7 R    move into Q_induct3
8 x& f4 _) |1 w, x' y* f, S    move into pickaisle.induct3
7 r8 X4 _$ m6 D% Y0 \) g    while A_i<=30 do begin
) ]8 @9 {1 D' a' Z2 x3 C) c+ i2 A        travel to pickaisle.con(A_i)! b( @8 r0 ]3 s- n' s3 }+ ]3 i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 g: J) |& o3 i( e! z' ~        else wait for 10 sec
0 r: W" R- v* J$ Q2 _; v        if A_i=A_leave then send to die
7 N) O! Z: ~+ D  E+ x; M8 K3 j" ^        else inc A_i by 1  z( e' m. M1 S$ K: V5 z9 A* M
    end( M2 d+ @1 Y% 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是个什么东东?6 M" ]7 G# N0 ]/ l  B* ~( j
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  {# Q5 R$ x1 J; r- ^

! X5 p' L- O! C$ @& sAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。6 n$ O* z! J9 J

; ?4 H4 Q# v. n3 B2 [另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
5 k. b# b5 \9 h3 A1 o6 w( ~% U1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 ~6 N0 v9 i) |8 V6 @7 {) p7 e
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. T3 I9 J3 g) A$ @# \; A4 `. p( U% D
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  h0 s& Z% V1 u+ C
begin P_induction arriving
4 m) U6 m% m0 t" M3 c' t- R7 Q    clone 1 load to P_pick(A_induct)1 E8 i! p3 D  Y3 b3 x
end最大的系5 U: c! ?6 h: a: E
( D! C: S3 x$ A( ?) j# \
begin P_pick arriving
/ t2 [  G6 T# A; v    set A_i to procindex * 10 + 1
2 A, C  ]) m: S. h& n% Z6 _    move into Q_induct(procindex)  ]" Q( s# N' _& D0 Z" G9 K+ j. s8 |7 r
    move into pickaisle.induct(procindex): x( [; G' }( l& P  p
    /*check the type of pickaisle.induct(i), for your last problem.*// h5 F0 J; L' F7 N' f2 Q  Y

5 N. I& u5 B6 e+ b' L" t" @- P    while A_i<=30 do begin7 f9 W" R! a" J1 ?* h/ {+ H
        travel to pickaisle.con(A_i)
: d" N' Y5 x5 {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; R5 ]4 b+ t- D5 P. s. p        else wait for 10 sec& V5 ^, B! z1 l% B; x$ W, L
        if A_i=A_leave then send to die1 r! H# p" S0 W' S% G
        else inc A_i by 1. G1 B( f& p: ^# ]9 w, r8 a- u
    end
/ H. ]% f: S7 O- Zend8 {/ u$ |$ U6 n( O: I4 p4 d/ I6 Z

* w1 P- l7 O) L2 [; ~/ C其中的procindex为整形,代表当前process的序号。  d) W% S% H% H
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-9-16 06:43 , Processed in 0.017247 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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