设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15237|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: t! n! E$ G6 b0 |+ c5 F  l3 T1 h1 k5 t% ]
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# J5 f6 H7 n/ c8 g6 \3 A. W; ?: H8 s
begin P_read arriving3 H0 G% }5 ]/ m+ ~. ]4 w
    while 1=1 do begin( t. Y) c& \: w
        read A_tote from "data.txt" with delimiter "\n"
- Q: r+ M, w! \& F, k        read A_time from "data.txt" with delimiter "\n"
: G* ]$ U  `- N4 @6 {% o: e        read A_leave from "data.txt" with delimiter "\n"! ^8 c# p5 x% h9 g
        read A_picks from "data.txt" with delimiter "\n"* G+ c8 Z8 i% |6 P  z* {. j: E: t" F
        set load type to A_tote
' e: o( W- Y/ @2 \0 k        if A_tote="tote 1" then set A_induct to 1( R) x2 M' ?4 t* d6 s# V% K; q
        else if A_tote="tote 2" then set A_induct to 2
0 n% f1 F. X# C% T, L( y3 U8 W: d            else set A_induct to 3   
. U  h' g: Y" Z: }        set A_i to 08 G* ^) l# V3 t5 D
        clone 1 load to P_induction/ f. y* L2 E# E4 |+ q
        wait for A_time sec. v3 i$ T" B; w+ u( f* ^- Q
    end; I& ?0 U4 v0 l- Z
end/ ^$ z* b' _& g

( |% t. w/ a! }3 H( w+ h0 F4 G: vbegin P_induction arriving4 i" d9 {5 Z* O
    if A_induct=1 then clone 1 load to P_pick1
, |& d% {) C1 ]    else if A_induct=2 then clone 1 load to P_pick2
5 N5 B1 O! ?' B2 f/ ^        else clone 1 load to P_pick3* ^; E+ t- t" O2 B
end
0 X( p! u( K) [5 o7 i$ v3 K2 @3 i- Q2 q5 z6 l
begin P_pick1 arriving
) B3 A& s. _' x, `* x; _    set A_i to 1
& x0 ?; o$ i: U: a    move into Q_induct1
0 P, r; t. }" }: m    move into pickaisle.induct16 A8 |+ G; l& ~% `8 E& k
    while A_i<=30 do begin
4 V" L0 k* S! b        travel to pickaisle.con(A_i)
# U) V" i; z6 O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* f7 K" f5 t9 ^
        else wait for 10 sec
! C+ h7 l, ?3 ^& r' I        if A_i=A_leave then send to die" Y: ~2 H9 ~1 U; Y/ X
        else inc A_i by 1
) b+ Y$ n$ z' K% L4 E4 v, U) ~0 O    end
, F4 z& i# V+ s$ ^6 K. i5 |end
+ d* D& {0 r5 [0 U* q  }9 j& ?4 S  G( x' v- {
begin P_pick2 arriving2 V" K; S/ i/ X7 n* G( h
    set A_i to 11* Y1 y/ Y" a0 c& |, [
    move into Q_induct2' R. y# M# ~) J
    move into pickaisle.induct2
6 ^( Z' Y5 \9 n/ y3 P    while A_i<=30 do begin+ u, Y3 }/ o' i5 n0 A
        travel to pickaisle.con(A_i)
. F7 \4 m6 r# U. g) |8 }1 |+ z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; n- [) S5 ]/ L
        else wait for 10 sec
. {' m/ S7 A" ]3 C        if A_i=A_leave then send to die0 J+ B! F3 W5 p! }- @. c
        else inc A_i by 1+ Q$ d& _# F. |& b/ M; m+ }& r& ~& Z
    end
; |2 b5 Q4 H" a2 \$ L* Tend
& N' I7 N2 N) x2 V- h
; e) o6 _0 M  ?: wbegin P_pick3 arriving
+ N5 |2 k! C5 l# E8 s    set A_i to 21  |- s9 B% c4 v- _$ Q+ S1 P
    move into Q_induct3
* W) e& B1 M" h  [9 Z9 Q" l    move into pickaisle.induct3
3 S7 G4 N2 R$ B# [    while A_i<=30 do begin- M- q& C3 R2 ]6 R* l, K
        travel to pickaisle.con(A_i)5 u$ [& y0 P5 E/ y( ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( v8 \  G# g: V9 @# u! v, b        else wait for 10 sec- j' F) m4 i- V; I& k
        if A_i=A_leave then send to die
6 Z6 F0 f: y+ d, T9 \4 e        else inc A_i by 1
0 x% J* J- _1 y    end
2 Y: ?+ V2 O' y- }7 h3 ]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是个什么东东?
; r6 G: _8 O; w4 B; Gmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- i/ s. R( g) N; b. f

3 i' U7 e" L: v. @AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' v: V. I) ]: P' |% N. W& B
7 [' N/ t  V2 H! h3 X/ o
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ v6 T/ I( x' G' G1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- x; M) v# V# v, N# i1 U* X
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# m; q- G" y) q* Y2 a' W, h3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( v8 K4 u# _5 ?+ m- Jbegin P_induction arriving' j7 z- e- n. e7 y4 A" X
    clone 1 load to P_pick(A_induct)
% F- B% ?; y1 h4 e+ a8 Gend最大的系
2 b! V1 S! n# o$ B% z' V8 y6 ], \' ]' ~
begin P_pick arriving; A, V# x# s( w: D
    set A_i to procindex * 10 + 1
+ u5 }/ F( c) V! o) I    move into Q_induct(procindex)
8 w5 `* c4 x) l! y2 j$ J    move into pickaisle.induct(procindex); y; g  I% R( n. B
    /*check the type of pickaisle.induct(i), for your last problem.*/7 o8 y  ^3 Z' |3 u
& ~" j+ h2 N# S5 I( Y
    while A_i<=30 do begin" `% A% i9 ]. W8 \
        travel to pickaisle.con(A_i)
: L2 T9 n- h; y9 X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. t& V5 N# m( O0 M$ W6 S* h' R
        else wait for 10 sec
& k1 f& d: S" @        if A_i=A_leave then send to die
/ p6 s6 q- Y0 y: p  R        else inc A_i by 19 _; c% I- M# J% d& ^
    end
& d- i& W) I7 {) [8 Uend
# F0 F! ^5 F5 v; ^
: E# X! j+ S0 V其中的procindex为整形,代表当前process的序号。
7 [" K) q$ A0 U/ y# U% o) N- G; Mstation和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-8-26 14:59 , Processed in 0.016786 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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