设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13960|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ M- r$ G9 K$ K& T2 m; i$ }7 [7 p7 G7 J4 Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( s1 M/ q4 @2 o" h& i

+ j) Q0 U  ^3 V7 w4 m  d2 vbegin P_read arriving
8 Y3 e$ S; S2 q; J    while 1=1 do begin
+ s0 N1 w* ^. L$ W        read A_tote from "data.txt" with delimiter "\n"
* d8 o& H( n, c6 ]        read A_time from "data.txt" with delimiter "\n"
0 R0 N9 Q) r& h- Z5 F/ ?# N. t+ c        read A_leave from "data.txt" with delimiter "\n"* b1 {3 c) V; Q( v' ]
        read A_picks from "data.txt" with delimiter "\n"+ A" O( j% n% P- F0 O, z( i
        set load type to A_tote
6 ?, y# y1 ^6 C        if A_tote="tote 1" then set A_induct to 1' V( J) }$ T4 j4 L3 R
        else if A_tote="tote 2" then set A_induct to 2
; {! ], w8 o) {" p2 I            else set A_induct to 3   
- g6 W7 e. d$ S        set A_i to 0  c' g% ~5 X  C4 B5 y, l: D
        clone 1 load to P_induction6 Z6 N' }' p0 B  ?
        wait for A_time sec
$ N3 m7 P/ V3 f, X& m    end8 T' ~# L( U( ?% L! P
end; Z2 q8 F/ {5 T7 t  N
4 f# \) F1 g& K8 i6 `
begin P_induction arriving
+ B1 {& l# Q0 ?+ d& @0 j6 U. e5 i3 |  |    if A_induct=1 then clone 1 load to P_pick1
* x7 M4 l6 H  @, g, {    else if A_induct=2 then clone 1 load to P_pick2
( T- W' y* \- i+ k5 w9 u& r        else clone 1 load to P_pick34 O1 q% V* C7 g; k! K7 |
end
% X1 \0 N1 f% I4 G/ y, ?/ x8 R  ?" L2 @
begin P_pick1 arriving
$ X- v4 U! |. w    set A_i to 1
& E$ V- f  U6 c4 {9 G# b    move into Q_induct12 q3 I& x! [' T& X; T& E4 K  }# w
    move into pickaisle.induct1
" m" n* N& m; C0 X4 ?    while A_i<=30 do begin
. |) d+ P1 t* u4 m: O        travel to pickaisle.con(A_i)
0 r: d; ?$ c( W9 x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 @( d7 g$ m& X, }) d9 Q# |, U        else wait for 10 sec& z& @2 ^1 s8 F
        if A_i=A_leave then send to die" ?) p9 ~, M# f- T4 j8 U
        else inc A_i by 1. J: `1 Q; {/ X3 C" s
    end
$ W  I5 F: ~7 s+ a9 d' ]end3 j9 `+ \5 l7 `

, ~$ b! h6 w. D' u$ W8 L. obegin P_pick2 arriving
1 p' \0 ]2 A$ Q, T- {5 Q! r: [    set A_i to 11
, Z3 }/ k' Z) d+ M! m7 S2 _    move into Q_induct2+ G: v. i2 P7 A' T
    move into pickaisle.induct2, s) u1 ^, M/ p( r' j
    while A_i<=30 do begin& p; O$ k8 d6 j6 t8 R
        travel to pickaisle.con(A_i)
- a  X' w( B: w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. I' v% B, k" V        else wait for 10 sec
" T9 U; n* ~3 @& Y        if A_i=A_leave then send to die
8 K4 s, i# L, y        else inc A_i by 1
' ?& t* ~$ j9 ~: x# a, Z    end- f8 \8 p3 J7 a4 K" G) X  l' m
end+ Q3 i0 y1 `) O3 f

2 |+ ?5 K# i# L0 ]begin P_pick3 arriving
. V, v! R4 C2 @' Y    set A_i to 21
# f: L6 |& k$ m% z    move into Q_induct35 B% Y+ p  l% x' a# i4 `. h. Z+ u# K
    move into pickaisle.induct3
) G+ s' V5 T9 _+ P, ^/ v    while A_i<=30 do begin
: J/ Z7 |$ e0 Y% }        travel to pickaisle.con(A_i)
2 J) x$ J1 S) {: Y! Y; k8 n0 D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 F& w5 s: f4 C% u        else wait for 10 sec
# A6 D4 Y4 x4 _1 m6 W# `' t        if A_i=A_leave then send to die
8 k$ a+ S- A' G( T) b: y1 s        else inc A_i by 1
  }1 g9 L+ b# h# g    end5 R. n9 o4 v7 i" p# N
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是个什么东东?
/ `5 y4 L+ C/ f% V$ l1 [  hmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ P! B/ a% y) X# \. K
5 G0 x/ A8 C0 U7 V% ]. i5 E" dAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" C4 r4 c6 |/ a; G( B$ |, @
+ X) o& ?! g: p  L. d/ C) i, L另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ R- Y$ K$ {" U
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 M, O( e+ K5 j& C+ P# Y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;8 Q4 c# n3 T# |4 c6 A
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ V' R. i' M3 ^6 S9 Z2 u
begin P_induction arriving2 a! \6 m! E$ c/ A( k" g: Z
    clone 1 load to P_pick(A_induct)" f  m; d& N& g3 k* b8 v
end最大的系
1 k+ t* T7 x" M: J3 V
7 L+ {4 m7 I) D# kbegin P_pick arriving! [4 i: V9 W1 Z" [9 U
    set A_i to procindex * 10 + 1( Z7 c6 v6 t) y1 r* n, W  k
    move into Q_induct(procindex)5 E' K9 Z. N0 |
    move into pickaisle.induct(procindex). ]* `) m2 v/ t1 Q: T
    /*check the type of pickaisle.induct(i), for your last problem.*/3 `4 X! P+ h" V/ }- ^: n" W

3 k  S" _9 @" F6 p    while A_i<=30 do begin0 t7 K3 I" y/ C, ]* H: Q" F
        travel to pickaisle.con(A_i)6 J% X, [+ H  ?( M0 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) z4 y5 b! z$ i        else wait for 10 sec
/ U& Y# z, \& t, W/ `        if A_i=A_leave then send to die! O9 D; H* e7 y& h8 w, U- t
        else inc A_i by 1! @5 y/ a  Z1 ^( ]) Z
    end4 b1 Z% n0 c/ P  e! B
end  }- \3 f7 E% {- |

  Q" i2 F8 c# f6 ?其中的procindex为整形,代表当前process的序号。2 r" Q* }, i! [' ]
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-5-25 00:29 , Processed in 0.022003 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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