设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14385|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ Q5 T# A+ W3 S. C, o2 f
2 g. j( y7 S' n5 Q" E. X
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 C$ E9 Q7 E7 I, M8 r
3 ?8 F+ z. l* F3 D& R8 P
begin P_read arriving
% P& e; O; G- d1 f6 F4 _6 E1 M- z: s    while 1=1 do begin; v& Q3 P) \9 r- q
        read A_tote from "data.txt" with delimiter "\n"
* v9 n% F: f' l/ P: r1 U9 o# P8 K        read A_time from "data.txt" with delimiter "\n"- s) A- X, e: F* k0 U/ R
        read A_leave from "data.txt" with delimiter "\n"
1 h. i" Z5 b. j" ]% P7 p( ]        read A_picks from "data.txt" with delimiter "\n"
- M( B+ [0 A6 Z: a) s. h9 i1 p8 `        set load type to A_tote
+ M. K2 R" T/ g5 l( C4 ?        if A_tote="tote 1" then set A_induct to 15 |+ w) H, c- Q* z' A
        else if A_tote="tote 2" then set A_induct to 25 M1 J  J# k, C- I( W
            else set A_induct to 3   
" u8 A* Z% f8 m" e6 O* S        set A_i to 0
/ l5 X9 b0 E6 Q        clone 1 load to P_induction5 S) Q: [5 I' l) k
        wait for A_time sec
# o' x) e: F6 A7 C- |    end& W/ l: P. y4 L
end: n" n) H. k: k
; ~: O4 ]; E* ?* R" n1 o
begin P_induction arriving
! n- I5 V4 @0 U& ]" m9 E3 \    if A_induct=1 then clone 1 load to P_pick1
2 i6 }' s1 p8 h) w: K6 u    else if A_induct=2 then clone 1 load to P_pick23 W# W' T8 }! {/ f9 }+ @  g" d
        else clone 1 load to P_pick3
! I0 \4 @/ F: w, x2 pend
$ x, h4 J/ E& F3 U, h+ ?8 H& S; A! s9 P; M
begin P_pick1 arriving
2 q) x$ k( t+ I& ?+ _: q9 \+ Q    set A_i to 1
- ^7 W6 W# b: ]) f    move into Q_induct1
% m- U6 p* t* l+ _3 B  m% u    move into pickaisle.induct1
3 l! F7 H# I' A    while A_i<=30 do begin
1 v% V% g( n8 g1 K        travel to pickaisle.con(A_i)
* U" ^. B/ e, N+ r/ [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 V- |. q" x1 k( ~, Q        else wait for 10 sec
. X" L5 S9 W1 _7 S/ V        if A_i=A_leave then send to die/ D- y& K' }2 y
        else inc A_i by 1
9 w' u0 }$ v! q! P1 X    end/ \& d2 c1 V/ f! {
end
! T/ x1 F* h2 w0 k5 K3 e5 u0 T& q* }! F6 t  O: _" a: O& N
begin P_pick2 arriving
8 `9 L3 k" g* _& V' F    set A_i to 11. `! w3 D! m/ |$ R8 J5 J6 n+ _' g- i: Z
    move into Q_induct2+ O3 m0 Q$ |3 e9 r9 m0 C" m! E" U6 R$ G
    move into pickaisle.induct2
% ]5 u: [" M' D8 L/ d' \  e0 H1 `    while A_i<=30 do begin- q1 j' p# F, }
        travel to pickaisle.con(A_i)3 P7 g& E2 J' a  ~" \, c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ E/ w/ a9 ~7 Q# A% h8 h$ P
        else wait for 10 sec! K3 V" Z( \0 t, n
        if A_i=A_leave then send to die
* w# [' u( O9 K  \4 C  v        else inc A_i by 1
7 U$ E# ]7 b+ R! W! E0 P    end
+ U  \5 |8 \" B: S- t1 uend
& q# i6 s- g- z! n- h" y6 ^+ L, ^9 D  _/ O
begin P_pick3 arriving0 f4 f: P! o) U0 j/ l7 h- d' r
    set A_i to 217 a- N" W; O% J$ y. E5 c
    move into Q_induct3
( ?! |; {3 R8 ]/ e! D8 ?    move into pickaisle.induct3
( g. C& L- M! s- g9 |7 \/ r    while A_i<=30 do begin1 d, B$ W3 s: M2 r1 [
        travel to pickaisle.con(A_i). j2 e0 w. Z/ c* |- ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; [' J7 i: h5 b# Z% y, Y8 y9 i% H
        else wait for 10 sec
( f5 `# G) V# Q8 A        if A_i=A_leave then send to die* |0 U  G9 ]0 E2 d: q6 f
        else inc A_i by 1: k* `; J8 m5 _4 X8 W7 l
    end+ C# U1 C; H" @+ }# |
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是个什么东东?
; c" [( o4 \8 }move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 e) E. r+ z5 G* |
$ H) {* Z7 z0 z
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& F# c: K/ ^: o4 y8 p
/ y: [& Z8 u5 l, |( }另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" w* U  d& d- ^4 m1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 Q2 V8 Y8 @% a$ r
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ s6 ~0 E/ A( D
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- a6 k) \3 G# S+ b7 n/ m
begin P_induction arriving
7 g) E& {# ]6 E; ~    clone 1 load to P_pick(A_induct)1 F% E! U7 @3 E# v# [5 O: R
end最大的系
) n+ A, G0 A5 w/ t6 z1 N2 T
5 G" U( D- E7 Q( C! m" abegin P_pick arriving% ~, h1 f- c9 t$ N+ S& t" t
    set A_i to procindex * 10 + 1! ^, W7 P" R" _: k
    move into Q_induct(procindex)
' k2 p/ Y) g5 |& ~    move into pickaisle.induct(procindex)! @: D( n0 m, U$ V: q* z3 G
    /*check the type of pickaisle.induct(i), for your last problem.*/
+ G- U5 J1 g. K
- G3 O& M# e# J    while A_i<=30 do begin. k  n) C: ~: ^% b$ E' G
        travel to pickaisle.con(A_i)2 L7 Y4 T+ C" g% `$ Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ C4 W  X2 W( {$ k/ @3 [; l        else wait for 10 sec1 y6 W' r) V0 d' V
        if A_i=A_leave then send to die
6 r; F1 A. s1 T; h) B4 F        else inc A_i by 1
! e1 B; h2 m5 m' r( S7 b$ H    end+ }% k4 ~6 j: d& F# f% D
end
; I& I/ h3 @4 g
. n5 `: y4 s- T% c1 q; b其中的procindex为整形,代表当前process的序号。
% ~0 h* o8 C. \! N1 q# bstation和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-7-9 11:12 , Processed in 0.015601 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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