设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13351|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢; z6 q8 w5 c- g0 m# y6 T  N8 i: e7 F
, D- |! f" c) v7 Z3 F9 W
我的问题是,在每个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中的数值,不知道会不会有什么不妥。" S* ]  i) x3 X, }/ ]

. L1 o& |) T  N% H. |( y4 Dbegin P_read arriving: ]0 n) e$ ^! N) E: ?3 P
    while 1=1 do begin# |5 N4 w; ?! B5 l" R! Q+ }. ~; w
        read A_tote from "data.txt" with delimiter "\n"
3 i/ y% Q2 @' K8 K5 Q4 g        read A_time from "data.txt" with delimiter "\n"
, k& C  B" e" O5 R. B+ H        read A_leave from "data.txt" with delimiter "\n"
6 p- j! a3 k, i. K1 H" A        read A_picks from "data.txt" with delimiter "\n"
$ s! W3 P8 `& J$ h        set load type to A_tote  c+ S4 w" z* r$ l  H
        if A_tote="tote 1" then set A_induct to 13 v6 \' x/ b3 a% _
        else if A_tote="tote 2" then set A_induct to 2
) v7 i( E& k1 |; W; z/ a, a% A            else set A_induct to 3    $ Q  ^2 U  u6 V$ C. }9 U
        set A_i to 0
7 T1 \: Y- J1 y2 |( P/ {        clone 1 load to P_induction/ Q. Q5 p, p2 c
        wait for A_time sec
, K# g0 h; k$ G  G3 C$ {" P9 c    end, N, k  |/ v3 c6 M. S6 M
end
6 C( `8 k- u; s( G# _2 B$ d( I
% m* h. F4 S' s/ o8 O0 Kbegin P_induction arriving
# j" T0 j2 U5 t5 W; P$ d    if A_induct=1 then clone 1 load to P_pick1% O6 D' W8 g& p1 u& S
    else if A_induct=2 then clone 1 load to P_pick24 U: ?2 ~/ y5 y( t
        else clone 1 load to P_pick3
2 ?) M+ C* t% ^$ [/ |8 [& Lend
5 P3 V: p, k8 j, t. V; p$ v0 E  v9 V. O: [/ v8 M& \
begin P_pick1 arriving& |2 X7 w; |, n" Q- z
    set A_i to 1  Q+ a& u& ?& a1 i
    move into Q_induct1- ~4 Y  Z2 W1 T5 q
    move into pickaisle.induct1
5 ^. N5 M0 Q+ T5 A" U$ e; v    while A_i<=30 do begin
9 A, i# }% ]) l4 f. D3 n! P        travel to pickaisle.con(A_i)7 W$ n+ d5 [8 g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 c0 ?) |* Q* M  L& A  J9 R        else wait for 10 sec
, c. ?) r8 z' n        if A_i=A_leave then send to die
2 B" F" N& ?0 f5 ~/ {/ G( [        else inc A_i by 17 X2 T4 l2 A3 ?' k8 y0 u
    end
$ w9 K2 B- d4 Y$ Uend# a& i8 i. ~: t- B9 V

; d, {. C- s0 Q: kbegin P_pick2 arriving: I. g! A- a1 G% c0 Z
    set A_i to 11) C: d- q% K5 |( S" W
    move into Q_induct2/ v7 j' z  |# w- g- c
    move into pickaisle.induct25 ?, k0 a# g$ L% f4 O
    while A_i<=30 do begin
. K! |) l0 u" A, R9 [        travel to pickaisle.con(A_i)
6 _* ~5 ~' L" X/ z5 n# Q) _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 A) d* m; T" V. u( G3 K        else wait for 10 sec5 P  [  D! `0 m/ H
        if A_i=A_leave then send to die+ ~) P- p$ `3 G# Y7 _
        else inc A_i by 1) W' M: s, ?& j, b" P
    end/ i+ j; M3 s- S' H6 F! i! @2 ~( [
end# U3 K9 z  x! g

1 V/ _- T; l$ o, _begin P_pick3 arriving3 z- j# B, w; ~/ X  N, G
    set A_i to 21
! l1 E5 c% _3 L4 B% }" e    move into Q_induct34 z: M) M- T4 o3 ~4 Y* t, g0 w/ Q
    move into pickaisle.induct3
" `/ n8 T, d0 F: \+ o    while A_i<=30 do begin' R9 _  M* o& F% W' a: \, o8 S
        travel to pickaisle.con(A_i)1 b5 r0 u8 Q5 Y5 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ m- N! p) z' I! Q$ n5 I
        else wait for 10 sec
* ^3 ]  D! l! l5 V/ H- U+ a        if A_i=A_leave then send to die% q' Q' D- F  t, X7 z1 Q
        else inc A_i by 1
" R6 N; Y- d8 l" l$ @    end
) T4 O1 a* b1 b% zend

最佳答案

查看完整内容

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是个什么东东?, S, N6 \, C' }( \
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 y' g: T$ N) P8 l, _
. G* ]. G8 t1 D% l) k5 JAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% B1 L/ x% e' d2 J$ Z8 ?, k- e9 m* q; K0 U1 k! V# n
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 p4 w/ Y6 C  D. w1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  d; C# Q! @) Q3 ]+ y; Z# e; X2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# ~' g* J$ i3 ~1 E- ?8 W3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 V3 Q6 N9 ?; w  b6 y1 E3 V9 Pbegin P_induction arriving' j' X9 |1 V9 y
    clone 1 load to P_pick(A_induct)
, a3 Y5 A; c/ {9 E* y, l2 E. Uend最大的系
& x6 r% u  X4 ]5 W) B. Y5 I5 h8 ^! C  {6 W! }; d
begin P_pick arriving. S% @  c. j. s, Q2 Z+ J5 a
    set A_i to procindex * 10 + 1
. j5 r9 k# w* I, P  |& a/ l: B    move into Q_induct(procindex)! b) A' b% |7 s
    move into pickaisle.induct(procindex). a9 p2 R. P( e* |) Q
    /*check the type of pickaisle.induct(i), for your last problem.*/. T  e; B- z9 g' x& B, ~3 b
# ^, I) p4 [7 ]3 ?) R3 K* y  M+ I
    while A_i<=30 do begin# q0 ], H* g7 ]) d. }  E6 V8 P0 R
        travel to pickaisle.con(A_i)
% z0 v- g1 y( d: T' N, c1 T- K- e" v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 A. P4 Q+ ~: z
        else wait for 10 sec, I+ \$ x: f+ t' k
        if A_i=A_leave then send to die5 d$ K5 W2 @. ?3 F, ]3 Q; `
        else inc A_i by 1
. ~4 C. B3 l! r2 P5 t    end6 ~6 Z9 r" p; O) o
end
  l; r! y) H( G8 f
: w3 o1 z/ k7 P9 R1 E/ D7 ^& h) l/ p其中的procindex为整形,代表当前process的序号。
$ M3 j/ V9 b9 I' |( @- k: qstation和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-6 13:30 , Processed in 0.016753 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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