设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12586|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 V7 d. o* j) Z
2 E- \* f7 R3 ~$ S, j) t0 T我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# r) r$ M, ~0 J# A7 w/ K2 G2 p
+ X0 R/ I0 |% N8 \  ^" S6 H" e$ n8 jbegin P_read arriving$ o% u3 Q' N0 ^& {4 E3 L
    while 1=1 do begin
0 ]6 v, p2 y$ {$ L8 n( d5 i        read A_tote from "data.txt" with delimiter "\n"
) O7 C0 W3 g: M8 h  @8 \1 k        read A_time from "data.txt" with delimiter "\n"
0 k4 A4 V/ B9 a+ v& w        read A_leave from "data.txt" with delimiter "\n"" N, g' [4 I4 p9 U8 U8 d
        read A_picks from "data.txt" with delimiter "\n"
' g1 u# z5 R6 m# j$ I- W  f        set load type to A_tote3 u, E1 z! g! D8 S
        if A_tote="tote 1" then set A_induct to 1+ ?% i: ~& ~7 T9 G9 J: s
        else if A_tote="tote 2" then set A_induct to 2
2 s6 J- a6 O( H7 E& y! d            else set A_induct to 3    ; o0 W* q3 o- n  H( B% s
        set A_i to 0
- e3 m' g) `2 `1 ]/ r( S/ h        clone 1 load to P_induction/ p& Z9 P& w7 C
        wait for A_time sec
$ D4 J7 A/ K* w# ]9 ^    end- i8 I4 n: |$ l
end; y/ s9 S4 p. A- x# k) i' l; G" v

0 b. q2 A- ~# N% ?/ p+ |begin P_induction arriving& ?% |& H1 `& Y% o9 r
    if A_induct=1 then clone 1 load to P_pick1& t( ]/ \) H/ p+ r
    else if A_induct=2 then clone 1 load to P_pick2
1 b% ]' H2 ~; d, ?. C) l# G        else clone 1 load to P_pick3
, D+ G0 C& E' Q: n  I4 pend
  |3 c0 f/ x* N6 _' U) j
) T+ j0 N5 j/ c$ Pbegin P_pick1 arriving
% T; J! X3 u6 w) c    set A_i to 1! H8 x; d; `$ |1 N$ y3 V& e
    move into Q_induct1( k( h. t9 k, `5 J- K3 x$ a
    move into pickaisle.induct1- Z3 ~2 c+ E2 J/ Q: t3 K! f! J
    while A_i<=30 do begin5 b- V$ R2 Q6 o/ p+ \
        travel to pickaisle.con(A_i)
# {; p6 ], e+ b4 |/ c- A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% h% J5 L" f$ Y        else wait for 10 sec5 d  n% G) J- @+ U; b
        if A_i=A_leave then send to die
$ F3 x& f2 n- b        else inc A_i by 1
' ^4 Y( q/ S: ]0 ^# q$ E+ r# N    end
9 I. C% b1 y; u1 I, aend
: [; O9 v. {& F' L4 A! _4 T7 J4 Y  b' I3 ~: f: a- f! [; d- Z
begin P_pick2 arriving- ]. B4 ?( K# c9 f9 ?; H3 z$ ?5 A
    set A_i to 11
  f3 E6 y& b$ N! @7 h1 \    move into Q_induct2
0 W+ Z% |& F( t5 S' E2 z    move into pickaisle.induct2
# o$ z9 s/ N' h) c    while A_i<=30 do begin5 N, \8 n9 V3 }3 k1 N) ~* u9 r
        travel to pickaisle.con(A_i)
1 _- a- N! D( R. e: I3 ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ X: F" h( m# i: k  B0 i; H        else wait for 10 sec& T0 M7 G1 Y. H9 h2 Y$ a
        if A_i=A_leave then send to die
% k' Y7 C6 _" _$ f/ k        else inc A_i by 1
" E- c- `; b* F1 n! f1 {    end
. P9 S, C4 f5 G7 J8 Y% h9 Yend
( G$ K: L) P: G2 p5 A3 ]
. [8 A5 ]0 e2 Lbegin P_pick3 arriving% w/ {, h9 y( C
    set A_i to 21
" }, L  M1 q% s9 g    move into Q_induct3" b. \: B9 R) u% D$ Z1 K2 k
    move into pickaisle.induct3/ a! B9 P' F" s# x& Z* w
    while A_i<=30 do begin: P$ t0 a+ c! G$ G4 Y* A- S6 y
        travel to pickaisle.con(A_i)7 s2 z8 c1 \. |* L) y; n) X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) J2 f( R# ~( ~& Y, A$ d        else wait for 10 sec
7 X2 Z. B* ?5 H% I4 ]" m4 W% h        if A_i=A_leave then send to die" x* b$ ]' N4 H& Q7 ]3 E# q) P( k
        else inc A_i by 1
) M/ l% Y$ o# D    end
6 b+ Y: e: W) {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 _+ ^) p6 [$ e% q) V
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; Z  F- J# r3 O' }

9 H+ M/ i: d' @& j: ?AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 K+ `  W. _2 l& M- ], Q* `6 |! A2 R4 m* ?, n8 W" X" X
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 G0 H. g6 F# [- y% l: j
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ a4 U: Z6 `1 T: [
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 \' b; h. L$ M; w! m
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:# }9 f6 u/ }; l' Q1 {, M$ k7 @
begin P_induction arriving
7 G0 K7 Z9 t% S( |) B' O    clone 1 load to P_pick(A_induct)
) O9 J2 b1 P5 ~8 h% pend最大的系  E9 w; J: ]! n" Z9 W

% G1 h+ @& H7 i' p  ~begin P_pick arriving( u) U) l3 J$ R1 }  C
    set A_i to procindex * 10 + 1
& X& T5 q5 R" @+ }, n# J    move into Q_induct(procindex)
# }# E# p# s6 ?5 k9 c! ~    move into pickaisle.induct(procindex)+ U9 h4 g: ?+ ^
    /*check the type of pickaisle.induct(i), for your last problem.*/
0 h0 a9 v- g$ H  g* }; }, q4 k" b$ e6 `2 l
    while A_i<=30 do begin) Y: y! u4 G" L! f% x; [
        travel to pickaisle.con(A_i)
$ Q  p: g8 i+ ]) y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: e& |  \. x, C+ l& O0 C
        else wait for 10 sec
8 ?+ b& ~5 u7 X, s7 C" T( q$ x  U: H2 T        if A_i=A_leave then send to die" `) Y% i4 {3 w7 I) R6 O
        else inc A_i by 1- T1 F2 j+ z. X1 |  ^/ G1 w
    end$ Y2 ^1 Q. ~  \! ~* N
end1 ~2 X8 R. e8 I  r+ h# J
$ N% b- Y. j% ^8 H% [
其中的procindex为整形,代表当前process的序号。5 a) ]' u! w- P, E+ B2 D
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-2 17:05 , Processed in 0.020541 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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