设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13937|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# c5 {# `0 p& n& P7 s8 H) c& k* A' v
6 G, }0 E# M2 j
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: B3 s6 `8 v9 M9 b
/ J, L$ l; f% S+ d! H: `$ n  ?- Qbegin P_read arriving
- B0 @% p; s1 G) y' e    while 1=1 do begin
7 v8 Z/ l4 x3 [$ E' m' L* A# h9 f/ F        read A_tote from "data.txt" with delimiter "\n"
) r' p# _( M  |; E2 |        read A_time from "data.txt" with delimiter "\n"% O, U3 \7 S+ A- G8 j. C' T
        read A_leave from "data.txt" with delimiter "\n"
6 Q( n: T$ X% N" u        read A_picks from "data.txt" with delimiter "\n"
# R; }* O$ `, r' A; m+ r3 p1 J8 g        set load type to A_tote
3 A8 J7 a& Y0 t0 `1 ~! g        if A_tote="tote 1" then set A_induct to 1. o( e& s; X1 o. D0 m
        else if A_tote="tote 2" then set A_induct to 2
  Z5 z6 Q1 U5 s            else set A_induct to 3   
! H% I5 o! Z4 Y0 x+ ]        set A_i to 0  _) x% p0 l. V8 C/ [$ m
        clone 1 load to P_induction
, G1 T% f* _& C4 y        wait for A_time sec6 H+ t. B2 R+ \  h* b
    end
" s3 I, k4 r6 kend8 x8 \& E4 D. r4 o

- i7 T# j+ K* Y: X) ?( l$ f4 F5 bbegin P_induction arriving- d; o2 s9 S$ g2 Q* D( d6 d
    if A_induct=1 then clone 1 load to P_pick15 W5 G4 i. V% A' b/ U& u
    else if A_induct=2 then clone 1 load to P_pick2
; `  }! y* ]) Q/ F- S9 `        else clone 1 load to P_pick3) H6 s1 j/ G  C' u* m' e
end0 [  ?4 l: }: m2 V
! I+ ]. H0 T( M& [5 O; N1 s8 P3 P
begin P_pick1 arriving
0 T7 l& @; B% N5 K) G- n! B. M    set A_i to 1( D; K8 n# T4 P4 P/ ^. h3 e7 T
    move into Q_induct1
" |: N1 p  F( B# M    move into pickaisle.induct1
$ R3 h! |, Z2 _) e; `7 v1 R    while A_i<=30 do begin- s/ m. g1 D9 x
        travel to pickaisle.con(A_i)
  \$ n$ P8 f& A4 s" |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. n* \8 O% e' K$ n' _9 h! H# ^' ]        else wait for 10 sec
9 F/ s$ D6 x( V; R; C6 s$ w        if A_i=A_leave then send to die
/ P0 i# q% U7 @- O/ ?. }0 e0 N) l$ Q' o        else inc A_i by 1
0 T: `5 s1 h; p: l& f- i    end
) C) ?, X/ M3 i4 [end  q5 e! C% S5 O# N+ Z( \9 F

/ C" V) i+ d  ?begin P_pick2 arriving+ M( k7 F% V$ M5 c0 }; a
    set A_i to 11, }' w) e# w  f3 H0 M1 _8 D& f% W
    move into Q_induct2
" w. m  \% L- l# ^. t5 }0 ^    move into pickaisle.induct2, b5 r  D) t4 I9 K
    while A_i<=30 do begin
* o$ `+ p/ d0 V        travel to pickaisle.con(A_i)
, X: ?+ C5 U) G1 T) H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. b6 c/ g. `  S- t; ], I
        else wait for 10 sec- r# c( R( ?- t, {6 i
        if A_i=A_leave then send to die
  u: a% C  [) m* z* P+ F5 U        else inc A_i by 1
/ [8 D7 O) \( h: k' _    end
5 Q, X- ]4 v6 x9 s6 g" {end
0 \+ u6 O2 s+ K  J1 l, v) D+ [- y# ]7 e6 I- D- B
begin P_pick3 arriving0 H- l" V6 d5 u+ z3 A+ V/ ^# |$ D3 k
    set A_i to 21
1 g9 R( e' O' B% X. i! D. D, Y2 r7 g9 R+ I    move into Q_induct3
' Z' {7 d3 N6 Q$ s# y    move into pickaisle.induct33 N- ]0 N; S& P( X) q$ ]! p9 S
    while A_i<=30 do begin
  P" o4 M9 Z+ T1 c" H% l        travel to pickaisle.con(A_i)
7 i5 \# D0 I5 {% B3 f7 y" \1 U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 B7 s- [& X8 }( E& J" u1 ]
        else wait for 10 sec
, W1 c* X% K7 B7 z8 V7 t7 f        if A_i=A_leave then send to die
- C; M( n" Z$ z" [" A        else inc A_i by 1
# k2 w1 F% I( e4 r    end( v2 \  I+ X/ T; |: g
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是个什么东东?
6 {2 R6 {$ A  S& hmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 U" @9 p) p2 P9 I7 r
# M9 R! m0 t( U% C% LAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 h- r% V# g% g! r& d; v3 A$ Q% t) n( l: ?' [* w7 h( w
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" K4 i9 t5 ~" V1 B1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 u+ O: y, e6 m% b, T
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; U8 c% ?; ^' _1 S; Q4 I% H
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; `: Q9 c8 n  T# d9 Lbegin P_induction arriving; J+ E# }1 c$ }% `$ V4 {7 q5 W* m
    clone 1 load to P_pick(A_induct)
' [  h; F8 q+ B' J9 F, r+ Nend最大的系
: V, [6 l/ j9 ~  s! d/ L* O8 J6 ?" W" G2 O% ~! p3 _$ V% b
begin P_pick arriving5 j4 E2 r0 H: @6 `* X& y
    set A_i to procindex * 10 + 1% u3 ~6 h$ G: A
    move into Q_induct(procindex)' ^  `8 R' w0 b9 a; }
    move into pickaisle.induct(procindex)7 w' O+ |8 G& B1 e: L8 G5 [
    /*check the type of pickaisle.induct(i), for your last problem.*/
& Q; E* v: ~; d) i% O. _" K5 y2 F+ |5 b' g
    while A_i<=30 do begin
4 X+ z# Q/ f" C* G' X# t1 P9 F        travel to pickaisle.con(A_i)7 @6 w/ V& [; h# U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( V% K3 B8 v% V* }
        else wait for 10 sec
0 A5 [. t# G  G! V+ _, R        if A_i=A_leave then send to die" v. Y# a, k: ^
        else inc A_i by 1# ~7 W, a, [& S" S9 U& f- t( @6 Y
    end
% C* Y5 p& q" C; c: D. o6 Xend
7 A( ?+ w2 q7 S! l$ `* Q' a3 e3 r8 g( f: @' c7 A+ A; H3 q
其中的procindex为整形,代表当前process的序号。& e) w/ H/ ~; S% X# v* h& b7 q  d
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-21 06:45 , Processed in 0.020270 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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