设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13971|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 s; H2 w, M: G& ]; ]+ c6 t8 S" J0 p: B" U" [9 b
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. B8 t0 c5 Q9 C. s1 B4 u$ m" `5 l: q( f
begin P_read arriving$ m) R1 m5 |& |$ ^& |& u* }. `
    while 1=1 do begin3 D( d" a) y3 c
        read A_tote from "data.txt" with delimiter "\n"4 Y9 B9 n' A; i
        read A_time from "data.txt" with delimiter "\n"/ p* l/ b6 k3 V/ ~3 g/ u, ~4 I
        read A_leave from "data.txt" with delimiter "\n"
3 y; f' ~: T: u! n7 q& E        read A_picks from "data.txt" with delimiter "\n"8 R% d& l) z7 B1 q6 u8 ]4 B
        set load type to A_tote
' r9 ~) n2 S9 V! B+ ~1 r        if A_tote="tote 1" then set A_induct to 1
( g1 I9 i3 s3 W4 j3 P8 E        else if A_tote="tote 2" then set A_induct to 2  f* |: Q6 _0 E" \- S+ }8 S
            else set A_induct to 3    7 P2 E1 J9 z' R7 k% Q& r
        set A_i to 0; G) U( A: a+ K  c/ E% i% ~
        clone 1 load to P_induction
2 u) `  w  N) s& W  {) h        wait for A_time sec
" G% N* e5 y  T    end1 v5 K3 @% a4 [
end
. O* Q" R" N. b& [9 `% [) _/ J* y; \# ^
begin P_induction arriving
7 J3 B' W6 ?& E1 t( s. d% n    if A_induct=1 then clone 1 load to P_pick1- g- c; @! J" R7 e$ ~$ E+ h: l
    else if A_induct=2 then clone 1 load to P_pick2
1 @" E6 S# o4 K        else clone 1 load to P_pick3+ w" O2 a7 Q% R- m
end
; O) L( W3 y+ q# N8 X
) Y4 v8 W8 D, k0 R( {begin P_pick1 arriving
& W0 e6 m: L  |- V( ~/ @" O    set A_i to 1
% t2 l" }& y- A    move into Q_induct16 T" O/ ?7 O4 l. Q7 d1 H
    move into pickaisle.induct1& q8 R+ h; a  [2 w# h- |. F
    while A_i<=30 do begin
0 y0 z5 f% v5 s3 e' P        travel to pickaisle.con(A_i)0 n8 r6 a% P) p9 @+ b( a7 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 `7 [5 R2 v5 w! |' k+ R' q        else wait for 10 sec' t) N$ \+ B6 b  w
        if A_i=A_leave then send to die
" O6 r' G5 x: T. T6 V        else inc A_i by 18 T' I+ x( Q: d& f6 |. B5 a
    end
. ]/ ]- w6 ~/ Bend
1 a$ t4 q/ C4 v% p. F1 C4 B$ o; J) L5 s1 Z9 o9 Q7 E" ^* r
begin P_pick2 arriving
! U" V& q0 x1 _; |2 Q+ ~    set A_i to 11/ Q* Y$ q: i/ t& n; o) N
    move into Q_induct2
+ D$ T$ l2 t' O    move into pickaisle.induct2$ c5 y5 W5 k4 {( ]. G) ]
    while A_i<=30 do begin$ N9 }8 {! G$ Z. S0 x5 j
        travel to pickaisle.con(A_i)0 ?! c# A* U6 L" _: Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 r7 s- z5 c4 M5 q" i        else wait for 10 sec4 J4 I! M% v7 i" d6 ?2 A* {
        if A_i=A_leave then send to die
1 x! N3 q5 k% s. S$ ?9 e        else inc A_i by 11 `6 P4 V, {* c" a9 J( p
    end
& A, C5 Z3 I: q; m: m  n$ Rend; a) u4 w# z6 v

: C& x/ c4 r7 ebegin P_pick3 arriving" c# w2 R0 g9 j7 f
    set A_i to 21. a, X: |0 z) p- Y* D3 r2 R( T
    move into Q_induct3
: p7 v7 F' p+ J- P    move into pickaisle.induct3
. k3 ]  I4 u5 d# a    while A_i<=30 do begin
% t# Y& s" I4 t% T2 |5 j        travel to pickaisle.con(A_i)0 R2 B" Y0 W' z1 a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 {! Y* m: {( G: |4 h
        else wait for 10 sec
, W. ~' W6 J+ E( |/ f        if A_i=A_leave then send to die: D. H% o/ v! p9 O
        else inc A_i by 1
4 ]+ c, U9 C$ W5 @/ d5 O& v1 A    end
4 k: V9 ^( l) L  Aend

最佳答案

查看完整内容

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是个什么东东?
" S9 t" U$ z0 ^+ N" lmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 ~) d  \5 G' _7 @
' E' y7 H! `" S. S7 n( ]6 @
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ L; f" {4 l0 L5 y8 X5 e- v

  R6 g) Y7 m5 J2 u另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:( [7 D. V; N2 b( s- F
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
7 }3 Z3 Q+ b8 S0 ~/ H2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! w3 l2 q9 Z  F; [- M; _3 Q1 \+ G
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" ~& A, S: R. s+ n: C' F. mbegin P_induction arriving5 u. l+ t4 x; w! B% Q7 x' c5 ~
    clone 1 load to P_pick(A_induct)
4 x" B4 O" i, V6 m# [* G. ?end最大的系% N- r4 @, Q- C) K4 f. y  {

7 E) P# T: L& Y' w. D& z5 Ubegin P_pick arriving
$ Z# d. S8 R8 d" X! O    set A_i to procindex * 10 + 1, q, j9 L+ P7 T% q0 `
    move into Q_induct(procindex)
5 A6 u& Y9 Z0 ]+ o0 p1 a1 z    move into pickaisle.induct(procindex)& y0 G' z' o, b) M6 w
    /*check the type of pickaisle.induct(i), for your last problem.*/3 o* w% e1 V' F* l. E4 r

4 V+ r7 q2 k- z" A" W    while A_i<=30 do begin
$ [6 T1 C: z# r& j        travel to pickaisle.con(A_i)" o+ L% w# b% ^& r3 |9 q+ w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% |: W$ }( t( y3 j8 S/ F+ [2 d4 ?/ H
        else wait for 10 sec
9 s4 B' z& H& N7 h% |- j        if A_i=A_leave then send to die7 F" O6 }: u  k' ^& \: ?9 O- {
        else inc A_i by 1
- C1 J- Z3 G* m: S& l    end1 m4 ^# g1 E+ E0 \$ M: t
end
  t# b/ ?1 [/ {! d- W2 g  M4 V4 _, t1 c" @, i9 l
其中的procindex为整形,代表当前process的序号。2 b# ~% |# ]6 m9 ~
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-5-26 03:43 , Processed in 0.014307 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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