设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14628|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( h* S1 i' R  ^% {/ S! `" t4 i& l
7 Q8 u' {' J, G# x0 Q5 Y, x( |" Y我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 N7 k6 @$ w3 S4 R: J* F/ ]2 P

6 `$ h9 \+ L& V; p# h- g8 |' ~; `begin P_read arriving& T8 ?. I5 ?4 |
    while 1=1 do begin
3 y8 `. E0 p( A; ~        read A_tote from "data.txt" with delimiter "\n"9 H; I8 E# O" A6 M
        read A_time from "data.txt" with delimiter "\n"
3 F" Y4 l7 c1 \        read A_leave from "data.txt" with delimiter "\n"
3 ~, k7 l' y# x" X        read A_picks from "data.txt" with delimiter "\n", v# {' y! H7 u1 f( _
        set load type to A_tote$ v7 U" c/ q4 `) r  E' B
        if A_tote="tote 1" then set A_induct to 1
* p8 [/ i  G2 g; }6 o" Z        else if A_tote="tote 2" then set A_induct to 2
' k3 p( _4 o6 _. x1 z, Y  c3 q4 o            else set A_induct to 3   
& b$ G% E/ P( [1 F& X        set A_i to 0& p7 T/ T9 N# o  k/ J/ j! h) @
        clone 1 load to P_induction
; I* h9 R* Q  y2 |% H# M2 Q( h# S; W        wait for A_time sec5 T0 r. u: ~8 c$ y( ?
    end
" V5 `6 N$ Q: f1 s% Aend; M% m/ K4 W. Q3 b0 D' g: I' O
) X! H: Y) z0 I
begin P_induction arriving
3 R8 f9 q) u: r, x    if A_induct=1 then clone 1 load to P_pick15 P) V% I. Z" Q5 a7 }
    else if A_induct=2 then clone 1 load to P_pick2( e) w8 t3 u9 _4 l+ V
        else clone 1 load to P_pick3
7 G; k  N% ^# U" Q; j1 @; u( n5 Dend
/ K! N; ?9 o5 Y9 ^! q* z! Y7 e
& m% w  q+ C! Y  H0 ?begin P_pick1 arriving
" T; p! u% R) P# ^/ w    set A_i to 17 c, u6 G7 v# J0 |7 L0 J
    move into Q_induct1) V) f0 r* t( M
    move into pickaisle.induct1# a$ y; ^  P, B: ]% g
    while A_i<=30 do begin8 V1 {: @! g; C
        travel to pickaisle.con(A_i)
! s/ w& D' T3 A$ S2 T6 P+ n3 o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% Y3 H" o$ V% o$ O2 Y5 Y        else wait for 10 sec
% D& _" q3 T. `9 C" T        if A_i=A_leave then send to die
% B3 {8 {- f" u& H4 V        else inc A_i by 13 ^$ I0 \" X/ b6 _  \
    end1 h  v  B* I5 v; J
end& I4 R) T  I7 `4 B, q3 q

) b' L) K) [4 o% _begin P_pick2 arriving
% m  ^0 Q$ Q9 n1 b. }& ~    set A_i to 11
( \7 I3 F  Y$ O# ?8 y    move into Q_induct2* W  K3 T3 [8 j2 w* E  h5 n! q/ U1 {' r
    move into pickaisle.induct28 v8 w) Z: {9 U& o1 @0 ]
    while A_i<=30 do begin; v/ ?  u+ w  W% s
        travel to pickaisle.con(A_i)
7 l" J8 F0 s# L' _" {$ l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. h' k$ Z  R- j: L# V
        else wait for 10 sec3 ?7 O$ t/ b+ [: P( |& p: J- i; L
        if A_i=A_leave then send to die
" ?) k5 h: _' E' Y1 V% f2 ?        else inc A_i by 1
) Z; x) h$ u" ~& `8 P) }2 s% s7 O7 }    end8 H( `" y! x/ }1 }/ X
end; `+ K* ?8 T2 b4 |2 i- N

1 I" ?: l* e- {- R- Ibegin P_pick3 arriving
" N# c7 p2 G3 e3 \! N0 Z    set A_i to 210 J. A  Y0 a% ^; k: h5 L
    move into Q_induct3
- _( @2 B0 h& ]( A, m    move into pickaisle.induct3
0 f) r2 L* S. i5 {    while A_i<=30 do begin9 t# E- e7 z7 A1 o/ p/ E7 \* l9 ?2 a
        travel to pickaisle.con(A_i)
8 Q& i4 g/ j* _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% b1 ]' I3 W. c3 [- S
        else wait for 10 sec
% [9 u, X2 l5 g/ @        if A_i=A_leave then send to die5 V% U' ~+ d/ [) U
        else inc A_i by 1- s& s, I0 B/ G, D( H- i" u, y! M
    end2 P1 R" S* h3 d7 S- O
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是个什么东东?$ c" o2 a' L: w( }* o& O% S  E
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
2 h. i: g9 S9 P- {4 |" d
2 D4 G, c& q4 _! AAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 R3 m6 {; X5 K" h6 `$ k: d
2 |8 I) \! S2 l  P: Y+ e: W( }4 s另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 {1 n" c, M0 f$ o" \4 _1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 r$ E& [* W. y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( j9 Z6 k8 f& A! S( S3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& t7 ?% z7 \+ U/ c, T) ^
begin P_induction arriving
8 M, H4 ~% x/ f; G' k% {# C    clone 1 load to P_pick(A_induct)- ]2 T8 M& W: W% e
end最大的系- N* j' f* t3 C. Y1 w6 ?6 e

% V& H( @  B, J$ p: S% Mbegin P_pick arriving
2 p5 h9 d0 h  N6 K4 j; |0 U    set A_i to procindex * 10 + 1: E# j0 U  Z5 ~( k
    move into Q_induct(procindex), _) j& x+ b9 `$ c' b
    move into pickaisle.induct(procindex)+ t3 \- V5 u" _, F
    /*check the type of pickaisle.induct(i), for your last problem.*/
! O* n" [  n3 K' q! H2 D. n
/ E2 @9 `5 D' u7 |    while A_i<=30 do begin
$ ~. x" K0 |: v( N' [/ e3 O; @        travel to pickaisle.con(A_i)
  [/ \5 J7 K+ G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: `3 w" b4 n+ B! A( D8 K- b1 i6 f
        else wait for 10 sec* d6 N% W& Q% `# U- J
        if A_i=A_leave then send to die% j% e" y; ~2 |0 V- T  r7 Y$ I
        else inc A_i by 1( ^% g9 h% z! i1 s( c, {4 L
    end, T% {" R* d/ }) P+ R& w# |( K( ^
end, H1 B4 U4 T: B+ u) R3 b) a( _

3 r% ?. ?$ H0 f其中的procindex为整形,代表当前process的序号。8 w% V$ J4 o$ l% B
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-7-18 23:22 , Processed in 0.016302 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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