设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9898|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 x2 n+ @) T2 b. [. c: \4 |2 z' I3 H- `9 K) ^+ O) u
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" h# ^4 G! R) n5 C- U7 H& K
. \/ s; ^0 J/ k0 c. p$ ebegin P_read arriving! _$ ]9 W. Y% b% r! ]8 y# ?
    while 1=1 do begin
* y2 N1 s- m' E        read A_tote from "data.txt" with delimiter "\n"# W0 `- v0 W. c; i2 }- j8 _
        read A_time from "data.txt" with delimiter "\n"0 R  w4 l5 Z, S3 u3 t, t, b
        read A_leave from "data.txt" with delimiter "\n"
  ~/ F" T- z3 |! @        read A_picks from "data.txt" with delimiter "\n"0 q5 B$ h3 q: ~3 J: T1 \
        set load type to A_tote; A6 Q1 }4 J  J
        if A_tote="tote 1" then set A_induct to 1: ]" s8 z5 R  S: F
        else if A_tote="tote 2" then set A_induct to 2  l! Q# Q( U; ?
            else set A_induct to 3   
% T3 n# q5 }, k& L        set A_i to 0, L& h: s1 c& i' m& C8 q
        clone 1 load to P_induction
- b( b/ j$ P9 F2 @7 s  W# e' G        wait for A_time sec
2 W. ^$ f; Z. i/ l3 C    end: i/ c' ?$ Y9 t0 }' {
end
' i- _% j4 h1 k
% y4 P% O( x" M7 S6 lbegin P_induction arriving+ P, A1 {" H1 D9 T- d
    if A_induct=1 then clone 1 load to P_pick1
/ A1 L( x8 Y* \5 Y$ s    else if A_induct=2 then clone 1 load to P_pick26 Y0 K6 t; E" T
        else clone 1 load to P_pick3- a& V2 o$ Z7 f; z
end# |# F/ Y) c7 i* O9 h. S
! v+ R4 R6 `) J) B1 x$ c3 v/ B* P
begin P_pick1 arriving
4 X( m( p/ |; d$ b6 L    set A_i to 17 `5 \- I0 [# G9 }' I) u
    move into Q_induct1
5 x' @9 W& d7 ~$ h" M1 V) V3 N! D    move into pickaisle.induct1
$ E$ Z1 B  z6 o2 Y' Y    while A_i<=30 do begin% S% @8 j1 S9 J( G
        travel to pickaisle.con(A_i)
5 {: T- l- |6 x' k; |! _1 V5 o2 w( E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* G: o  X) s( H9 w
        else wait for 10 sec$ K! e  f/ t) e/ s, X
        if A_i=A_leave then send to die
5 Z5 r& _7 n" v6 D0 P5 E        else inc A_i by 1
- v0 C* b8 Y! M! k; L    end. q  G% _7 \% m. l  v/ m
end: h, c4 y1 k: b' [2 \/ c
4 f/ P1 @0 ?! R! g2 p6 i, Y
begin P_pick2 arriving: g! R3 M: W! j+ T: k" N, n  i, a1 [
    set A_i to 11
$ E( A5 T( v2 n8 A7 w    move into Q_induct2
  l$ x& A/ E3 n- S" ]6 k; l    move into pickaisle.induct2
  ]/ X3 g% D/ R3 A    while A_i<=30 do begin/ f" _& Z, a( b! @  g" H! v
        travel to pickaisle.con(A_i)* x, n7 t, ?  K  }+ }1 h! e* \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( J- ]" F3 O9 b' T& _        else wait for 10 sec
0 q+ @6 x$ d& g- W7 k        if A_i=A_leave then send to die
- w0 [/ f/ V. `        else inc A_i by 19 x0 `) \) D" A: Q' j: ^
    end* R6 i* n# i7 M5 g+ S( e
end# _! q2 L- I. h4 R
# }$ D% [5 q/ r
begin P_pick3 arriving
" u4 `8 z1 y" }: x    set A_i to 21
  C, Z6 ^  D/ z# z/ ]( ]$ t    move into Q_induct3) j5 i3 K7 [) y
    move into pickaisle.induct3) p# d- U5 h' H
    while A_i<=30 do begin
! |2 p. L: F/ ^6 H        travel to pickaisle.con(A_i)( X+ v9 T& V0 N: R/ r) u. Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 b5 L% P9 E0 E0 `& y9 H; _        else wait for 10 sec
3 n5 n" g. U; U- M6 e4 u8 `        if A_i=A_leave then send to die
( w, s+ @8 z9 G1 F' B- s: |& x        else inc A_i by 1# m# r+ a$ E  X
    end
: |1 y4 t+ 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是个什么东东?; W/ M; J2 H! L/ _! \2 N
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?5 X' ~* `+ |; s
* h5 ?! D- d% H# {6 P
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 ?# l- i, v& g7 {
4 b! G' C" Q/ N2 ?# T
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ }& z" [" C; p- h( o1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' k# `3 A9 ?+ r. N/ U! Y! A
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ Q0 O1 S) R  u% K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& @# U# _( V0 r0 Q  O- e, l+ J2 }begin P_induction arriving. |( [4 }" g+ C4 D
    clone 1 load to P_pick(A_induct)) b# O2 o3 M8 _; O! u
end最大的系0 S! Z5 i/ i; f  I7 o  X$ R

6 g' T& ~4 c, x& \$ l8 ^- Z5 ?begin P_pick arriving* `; q( b8 w4 _0 E4 l0 r
    set A_i to procindex * 10 + 1) e4 y% E9 ?; {$ D5 X4 w
    move into Q_induct(procindex)/ h  j1 Y' T* }
    move into pickaisle.induct(procindex)
; A9 I/ q" u" z3 }7 C7 ^    /*check the type of pickaisle.induct(i), for your last problem.*/7 m" F6 [, c* G  C. z

8 C; U# H7 s8 K( Y& j8 M- V    while A_i<=30 do begin
1 a7 p. z, n- O0 H        travel to pickaisle.con(A_i)% {0 \2 r: [0 C* W/ J. f: W4 l$ j% f2 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ f+ W' |( m0 ]0 r        else wait for 10 sec
7 s2 q0 |0 w4 r  S- z! G$ V$ c! y        if A_i=A_leave then send to die
, ^! U0 C+ ]  _" [% k/ N7 q) Z. w/ H        else inc A_i by 1
1 _4 C, A/ X9 S0 o    end# z; Q( s. ^: V# @+ G
end* |) O1 w  k1 m1 R( o4 \  j1 U3 q
( y( N( c6 @- x# X/ j( Z
其中的procindex为整形,代表当前process的序号。' i* z0 K2 |- j$ u
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-7-15 12:45 , Processed in 0.014481 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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