设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13663|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 F' `" g0 ^8 K, K
0 G4 A& W3 ~3 s我的问题是,在每个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( F/ D6 c/ O0 P% |1 m# j( y$ _* Q! }; N
begin P_read arriving
  {( K4 q4 N5 h; o    while 1=1 do begin
/ F4 c" `$ Y  f        read A_tote from "data.txt" with delimiter "\n"
: ^  F$ e7 p% ?- h- v) [        read A_time from "data.txt" with delimiter "\n"2 @7 q. i: U7 P5 I# h* D1 l
        read A_leave from "data.txt" with delimiter "\n"5 Z6 @4 Z; K+ \3 K- U9 [
        read A_picks from "data.txt" with delimiter "\n"2 l8 v4 ^4 ^* ~- X4 E
        set load type to A_tote% x7 V  ~! c" v" b9 y' n9 }$ N
        if A_tote="tote 1" then set A_induct to 1
& j3 N; d8 c& I+ ?* d        else if A_tote="tote 2" then set A_induct to 2
" D: F& U  h1 R) v; Z0 y! `7 p            else set A_induct to 3    # X; E% |8 ~. R% M9 A$ x& [
        set A_i to 0
# i: V1 u& b+ `% I+ R+ m# L( T        clone 1 load to P_induction( p$ x9 ~' o: {) y" c4 y  k
        wait for A_time sec2 B# ^9 l3 N7 V9 Y( _) p# T  g
    end/ q9 z: o. K* R
end
9 @0 u: j& v8 M$ h, X. ?( N
# f0 o/ m6 a  ~begin P_induction arriving! i8 m) \7 |! f' E
    if A_induct=1 then clone 1 load to P_pick1/ G' _. y: a7 L/ m
    else if A_induct=2 then clone 1 load to P_pick2+ w6 ~2 a+ C7 ^2 _3 Y: `+ m- a  ~2 `
        else clone 1 load to P_pick3
" _- x3 b! ]2 Nend
. c7 l/ x. C+ U4 ~6 _* [  U1 J* x/ A# }% w. `# L4 ~. \# A7 }% g
begin P_pick1 arriving
% a  w, j) E5 y& k* J    set A_i to 1- M7 J0 e- f: N
    move into Q_induct1
5 s; B" ~7 ^9 w) ~/ y' {    move into pickaisle.induct18 i, E# h0 L, a4 M7 K( o, }0 j: I1 @) E
    while A_i<=30 do begin# d& [( {$ [0 |& K2 r4 y' c; d4 z
        travel to pickaisle.con(A_i)
: t" I3 p( C+ {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ ?1 v6 Q; {8 S  U. b3 O) W        else wait for 10 sec. U+ L4 _" |* @) D
        if A_i=A_leave then send to die+ P/ h+ Q2 A" E8 Z  C  a
        else inc A_i by 18 I5 a" P; n6 `8 u1 W
    end
4 f# h! v3 A/ jend* d8 Q+ G* A) L' }  l
9 \- `5 M  H( ^; ?/ b  y
begin P_pick2 arriving% V! _5 E7 D7 `$ A) }$ |
    set A_i to 11  U1 U- G. _2 [2 B0 b0 a+ l) O
    move into Q_induct2
$ D0 F# z8 p, _: U: K    move into pickaisle.induct2# u8 z; U  z: T/ f7 O  L8 Y
    while A_i<=30 do begin
+ r( T, [% {8 b- Z  T/ X: _* N        travel to pickaisle.con(A_i)1 X% S& c) W! j1 {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ L1 C% ^( Q- f$ O" W( D7 |
        else wait for 10 sec
7 R& c0 @- ^$ A7 L0 X2 |9 d  a: Q4 F        if A_i=A_leave then send to die
# R; ]9 _: r+ U        else inc A_i by 1
% }( m) @5 u3 Y4 ~+ i    end
2 N; ]/ b" a/ J. l8 aend+ O$ n7 g2 X  c8 o7 N
1 H+ U7 n: m8 b7 P( |2 E
begin P_pick3 arriving: Y" |, Q( p/ n! Q. O
    set A_i to 21) ^* M' L  [7 y, C8 {8 g6 N$ V
    move into Q_induct3
7 l& e9 H* Q) ?9 A) N* Q  e* w& [% ]    move into pickaisle.induct3  z% _5 p) N; c3 }6 f- w
    while A_i<=30 do begin+ v& F; q6 i, L0 Y
        travel to pickaisle.con(A_i)
, q7 ^6 N- Y- }$ O( V4 x6 N$ \4 c! ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* }- Q6 x; Q( h( E$ f( |& y        else wait for 10 sec! W/ O. y" Z& L: q9 D* M5 D
        if A_i=A_leave then send to die
7 a$ h# _# U' F% G% w8 p        else inc A_i by 1
9 Y4 i7 K. y' L. Y- {, R    end1 E5 M5 f, Z  U; e+ B! U* k
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是个什么东东?
8 @+ Q( d7 i: ^4 Z9 A: Y" ~move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  I4 n' I/ q2 ~$ v7 K
# p3 D" a0 G/ ?9 vAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 V3 f2 D* k. q7 f% i2 Y: a' H5 v2 L) _7 A( I) w+ ]
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ Q7 P% [0 r% e. o4 }+ f1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" g& Z9 M/ X' C' |) E- M3 U' v. z2 R2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 _! `+ w5 _+ q. m  H& b% s
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 ]" Q9 o( b% q4 x
begin P_induction arriving% {+ m# b3 K) {  a, A
    clone 1 load to P_pick(A_induct)& V0 n$ G8 q! `! k- I+ S% t
end最大的系
% y% [8 T3 q1 j5 x' m: R
) r+ I2 D7 i% Y, s7 f0 Cbegin P_pick arriving8 ]0 z% r( n; {5 {
    set A_i to procindex * 10 + 1. k/ m7 z# I% P: h* u
    move into Q_induct(procindex)
3 D- z* o6 Y( L+ t; i    move into pickaisle.induct(procindex)) ~) V$ z5 U+ Y
    /*check the type of pickaisle.induct(i), for your last problem.*/6 D  ?. [# f" K
$ P* ]& A( y9 H  O' u0 `
    while A_i<=30 do begin, G" D$ s, q, N; X/ ?- {
        travel to pickaisle.con(A_i)  E# o4 j' \/ L. Y! ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ d2 V: P: h7 g( p' k& n+ h
        else wait for 10 sec
3 d. F0 u: A/ O( ~8 S. }        if A_i=A_leave then send to die3 R3 ]1 ~; g8 Z5 j# P% A" d
        else inc A_i by 1
9 l, H# L: g7 k    end- F$ z" u) F1 e
end/ m' w# o7 r! N* E1 ?) f- h
% Q! k, M3 w3 A+ D, M
其中的procindex为整形,代表当前process的序号。
$ U3 A% ]' v3 ~5 U8 ustation和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-4-27 13:23 , Processed in 0.021873 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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