设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15504|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! U: s) @( I* P$ A. q& Y" G& A$ h+ d% a+ ?% P
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% C  I$ V+ U+ l8 ^, o: X/ }# \: m
8 q. f9 m0 H4 L0 m# K7 Bbegin P_read arriving, n; P& h% _: A% ], _. A
    while 1=1 do begin
' n3 M; p3 E5 X        read A_tote from "data.txt" with delimiter "\n"
- n7 |) |) U/ i0 v( L  {/ R; U        read A_time from "data.txt" with delimiter "\n"
% I  N% `6 D9 A# d, R        read A_leave from "data.txt" with delimiter "\n"
( @5 t' p; m, f* i( m& B, B4 [        read A_picks from "data.txt" with delimiter "\n"  m# g6 C5 y$ p9 I# v2 O
        set load type to A_tote
& r7 F5 H4 [* j; e2 w2 `7 d        if A_tote="tote 1" then set A_induct to 17 X: w4 X( b: K
        else if A_tote="tote 2" then set A_induct to 2, j% Z% N# V4 M% L0 c
            else set A_induct to 3   
$ n' ]2 B6 p5 U" Q0 t# s        set A_i to 08 m3 N. e5 A: F5 c' ]( v
        clone 1 load to P_induction  M# W) y' ^% T
        wait for A_time sec0 B9 F# s% i/ I& H
    end
5 X; h6 X' C. S% k! T& R! uend6 W* g; S( \2 ]& F. A
2 ]$ |2 n) s9 h" K/ m
begin P_induction arriving" l' m2 H! Q6 s
    if A_induct=1 then clone 1 load to P_pick1
7 s# d$ l/ j5 ?6 _    else if A_induct=2 then clone 1 load to P_pick2
7 N. V6 M! X2 R: O8 @6 D        else clone 1 load to P_pick3
# ?1 B# }' y  A" U1 |5 a3 tend* Q. {" n7 ^" a4 G- G6 s
9 a! W& g" D" U! s: L5 [
begin P_pick1 arriving/ X' Y8 y( g, l) [, i
    set A_i to 19 e3 N1 N/ k' f, T: H1 d6 K- r2 R
    move into Q_induct15 W: {6 N0 L: R) |. i
    move into pickaisle.induct1
+ l) d' d( Q6 L    while A_i<=30 do begin
, H3 {6 J, f* Z; g, s* [        travel to pickaisle.con(A_i)
% D, S* U+ W3 M$ x+ o; G3 J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 i! M# u! R& F2 z- V4 S) C        else wait for 10 sec
; m1 R- E0 o1 ?# M1 b2 V* X$ p        if A_i=A_leave then send to die5 Y# G1 L6 R) t/ @* W2 T
        else inc A_i by 1
4 v7 Z+ ~5 d3 H% X    end
' U6 W' ]- ], @3 X$ qend  N, e% f% g/ R% O+ V; J
/ \: s$ x& J6 v5 s2 s. J
begin P_pick2 arriving& Q4 F& ]3 Y' T) p8 w
    set A_i to 11
% L4 g: u/ h! y$ |* d" H1 q    move into Q_induct2, z4 p+ I! {" u8 Y; k! D
    move into pickaisle.induct28 P( e) S0 x' z
    while A_i<=30 do begin
5 ?8 ~0 Z0 Z# B0 ], p5 r0 [0 o        travel to pickaisle.con(A_i)
; u! S& r- Q9 q) j# t) d2 G* s2 G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% {+ J' k3 D/ c9 i
        else wait for 10 sec' U! W2 |  G/ a9 k. n& |8 a+ |
        if A_i=A_leave then send to die
& n, `0 B4 b8 [6 Y- x0 g0 H        else inc A_i by 19 y6 i% F0 E. }5 t: H8 T; h7 I1 _
    end& w. E+ E! T# y' E4 E7 ~: f, C
end5 a: m. g4 l3 w+ a  t- ^6 [
% z7 J% g; c( t  E& C' Y
begin P_pick3 arriving, e4 b9 c' l6 n7 R& `+ Y0 g* x' ~1 F
    set A_i to 21, u6 e: c/ y/ t/ ~
    move into Q_induct3! ]" r& b/ `4 u# t- W5 `9 O6 V3 p  O
    move into pickaisle.induct3" \6 G" a( ]4 b0 y
    while A_i<=30 do begin
8 _  q& z$ V( A! P: O. z        travel to pickaisle.con(A_i)
  G# N6 a+ y0 b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 w* N0 f0 F! g( g7 _& j        else wait for 10 sec
7 |: ~5 W& A# `$ H. l% @        if A_i=A_leave then send to die2 v* r) t0 Z: R+ J
        else inc A_i by 1, m) H! V: I" V: p( B' J
    end9 X" m7 _2 m7 M8 U8 l8 F" t0 v% `
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是个什么东东?" t) ]1 H5 I. K3 d. A% h  P
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: `7 z& v; N9 h, _

5 n) f' O9 L; _% b* I; V+ u$ qAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' F) [  q0 v6 E7 A( b8 r* A, |7 f. L7 ~' J  c0 n
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- z) E# k( ?. e" u* l& K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;: K% E5 u6 T; P, k/ t
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 V" v- }2 z1 O+ I6 d
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' g- J* f# ^6 |! u+ vbegin P_induction arriving
( l1 S* m4 }  E- T    clone 1 load to P_pick(A_induct)* x) n% ?+ @* Y3 @9 j3 o
end最大的系
( k4 [1 n- {( N7 @; V1 B' y, ?0 c; }) h2 h' t1 j* s
begin P_pick arriving
, Q+ X$ }3 K0 f3 C    set A_i to procindex * 10 + 1( {) _* K6 T) A& L& U( j. J9 R- i  v
    move into Q_induct(procindex)3 J, H7 U  Y& j
    move into pickaisle.induct(procindex)
7 s+ j" F& c/ B% C1 Y    /*check the type of pickaisle.induct(i), for your last problem.*/
/ U' v- c3 ~( H  v
/ X* K% g6 ~( d  B' U- \$ M6 K! W) T    while A_i<=30 do begin
7 @  z2 g0 j  f( ]5 ?1 \& i        travel to pickaisle.con(A_i)# |- _! |0 ~3 E$ A# t* H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% @- G/ f3 n0 g0 k! D% Z        else wait for 10 sec9 J& ~8 ?# W0 u& \7 w3 \7 u
        if A_i=A_leave then send to die3 S) F2 |5 p1 H% y# T
        else inc A_i by 1: p8 b  D& ?4 |) F1 z$ \
    end
& ]3 Y+ S4 k. [4 u+ o7 Iend7 G  p% L) @9 R

# |0 D$ [2 i7 J) E( A' d其中的procindex为整形,代表当前process的序号。
7 X) p% i" R. G/ c) \) xstation和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-9-15 19:40 , Processed in 0.018498 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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