设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13705|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  L9 _7 v9 u0 [9 }. B" O+ a3 b% ?0 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中的数值,不知道会不会有什么不妥。
/ e8 G$ O2 B' Y1 q& ~7 c, O/ L- \6 d8 [' u- K
begin P_read arriving; G7 H: D" o. @4 K& O
    while 1=1 do begin9 I  g2 s& O. _! I- ]1 _5 ?; {
        read A_tote from "data.txt" with delimiter "\n"
" u6 ]7 W9 I- @" E- e        read A_time from "data.txt" with delimiter "\n"; N' x& P& U8 V0 D, t0 X! m
        read A_leave from "data.txt" with delimiter "\n"
* x$ c/ u+ ~+ S        read A_picks from "data.txt" with delimiter "\n", @. h6 v1 x6 H- C
        set load type to A_tote
, J; Y; Z* p- [% G3 L        if A_tote="tote 1" then set A_induct to 17 g, a) I9 E8 s; M0 f  T) ~0 |
        else if A_tote="tote 2" then set A_induct to 2
1 M: g2 x- g4 p' o, K            else set A_induct to 3   
0 O! o5 o( ?  `        set A_i to 0
) p6 @+ r. \, x! |( z& l, W7 e        clone 1 load to P_induction
1 F2 H* K& x" C6 _2 f  a        wait for A_time sec+ f3 v; {3 B( [0 q8 z
    end
! C- S6 |7 a2 N% o5 ?. }7 Cend/ U" N$ x; ?4 `) d, }; F- @
9 q$ P  \; L. c; h* r* O
begin P_induction arriving
: z2 Y" I$ M8 w, X- k5 J    if A_induct=1 then clone 1 load to P_pick1) b0 `7 e4 y% l- }. [9 W
    else if A_induct=2 then clone 1 load to P_pick23 X; F4 I( m0 m( {/ i) a' V
        else clone 1 load to P_pick3
* m% c2 p6 }1 |4 m& Fend
) }0 \( b% P3 q% V! x/ M  e% o; A
5 r7 C* y' I3 p: |6 Abegin P_pick1 arriving. l" f4 D) H% x) p2 T5 \; L  x
    set A_i to 1
9 p; W6 e' q) p* V" _: p    move into Q_induct1/ _& A+ X/ D5 D
    move into pickaisle.induct1
( C- I- U" c! L7 A3 c    while A_i<=30 do begin
4 I, t4 O2 Q2 q1 h. t3 o  \        travel to pickaisle.con(A_i)8 a+ f6 h9 @! x, |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; T1 ~1 X6 i, v# k; U+ x
        else wait for 10 sec
2 p: |; x& L( d2 ^3 _/ B7 Q3 M+ V        if A_i=A_leave then send to die. {$ d- Q9 j0 V. T3 _8 |
        else inc A_i by 15 M  U) C/ I1 O/ J+ Q' U- V) i7 E
    end
. P& @6 @* Z, `end0 m! i9 D- B9 o2 D7 J+ C$ j/ s
2 r* ^8 w3 H  y4 S
begin P_pick2 arriving! F, I* T4 i5 v
    set A_i to 11& L4 z! R/ L& x% a8 q+ S
    move into Q_induct2
  R2 y: B  E% i/ P; M+ {    move into pickaisle.induct2
) P/ _3 N/ O* X$ C7 p9 _    while A_i<=30 do begin
. v6 E  J5 D& G/ }, L: E        travel to pickaisle.con(A_i)6 E( X# g$ d4 D9 l5 w" m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 `1 C+ T: o% `& I: j0 `0 t4 U
        else wait for 10 sec# v; D2 @/ X, ?# E
        if A_i=A_leave then send to die3 l/ B: |8 |2 \$ t$ p* Z
        else inc A_i by 1
5 N3 ^7 T& x. p    end* @+ V) R3 P4 O1 F" l
end! Z: f$ N, r+ S* ]. i. x

4 E6 B3 H$ u3 X% g7 {/ r, U0 ]$ Wbegin P_pick3 arriving5 L% a! J& V% @% V% V5 t* d; |
    set A_i to 21! s* m9 s# {/ V
    move into Q_induct3
+ C, D$ ^8 o7 K# m& J    move into pickaisle.induct35 u- s8 x' b4 p+ l
    while A_i<=30 do begin
, W3 \6 o- A0 {" \, F* {9 R1 p        travel to pickaisle.con(A_i)
: q% \+ J. w' T" R) `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) _) x, O8 g1 o. \        else wait for 10 sec4 t8 W7 n3 V+ H" B
        if A_i=A_leave then send to die7 e; |4 ?5 u: D! p2 q
        else inc A_i by 1
7 j. i  [$ ?5 D, |* P    end
& ~7 q- {3 f2 i" ?* |3 Uend

最佳答案

查看完整内容

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是个什么东东?
/ d  c1 n0 h( K  Tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 E, G* F4 k, f. G! R5 ^: [: t2 c' T* T3 A" _# g
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 \' R! X1 l7 A' |$ P: l1 r

$ Y/ Z% u; f; J% o& Y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, A+ H/ d3 S% y$ V8 ^6 T1 ^1 v1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 H8 ]9 u0 L1 @2 _% y+ C
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; E# i/ e: z, A/ i% j
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:# P+ s7 i7 m6 ?4 w! o0 |
begin P_induction arriving
+ e! W+ [$ d' R% R; [3 a4 N) w    clone 1 load to P_pick(A_induct)/ Q. m. L3 _" n. N9 v, g  m
end最大的系
% Q* x% l1 T) v- G  |
% a5 A* j; y: lbegin P_pick arriving
; k. s" v  L& Y( N! \5 ]' b. W    set A_i to procindex * 10 + 1
: T# I' e% J6 V    move into Q_induct(procindex)
+ D# ]' ^; b9 S, k: q" ^1 e8 ]9 _    move into pickaisle.induct(procindex)
# P0 o5 S4 \2 A: d    /*check the type of pickaisle.induct(i), for your last problem.*/( e2 n3 v2 m) e! C

& Z; B: {" u/ i0 N& Z5 w    while A_i<=30 do begin' I$ S+ I- r% }# j5 [- W6 A5 u
        travel to pickaisle.con(A_i)
7 m( O8 v0 b8 Y, o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, q4 W$ f8 g8 F. u8 D( d6 \        else wait for 10 sec) n7 h& O5 i8 s# Y/ B
        if A_i=A_leave then send to die
# z# a+ |0 s; {6 H* a& s+ a6 B6 [        else inc A_i by 1
' A: ]5 z, N) R: r' U    end
! B1 {$ M8 U( _end9 Z" S6 J8 w1 a6 o+ I

8 t$ G2 U6 ?. f5 w其中的procindex为整形,代表当前process的序号。! q9 r' S4 M, U8 L' J
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, 2026-4-29 21:58 , Processed in 0.018172 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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