设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13342|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( P5 x  O7 u2 E' T  N) g
7 Y/ L8 T5 s! k我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ e6 u' ^& b% ?5 v
/ m; C9 @' l# {! V# [/ wbegin P_read arriving/ g* \" D. x, W$ Z0 d
    while 1=1 do begin
7 C0 |5 Y" C) \; G# b        read A_tote from "data.txt" with delimiter "\n"
2 ]6 l# m4 i7 U- ~& i        read A_time from "data.txt" with delimiter "\n"
7 ^! |% N# r( Y+ P- }: U        read A_leave from "data.txt" with delimiter "\n"6 f  N8 `$ l* U/ h, S
        read A_picks from "data.txt" with delimiter "\n"
4 R7 e. z- @$ w        set load type to A_tote
- Z9 |! L, z* [  a& p        if A_tote="tote 1" then set A_induct to 1) U8 H( T1 \+ x2 o# D8 d: n* L
        else if A_tote="tote 2" then set A_induct to 2
0 W5 b" G: @/ o# \  s            else set A_induct to 3    ! C' P) H# T$ H' c
        set A_i to 0/ t# {. H9 a4 f$ j/ Z1 r( [
        clone 1 load to P_induction
6 `* M6 `, s  L+ S9 Q        wait for A_time sec
' q3 \, p7 c2 ~    end
& ~( |; A; e! P0 q% ~end
$ }9 g& C" a# N  R+ Q# o( \( ]  D+ M$ V: ]
begin P_induction arriving
2 Q. H; u( q2 b/ L    if A_induct=1 then clone 1 load to P_pick1
3 _9 m3 h+ h1 ^) K# L  w! H. ?    else if A_induct=2 then clone 1 load to P_pick2
3 h& U$ |6 t/ s# [6 H; z5 A2 W        else clone 1 load to P_pick3
* c! R! M; o' r" ~$ v8 P: w9 tend
2 s& l) k/ T6 h" O( v3 U0 C, t4 P) t
begin P_pick1 arriving$ T( ~- t( U: B5 R/ k! @' n
    set A_i to 1+ J. P0 s( l: [- R8 B8 f3 [
    move into Q_induct1
8 A+ K& X4 F+ |    move into pickaisle.induct1
9 l8 @3 e  b& Y( t    while A_i<=30 do begin
+ \2 G2 f2 t9 g8 g. `& _; ]        travel to pickaisle.con(A_i)
% e& B2 D% U/ f+ k) J6 b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 s* y) S8 k5 G" W! V5 v! B9 x6 x4 j' z        else wait for 10 sec
6 G- v) Z' _& t5 b- h# u- D# H+ l        if A_i=A_leave then send to die# A4 Q. i* L3 c5 {4 q- _% N
        else inc A_i by 12 M1 h) k! Z& k
    end
- v# O6 n! r4 ~6 cend6 g) x+ A8 h1 X4 \
2 @. m# Z' P7 U
begin P_pick2 arriving3 [% J3 V* q7 Z4 B( ?
    set A_i to 11/ y3 ?. q& z  {7 p
    move into Q_induct2
1 ^/ X+ m2 a/ p& n3 Z5 e9 Z6 A    move into pickaisle.induct2# J7 k: E9 K$ C8 [3 v
    while A_i<=30 do begin
9 \( D( d9 L. J: v# J        travel to pickaisle.con(A_i)
. q# ]. O; h2 ?$ _3 ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# y, X+ N5 d% K8 e
        else wait for 10 sec
1 o) ^8 Z+ F- [5 f0 I$ T        if A_i=A_leave then send to die
/ }, ]  i  K; H3 z        else inc A_i by 17 j% i0 U- ]2 k  b
    end/ @5 Y6 q6 w! z) P9 G. N
end1 `! k2 N3 O& r' }7 `& D
$ c* D* d5 K/ g! ~  Z3 y5 ~
begin P_pick3 arriving
& K. G2 ?/ G+ L; R4 D    set A_i to 21) ?: h3 \5 U5 N; R1 F) I* r2 \3 r
    move into Q_induct3
- L$ c' }2 v6 Z1 y# `/ q    move into pickaisle.induct3) C! Z" N1 }" n1 E7 C) Q5 E8 `
    while A_i<=30 do begin
0 I& g3 H8 J0 B  E9 Q        travel to pickaisle.con(A_i)
( `/ A1 V% q) `! `. G% o* Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# D$ A8 a% E4 ?) U0 c9 S; M* Z6 }% X        else wait for 10 sec+ W4 g) u) C2 A/ r+ I  C  u
        if A_i=A_leave then send to die, m+ r, \& T; ^) a6 @3 ~
        else inc A_i by 1
: k( u1 R* C6 t$ ^    end
( V6 z- Q1 G  t/ n8 K2 bend

最佳答案

查看完整内容

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& U: s* {+ u. c0 Z2 o  g( Y9 v) I- A
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ M- y- z, Z# A  K  Z  e! x, S& F( q2 a
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' G2 V, u9 Q1 v9 X

1 S, m1 O% E$ |7 d( L! B另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  k' N& a; r2 _1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) n; e+ D2 B- H9 `9 z! q0 X# V) u1 T
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 G) L7 B: r+ H3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 F' m- Q4 a- u2 }, ^9 `
begin P_induction arriving+ s: {: W% S; \
    clone 1 load to P_pick(A_induct): G, j; }. F7 Q4 Z4 k+ ]; L
end最大的系
3 x: c! ]. t' ]' s
/ B+ N" R  n6 T. P- M" ^begin P_pick arriving! }% c$ h) E5 Y3 u; x
    set A_i to procindex * 10 + 1" u/ }/ i+ G) Y! F$ V9 {
    move into Q_induct(procindex)
- B% f) K3 w& V( u) {. Q    move into pickaisle.induct(procindex)
% d& Q" G* K; x9 t/ e    /*check the type of pickaisle.induct(i), for your last problem.*/
0 {9 ]% |, G) J) @. v% R1 r6 b" e+ ^* Y2 A4 U! f2 @
    while A_i<=30 do begin
1 h2 x$ F( r5 R! [. l5 j2 P. g        travel to pickaisle.con(A_i)2 e- J3 b8 k/ z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 i- d+ X6 ]9 x$ c
        else wait for 10 sec* K8 F0 T3 [8 Y
        if A_i=A_leave then send to die; _; q: x' T( U2 Q* Y3 ?
        else inc A_i by 1
4 Q( e+ U! H7 k+ f' |: E5 G3 @! k2 \: @    end( @  ?3 c9 S- G( p6 S: B- h
end9 }  }: Z1 Q; y9 C) |
. p& ]2 [* V  y2 C9 F
其中的procindex为整形,代表当前process的序号。
5 y1 Y8 {# \$ f) d2 _% s# c2 ostation和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-4-5 19:57 , Processed in 0.022335 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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