设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11742|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 n8 u% V7 b7 B7 B) |/ j

( a  r1 w8 W$ T$ C, t2 o我的问题是,在每个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中的数值,不知道会不会有什么不妥。% `: |* X" ~/ h

: p4 W/ s# a( ?9 A) {begin P_read arriving# N2 {3 S9 q% ]2 v( B
    while 1=1 do begin
7 C& O( w7 n. U% i+ y, x        read A_tote from "data.txt" with delimiter "\n"
) D7 g3 j! N5 J$ ^( e% G! J        read A_time from "data.txt" with delimiter "\n"/ ~. @3 U+ `9 r; u" N( O9 u( F) s5 t
        read A_leave from "data.txt" with delimiter "\n") N1 g2 l0 s, Y
        read A_picks from "data.txt" with delimiter "\n"6 k5 G! u) T9 I5 C, H( N
        set load type to A_tote5 J% g5 U# H0 e  D7 `% m
        if A_tote="tote 1" then set A_induct to 16 U' B9 Y7 Q8 @* m3 M" v
        else if A_tote="tote 2" then set A_induct to 2
7 G( U+ `1 N+ z' W            else set A_induct to 3   
- m' G  _; j. v$ U& C- q( m$ @  A9 K) ~! r        set A_i to 0
: X% r9 Q9 i, r/ Z        clone 1 load to P_induction
  l" d, P6 C, |" C+ n) q        wait for A_time sec9 _7 T& X5 I$ T4 E' r
    end* K: {, F; H. |
end
4 S( J4 k) X; `* b% D# u) i0 H+ ]9 @
begin P_induction arriving
$ a4 V# n" W( x$ V# r( Y* }    if A_induct=1 then clone 1 load to P_pick19 p% v5 P: V8 b7 T/ @9 t3 y" R; R
    else if A_induct=2 then clone 1 load to P_pick2
6 x/ b( P3 m6 z# |" s        else clone 1 load to P_pick3
  H' p6 v! a$ a1 f+ Uend# f/ N# z. p0 g$ R4 m2 {

5 T3 R- m, t( C6 H0 qbegin P_pick1 arriving) u1 S. Z) \4 f' ?
    set A_i to 1% o- c# h8 N4 a0 x  g
    move into Q_induct1
% P' R, ^# T# W    move into pickaisle.induct1
. k0 s0 I1 c5 v" w$ ]( J' S" W7 N    while A_i<=30 do begin! K0 M" E* \1 U9 P6 n5 V
        travel to pickaisle.con(A_i)
5 l' ]# ~+ U" D5 o# ^- K, N, \/ J2 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ^5 e5 g& g  L; U        else wait for 10 sec7 e9 n9 _: K0 C  |$ o1 V3 k
        if A_i=A_leave then send to die5 r9 W) f! {# @& s/ P+ W. e" L
        else inc A_i by 1- j3 h9 S  a  P4 N
    end/ z4 O4 q6 ?5 v- h+ V# e
end
! y9 O) s" @7 b) @1 o8 Z! r$ i& M2 n& r! R  Z- p8 a
begin P_pick2 arriving% O( \. B3 Q  \' x$ W) i7 K8 B
    set A_i to 112 @* y1 x- [" h8 Q% n3 h8 ]" j4 W
    move into Q_induct29 k( L# {. `. ~; r3 R
    move into pickaisle.induct2
* Y, d2 D7 |" n% F/ o/ _    while A_i<=30 do begin' y& l: W. [& v; m
        travel to pickaisle.con(A_i)
. n' \' v2 P* j2 @0 L8 D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' {' p7 X$ g& Y0 X
        else wait for 10 sec
; d" w0 G# a9 f) h, e" J; u        if A_i=A_leave then send to die- V* E6 K+ F$ k7 }1 M: H4 E/ R8 m
        else inc A_i by 1
2 Q$ V( q3 h( e  T) J    end9 L# d& t% U  u0 W# [& L  P3 g
end
* Y$ D' J9 W7 I* z8 q& z9 B
8 q" k$ [; U0 `# R' n* sbegin P_pick3 arriving" M2 n1 ?9 n) M" j2 U7 u
    set A_i to 21
7 s% o9 x, c1 z0 X    move into Q_induct3" w6 ~8 m3 J+ k! C  c
    move into pickaisle.induct3
# e' x7 S( V: C  u7 ?# R4 i    while A_i<=30 do begin* n+ v- g% P# y% |# a7 U9 T+ U. U! E
        travel to pickaisle.con(A_i)
8 o9 [  W* k) u$ I  z3 ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 n1 A+ i- y8 `' o' j' W0 W4 b        else wait for 10 sec6 a4 w: P/ E7 e3 f$ E& J" @
        if A_i=A_leave then send to die5 u" @! r* c) a& W2 }; M- ]& e
        else inc A_i by 1
4 z1 u  ?" w- L  |' R" V    end
, q' ~& `! u) X; d- hend

最佳答案

查看完整内容

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是个什么东东?
: I2 ?7 P  G. `: o6 V2 rmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) O! K" Q0 C( Z$ M5 N$ `/ H
* I3 V/ x5 g9 P' C- mAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ p% [* R. f* @% O! M# f$ J
( Z. \8 j5 w1 }8 y4 u' S0 H! T8 C3 ]另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 B" J% ~2 u+ [2 w4 y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 t# l2 p' c* i5 P& h- c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ l, ^  ?  Z1 {- e3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  D+ u% c) g+ j" Rbegin P_induction arriving7 M. k8 |7 Y: Y) N& j/ I
    clone 1 load to P_pick(A_induct)
! u- x/ E3 q1 Qend最大的系
  S! K! a; u9 Y
2 Q0 f0 p, B, Jbegin P_pick arriving
& }8 r" P. e. o3 @3 q    set A_i to procindex * 10 + 19 L, n% G% I1 ~! K' n9 ~
    move into Q_induct(procindex)
8 _" k! G& \7 D) m# x/ }    move into pickaisle.induct(procindex)( I" z* H- v% l8 x" p, r4 N
    /*check the type of pickaisle.induct(i), for your last problem.*/
" g# i3 d# Q6 O( ^! ]" {% h2 Z: N# i% l: @7 O
    while A_i<=30 do begin
/ m/ j/ d. r! s  `5 {        travel to pickaisle.con(A_i)6 k" {+ a* J* D. v6 Y1 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 ^* N4 j4 k) J2 |6 V        else wait for 10 sec
8 O1 l0 o* J7 _/ f) X9 o. f: Y. B1 j        if A_i=A_leave then send to die: F2 d* Z+ R0 Q4 j
        else inc A_i by 1# ~4 p/ J, k* b. r) c3 T6 c
    end
( Y# t2 \: \7 H; g, |$ u0 {. iend+ N& S( C( H3 l7 L( Y. w. Q
5 h+ D' t, j- r5 P/ N* B$ t& A6 k# s
其中的procindex为整形,代表当前process的序号。
  V  _8 U: W3 Q: tstation和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-2 00:00 , Processed in 0.019668 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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