设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11589|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 n6 `9 L$ L- m! a/ X1 C: y' m& B
我的问题是,在每个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中的数值,不知道会不会有什么不妥。& E) x4 E- V+ ]/ x, z1 H5 I; l2 K

7 q2 p9 [! l, b' C1 W. G6 U8 \begin P_read arriving) I# m$ j4 x) L; l
    while 1=1 do begin! m* U3 J8 j+ D6 j3 f/ p1 T+ ~
        read A_tote from "data.txt" with delimiter "\n"+ r# V! U- {, O+ ~9 m" x) S& s
        read A_time from "data.txt" with delimiter "\n"( V7 M% b3 [0 a, `, K4 C1 J# Z; J
        read A_leave from "data.txt" with delimiter "\n"
6 ^, q& n3 w' v        read A_picks from "data.txt" with delimiter "\n"
/ k$ D3 J/ R6 R6 \+ h! P% J        set load type to A_tote! v3 ]& h6 [0 E! j& |8 K
        if A_tote="tote 1" then set A_induct to 1
- n+ o& J0 D! P( m. A% k8 a& s3 G  g        else if A_tote="tote 2" then set A_induct to 2
& j8 o( Z4 O, E            else set A_induct to 3    ! K5 S% a3 a! A; G. f% W
        set A_i to 0
3 A' I+ }0 Y: q& w4 X$ M        clone 1 load to P_induction
6 y7 O+ d. F6 _$ F7 h, b1 S3 Z        wait for A_time sec$ j5 I- x' I3 _2 B& f8 l) E5 l
    end2 C4 `, D' V! [* [: U9 s
end
8 q* s* o% r: f) X4 h+ b) `
6 j: b! |! x' Fbegin P_induction arriving0 D  y" r, B: v6 y& w1 X, c
    if A_induct=1 then clone 1 load to P_pick1
  |; r1 s# F7 `! A# j" z- ^& o    else if A_induct=2 then clone 1 load to P_pick2* _' w9 c4 }, D$ Y1 h0 ]- ~
        else clone 1 load to P_pick33 g5 C8 m4 L* ]. M3 i
end
) v: `; ^( Y: [+ t0 [# G- T1 X& N
& D" ~# G% B4 Obegin P_pick1 arriving. V5 m" H& {- R, W4 R
    set A_i to 1" P/ I) ?! }' {# P+ R. u) x4 \
    move into Q_induct1# P' H# h  m$ c! `% {( K; D
    move into pickaisle.induct13 P* v  F  B- O; a" @" e
    while A_i<=30 do begin
; H8 O1 Q( O1 F5 [        travel to pickaisle.con(A_i)' d; l9 p) R) v1 f+ m; a4 e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 W# W" w- {4 I* l5 m1 W1 Q        else wait for 10 sec+ m" \" d0 \# m
        if A_i=A_leave then send to die+ a" v. h9 V2 K- [! `& Q
        else inc A_i by 1
6 F, c4 y, F& j7 b# t    end
  ?0 Y' o8 l" h* L/ }end
, e: N7 [- q& H! B% U' e' v0 m7 k5 q6 I4 y7 T
begin P_pick2 arriving. X9 X/ t6 h% p+ i, B8 y
    set A_i to 11; v) k$ U* s- A4 s" |1 M7 }
    move into Q_induct2
7 V, R! L  |6 p% X    move into pickaisle.induct2
) @; {4 l1 K) J. g; X) |6 |    while A_i<=30 do begin
% \) m- g" z( R; T* U9 c8 U" i        travel to pickaisle.con(A_i)
& l0 Z( b; c, _2 G5 Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& O6 b1 d% b2 B) S; e% k        else wait for 10 sec
) A# P7 h1 K8 j" ~! E& L        if A_i=A_leave then send to die( e. S' Y2 v& |/ R, G% i1 x
        else inc A_i by 1, e! B1 V5 v2 x1 k: h
    end( D( G  [4 V0 z/ c& U) g
end8 V2 l+ e; \! T6 a4 ?3 @2 ^' v& q
8 A' v& V5 I4 ?0 y/ n. b9 R$ |
begin P_pick3 arriving
0 R) _3 K7 q5 H) Z    set A_i to 21+ t. E" X; o# X1 K1 Z
    move into Q_induct33 c1 p) f: ?- D$ W2 Y3 b5 j2 f
    move into pickaisle.induct3
- c6 ]7 g# f4 N* Y$ H    while A_i<=30 do begin  o0 C2 e+ E$ Y1 O6 d
        travel to pickaisle.con(A_i)/ l; S7 d1 p2 F( G5 E& n: Q  T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: N/ M: i/ a! G' e+ P        else wait for 10 sec0 S7 e" h2 {4 F9 G5 w0 r5 ], h
        if A_i=A_leave then send to die
) S8 d7 L6 }  D- O5 B3 ], C        else inc A_i by 1
% v! i2 t1 ^) x6 J    end, h0 h# \8 }( t( w; e$ ~) d
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是个什么东东?
* j! D+ q: i1 I" lmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% e, u! V- p( D% \2 i- m& I! l: z% R
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* a' k+ K0 r  g( R, I& N

, z  V% e4 {$ }: P4 ]5 ?另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" \4 C; j1 y7 G8 p0 Y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 P& R' v0 z+ o$ p0 \, c8 h+ l$ x2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
1 J4 ~& r! _" m4 [+ n3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ \! I- \8 x0 N" Y* p' z
begin P_induction arriving
' }0 }% |# d! b& u8 p1 ?6 e    clone 1 load to P_pick(A_induct)
1 P. P2 d" K# J% x3 N& k& Pend最大的系
9 `4 U7 A/ @2 Z0 H2 \: i" M) x: Z% h
begin P_pick arriving
% W$ k: f) }( D- i* T    set A_i to procindex * 10 + 1
% ]9 ^+ e: z/ T! V5 S$ I    move into Q_induct(procindex)* E& ?% Z3 d# k$ K* {" o8 \
    move into pickaisle.induct(procindex)
  a5 `4 N7 o; Y    /*check the type of pickaisle.induct(i), for your last problem.*/: m! `) W4 M" ~2 C+ {3 v* Z7 D
* y/ f, x7 {% _2 H% ~7 u
    while A_i<=30 do begin
! G9 ?" I' n0 e2 F$ N+ q" I6 U* i        travel to pickaisle.con(A_i)
; h! z) D% n# \! j; t5 L1 S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 s, t8 R. v+ Y; J3 E' j
        else wait for 10 sec1 |9 D9 p  `' u' _/ p5 i
        if A_i=A_leave then send to die
  l1 K/ z1 S7 N  l1 ?        else inc A_i by 1! F, Y2 p, m% l9 i& j1 `
    end6 }6 a3 }0 U: x, e' v/ T
end# K$ x5 I7 a, w; _

9 j+ ~- g1 l6 }7 z. C2 r其中的procindex为整形,代表当前process的序号。. M# d, A; j8 Y: E
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, 2025-11-22 09:51 , Processed in 0.018973 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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