设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14103|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# W! R! k6 L/ \' U7 [) E
3 O9 W" M- O  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中的数值,不知道会不会有什么不妥。" e' U" D7 P9 J& t& D& }  u+ h

" p* R" x9 w( B7 Ubegin P_read arriving
. y7 _/ G; \* \9 I& |! X    while 1=1 do begin  z7 j) w- D; a, s
        read A_tote from "data.txt" with delimiter "\n"
4 `2 K0 a( ^3 s  w& @! D7 `; I6 w1 x4 n        read A_time from "data.txt" with delimiter "\n"# E  v. M! q( c6 z
        read A_leave from "data.txt" with delimiter "\n"
5 M  k4 E3 A* Q( n" f1 f. x* ]( ?        read A_picks from "data.txt" with delimiter "\n"
) s: x4 s; i# s9 Y, t        set load type to A_tote
  w5 y3 H# v" {5 X: N% W) h$ P        if A_tote="tote 1" then set A_induct to 1
8 ]' |1 C, i0 v" \* d6 i  Z        else if A_tote="tote 2" then set A_induct to 2
, f2 b; _( {6 Y' @            else set A_induct to 3   
9 v# Q2 p; a3 o) {( |2 v        set A_i to 01 a+ ]  g" S) T# ~# c7 Z, Z5 j& |
        clone 1 load to P_induction
# a. _5 B7 g& _  h8 O+ M        wait for A_time sec
% n$ s( A8 y; M! t+ S0 _    end1 G- Z0 g% @% C( y$ [$ p" g
end
7 M8 }! x* U2 J8 D% `* y
' D  Z: I3 R" F: _begin P_induction arriving# \9 J2 r: O4 s+ S4 a# ?
    if A_induct=1 then clone 1 load to P_pick12 f* L7 G0 W& t  `  a
    else if A_induct=2 then clone 1 load to P_pick2' H/ `3 w- E( _3 w0 `% R; r
        else clone 1 load to P_pick3% F. G! F! h/ \5 x) g' p! [
end" s- ~5 ^+ g& d7 {% f! ?

) d2 a) o3 h. lbegin P_pick1 arriving
& Y. Z2 R) C5 Y# ^7 ?( f7 K0 Y# H    set A_i to 1
$ e7 o% A% w" p6 e0 |' s: R    move into Q_induct1
1 m- t$ }0 [5 P$ x/ V' S' T, {" z    move into pickaisle.induct1; J, i3 o( B' N/ e3 s9 H
    while A_i<=30 do begin
. T: x$ T( F+ B$ @4 z3 M        travel to pickaisle.con(A_i)
5 o4 O8 ?* n+ w4 O% O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 `. \( M* E) K# ]" t6 A. A        else wait for 10 sec
, I$ J1 _5 E7 d: I% X6 K0 n+ L        if A_i=A_leave then send to die
( ^  w9 D! s' h  d8 S        else inc A_i by 1
4 b5 [, {, H! y    end
9 ?& K) R$ ?. Q' c8 {( w3 O8 @end! N; K' \- `; H/ a
: e, @! [% M, K9 J( u6 M: H
begin P_pick2 arriving4 g7 `6 P! C# O) i% x6 {+ Q; _
    set A_i to 11
* w0 T) s2 g* a/ ^. T" [2 M* a4 e6 ^    move into Q_induct2% F+ d$ P* y. U6 {
    move into pickaisle.induct23 d0 b1 T1 V$ [# t+ g3 L0 A; T
    while A_i<=30 do begin
' F( ?: M& ?4 Y5 o1 N& F        travel to pickaisle.con(A_i)5 c* f2 z. W3 J$ X7 n$ s- b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  ]2 o8 D' {4 \) L( j9 F0 S8 \
        else wait for 10 sec- F+ B: q# x5 d4 F4 v8 }2 a3 B0 _
        if A_i=A_leave then send to die/ A4 v4 W4 `1 B. t  Q" o+ P
        else inc A_i by 1
* q& y& F3 Q7 b9 w. o    end, E8 i5 c2 T2 C9 x) }" T: u
end
  M5 F+ }1 t( a2 Y0 {8 }; v0 }# \
. S8 e) K7 e. Gbegin P_pick3 arriving9 j5 W/ H/ l7 `! z7 R% w
    set A_i to 21
9 g  T9 K1 ~) J  P5 C    move into Q_induct3) h/ ]* E! L% q, V; ], ?( n
    move into pickaisle.induct3
3 N! N; F7 e- r& g2 p" R% {8 K7 u% l    while A_i<=30 do begin2 N4 D9 O. x6 y5 p, e
        travel to pickaisle.con(A_i)& N% W+ w/ w! S) u4 A' f3 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 I5 r/ ]4 W) p
        else wait for 10 sec
/ S' Y% P5 E& |! t3 T& n        if A_i=A_leave then send to die6 ]3 [7 r- ]- [$ x
        else inc A_i by 1* p8 j* c6 e2 h+ R6 c
    end7 F# I% B% I. j3 h% r5 p
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是个什么东东?
; x! |0 W9 f! g' n* Jmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' ~2 N/ N; L! }, @  Y* m4 }
+ @0 R' ~9 ^1 A& t' o; f
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 Y% ^* ]- O1 t# ~- s0 c2 ~$ V- J" M& z0 ^1 j
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
5 P0 x% w' O' _  ?  I1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. l$ E* B+ w; X% V; H+ `# m2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. E) `# l, T6 x/ j( t" B8 E- s3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 U3 f. Y7 {0 i' I3 l5 |0 P7 p4 G
begin P_induction arriving, `" g, O0 L; ~5 k; N4 ~
    clone 1 load to P_pick(A_induct)# V+ Y  h/ t% U3 E
end最大的系$ Q/ \$ o) m2 Z2 B: b
' K, [' W( E' C) w, y
begin P_pick arriving
1 f- H: ?: j' p& N+ N3 K' Q    set A_i to procindex * 10 + 1
' |. l6 ^0 A4 |/ v) L& P    move into Q_induct(procindex): P' i" |/ @" N$ v0 s% \7 m
    move into pickaisle.induct(procindex)
& [+ B( g2 R! J# E) u0 Z    /*check the type of pickaisle.induct(i), for your last problem.*/2 ]) P) X' j! `9 |9 s

9 X/ e5 O2 O! q7 G: h    while A_i<=30 do begin
1 F3 {) o+ p: |' T% v        travel to pickaisle.con(A_i)% H9 R) I0 C( w- y+ W' w' N3 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 a! S. P; P3 S/ N' ~
        else wait for 10 sec
( h$ \: k8 P  W0 }& A  t( F2 E# w        if A_i=A_leave then send to die8 V6 Q, f0 n) H8 \. C
        else inc A_i by 1
/ q$ W' {# F5 ^' t    end$ H2 o! ?, E* z1 h9 ~# X: u4 M# b
end' z$ f9 y  \7 Q1 r8 J5 f0 x
) I8 m8 S: J: b, e7 p% V) W
其中的procindex为整形,代表当前process的序号。
; A: ?6 e( u+ [4 f1 s4 pstation和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-6-9 04:39 , Processed in 0.013368 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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