设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14040|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) d" t& ?* z% K4 [) Z
- l* E/ i$ D) p5 n+ U* S: G' Q0 a' 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中的数值,不知道会不会有什么不妥。
$ R1 P( F( R. V$ T8 l# w* l* P% x% c; h$ Y
begin P_read arriving: R$ t" l" i: ]3 b' X9 \* z8 d( e; b
    while 1=1 do begin
% k0 l$ w& O9 x0 L& `        read A_tote from "data.txt" with delimiter "\n"& P9 J: @6 s* V0 F  s- }
        read A_time from "data.txt" with delimiter "\n"
9 C( c  N5 r$ G  c        read A_leave from "data.txt" with delimiter "\n"& s, U' ~( |" ]
        read A_picks from "data.txt" with delimiter "\n"; ^! M. }1 L4 p& u4 G7 t# f
        set load type to A_tote
6 L' M; m, C' X9 {' v% H0 g2 D        if A_tote="tote 1" then set A_induct to 17 Q7 j/ S1 Q* f
        else if A_tote="tote 2" then set A_induct to 21 M4 S& B5 r' t
            else set A_induct to 3    3 s" R  I0 B: `% i
        set A_i to 0
; [' m6 a. n9 X. X        clone 1 load to P_induction1 Y/ _! Q( W4 M) d6 t
        wait for A_time sec
( o$ D! s' @3 W( g7 C' `0 r& `    end$ z+ q8 ]! k0 o: @( {/ e
end
( B/ D1 R5 n* A$ L! h$ a- ~
) U4 `8 u0 x& Nbegin P_induction arriving
& V9 W" C" W) V% B  C0 }& o    if A_induct=1 then clone 1 load to P_pick1
/ c" ?  ~9 Z& l" ?/ h    else if A_induct=2 then clone 1 load to P_pick2; E  w& ]& F8 V' ?) c! g. Y: H4 d+ z3 L
        else clone 1 load to P_pick3
* \# ?2 L% d0 U; A7 y. ?- @- _$ Yend
1 I" F; x! V9 C- ^0 s. _- @- P7 h/ s6 B* ]2 G
begin P_pick1 arriving
- M% s% ?' x% p# `    set A_i to 1
: h( _. |1 @$ ]    move into Q_induct1, _2 c1 H& C: V0 t0 k/ ]# s; r. @
    move into pickaisle.induct16 p: f$ j. _  L% L1 Z# t, w9 K
    while A_i<=30 do begin( y- q2 C- x- N! w( V
        travel to pickaisle.con(A_i)
3 H6 q2 {& i  X+ Q0 _+ o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. g) Q+ H8 Z3 n$ q' I. g1 C
        else wait for 10 sec
, ]. R1 R; P* P/ W, c- l        if A_i=A_leave then send to die; M! |1 f; l4 a1 w" C1 D  e& {  ?9 [
        else inc A_i by 11 T% [5 s$ B, s- }5 w
    end9 ]4 i7 ]  d, L+ A* ]& ^8 n
end* F. X3 \" o- D. p

% _3 {" l. X, K! k7 Z5 ?begin P_pick2 arriving
4 p7 C1 W' o6 u# A8 y9 v/ C  \    set A_i to 112 L( F9 S0 l8 e1 [
    move into Q_induct22 p8 |1 x& X" _0 a. [4 z
    move into pickaisle.induct2) G0 j2 C; y# B; R
    while A_i<=30 do begin3 w0 _' N3 Q1 G
        travel to pickaisle.con(A_i), R2 n5 e; }1 H% k, l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% w4 V; r& [6 q        else wait for 10 sec
2 a7 C4 O  c/ J- e4 a  X1 U0 r# ^- A        if A_i=A_leave then send to die
* g& o; i( B, F0 x3 G( I, x) n        else inc A_i by 1
1 M) G* M1 E$ y& ?0 t    end
0 u, i8 e6 B; T% q7 Iend3 n! j' A1 i. I$ O$ s' ]

$ z% ~" E" ^2 ]8 z, Q+ q8 v& Wbegin P_pick3 arriving+ h* h$ B. T& [& ], @
    set A_i to 21
( O, s6 R5 [- ^3 S    move into Q_induct3' e% ^3 W1 O$ \) S' _# L7 q9 F. _
    move into pickaisle.induct3
" e- n- p5 D$ n. ]: m    while A_i<=30 do begin  B$ k3 M$ j  Y5 {
        travel to pickaisle.con(A_i)/ Y4 S9 z8 b" J; f" X0 ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# C2 Q- f; P  ^1 ^! \1 Z        else wait for 10 sec
# A9 p& r9 J5 P& F        if A_i=A_leave then send to die
" K# t: H! a# o5 c        else inc A_i by 1$ Z' s6 @, Z) D3 k) n! S# }  f5 V
    end. b0 a' p6 E* X
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是个什么东东?
2 v$ s! m/ k) L( gmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- R4 M& U4 H1 E( \3 D7 R% M0 F4 J" \1 T4 S  u
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ I, h3 }0 u& C5 u" u( w7 P  @1 I) t& G( N5 _$ u8 g- B  N
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 i4 b5 P+ ?' I) G/ B  J$ C1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 E- N0 n# }* E5 J6 ~" a( t: l
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 @6 _+ T/ d# r
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 R- \2 {$ C6 h' v! r$ sbegin P_induction arriving
- J$ V* q* n: W  h, C+ w    clone 1 load to P_pick(A_induct)
) g: Y4 E  W, H* W: v8 Hend最大的系* O: U+ I+ b3 r& I1 i
5 b7 h  Q$ s2 f9 A7 P  v& X
begin P_pick arriving7 j( B! V9 C. r% w! ]# [
    set A_i to procindex * 10 + 1
% D, i3 Y! S, Y0 T0 F: R    move into Q_induct(procindex)
0 D0 K, Q5 @/ Q    move into pickaisle.induct(procindex)
6 u! @" a& }$ r    /*check the type of pickaisle.induct(i), for your last problem.*/' D6 P: Y1 H' @( d: D5 V' q

; K/ O. o- h* G* l" v5 W4 ~# ]9 F  s    while A_i<=30 do begin
+ B* T. D: N5 B6 _6 G% W5 z) Z        travel to pickaisle.con(A_i): O; s  J8 z+ X+ N# l6 g/ B# g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' f/ @, p2 |+ G" v/ a. }; O8 Z7 j
        else wait for 10 sec
5 t5 O' s3 M5 S* P3 K" Y6 ~        if A_i=A_leave then send to die! R" i8 r* t5 n  L! U
        else inc A_i by 12 s$ B4 ]4 h% S2 q. t
    end
8 E( _4 x6 B1 I7 C, Z  k! E4 oend
, K+ m% t/ p2 [5 I5 X# e8 Q% i7 g
- t6 K; F9 [; o* w: h6 H其中的procindex为整形,代表当前process的序号。
7 L; b' P, J2 m: T; 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-6-2 08:58 , Processed in 0.016655 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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