设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15324|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ ?& [/ @0 V$ s$ U+ k$ \/ b
- @& S* q' n  U7 \* r, n
我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 g* z" f8 r0 L  K8 Y! q

3 b5 I6 n+ ?) `! A4 m. t3 hbegin P_read arriving
" a% Y- ]4 G/ I, C- B# B3 y    while 1=1 do begin! ~0 g9 \0 z3 ^; [0 f3 X. h
        read A_tote from "data.txt" with delimiter "\n"" R: z8 b( y, G  s+ C7 X
        read A_time from "data.txt" with delimiter "\n"
! _$ }2 W* r  `+ ^: x8 V* @        read A_leave from "data.txt" with delimiter "\n"
+ I0 ^' f$ o/ v: S# a        read A_picks from "data.txt" with delimiter "\n"
+ a+ z0 P2 \7 _& d        set load type to A_tote+ N2 e0 p& u9 }( e2 `0 [
        if A_tote="tote 1" then set A_induct to 14 C4 l- _3 s: @$ H& S4 D( ]& ~2 Q
        else if A_tote="tote 2" then set A_induct to 2
* v8 t5 c$ Z& @$ A, o- `/ [            else set A_induct to 3    - E0 j  [& t, h. a% L6 q1 x$ Y$ L
        set A_i to 06 n. r& H, A  _* a/ v7 E) m
        clone 1 load to P_induction1 l6 Z4 x- t" n  X- C( u
        wait for A_time sec4 @/ v4 ]9 U  n3 o0 Z
    end! P/ O( U; i; S2 G4 t0 {/ h9 Q  g/ ^
end
' m6 k; O+ p% F( S3 Y" [2 |5 s# o: @) D) x' s
begin P_induction arriving' y3 [% z4 a+ ?1 K  z. {
    if A_induct=1 then clone 1 load to P_pick1' s9 ~4 k7 Z; D/ c
    else if A_induct=2 then clone 1 load to P_pick20 K: `& i; v  U: U; l, B5 S( N
        else clone 1 load to P_pick3$ w) C  w  D6 K0 V" W
end
! x$ G- C- g5 q2 i0 y* p
; i0 D% n9 ?5 W8 _% @8 hbegin P_pick1 arriving  G1 B! ]6 m* ]' ^/ o* ~
    set A_i to 1/ b* Z4 r2 L& A2 @, S4 j: d8 C
    move into Q_induct1
% B" O) n5 a9 P( v    move into pickaisle.induct1
& c( [- g/ h! m2 h: K) n, b    while A_i<=30 do begin
* g  h: c, j1 v' R+ [1 D" D        travel to pickaisle.con(A_i): a* K* S) @3 |3 v' o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' r1 F- O8 O& {: n" k
        else wait for 10 sec
" v- Q* }1 {2 ~$ u        if A_i=A_leave then send to die, V  N9 g0 H0 L+ P, j
        else inc A_i by 15 e8 D* X! B, |" F
    end7 C; m* `" e& w2 `6 e  K
end6 v! V0 f  H5 i4 O- F6 \9 s( p

( ?& z8 ^5 n% ]/ [6 Obegin P_pick2 arriving/ A+ p# s/ ?) w& Q
    set A_i to 11' ^+ \& i: `) w& L/ G
    move into Q_induct2
7 p2 r5 K! d3 x( T    move into pickaisle.induct2. K: ^% T  Z) |- P- |3 L
    while A_i<=30 do begin: ~  r: n6 [* w5 a7 @/ G
        travel to pickaisle.con(A_i)
5 B" Y0 T- [& x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' R! I: H' k+ {9 q  ~- W* u7 B        else wait for 10 sec
- s  I7 A" m- |        if A_i=A_leave then send to die
7 O* t. X4 A4 ?) I3 n. J        else inc A_i by 1
, J  P/ o  {/ h6 _3 w/ F    end, W' s1 C' I, E, q/ j
end
  K2 N6 K' Q6 _5 E- D/ A
# {# q3 h: H# _$ l; `4 fbegin P_pick3 arriving
0 p& ?- R: V+ g1 n4 l' o    set A_i to 21  O: a2 p4 x. ], E' }# L( d4 c
    move into Q_induct3: H: _, N7 F  O- S* {' W
    move into pickaisle.induct3
' O* J! ]! z) O8 i: b5 C7 g' m    while A_i<=30 do begin
# g- X6 n6 }& P! J. m        travel to pickaisle.con(A_i)* s6 @% `/ a- Y1 r( J4 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 L$ S# b) z! Q  B& r* I! |' l        else wait for 10 sec" T9 O  `$ a+ i8 G6 u
        if A_i=A_leave then send to die- k( P/ Z: z1 j" D( n+ F  C
        else inc A_i by 1
7 D& F. r8 t; x5 ^" m* L    end% Y0 a1 a* o) u3 R/ g( {
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是个什么东东?
) ^) i2 u7 _; s$ Z7 \2 X7 Kmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?1 ~. O- G, L/ i" q4 [

7 f) n% C* i. u) f; x+ a7 YAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。# ?% q/ t+ W# n# A* x" W
) G$ [% I* v9 N0 w7 C9 l
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ L0 f- c: w+ F2 G) \, A* m9 [
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 v) H. S- ~/ C9 x2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ S1 g5 Z: ?# a7 x
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; ?/ f* T7 j$ X9 Zbegin P_induction arriving
( z1 j5 N. n2 t+ i* G    clone 1 load to P_pick(A_induct), j7 R" b/ i: }5 f1 o, K4 n
end最大的系
# G+ @: G, x, i2 m3 ]
6 w% U% u; b% B6 Xbegin P_pick arriving( I) i9 C- I5 L& B
    set A_i to procindex * 10 + 1
6 B4 j# s; f/ B- Z- k1 t6 n) X; @    move into Q_induct(procindex)
  T4 j! x: ?& R! H    move into pickaisle.induct(procindex)7 |* t  F3 V/ _
    /*check the type of pickaisle.induct(i), for your last problem.*/& z4 D! W' ]% K: r3 h5 A

) m5 ~' S. Q; m$ n) _% y    while A_i<=30 do begin
( |8 w4 J: J; n1 h, k        travel to pickaisle.con(A_i): w( z. ~  B4 d- ]) X% z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 O, {* r4 s7 Y/ b& Q
        else wait for 10 sec
+ t4 \4 o9 ?8 e& e$ N$ Z        if A_i=A_leave then send to die
: ~) k# M$ I6 Y3 Z# ?! u  Q( p        else inc A_i by 1
% R+ l% x) G8 b( y1 P1 \    end! o  y' H# R5 @% [2 d) r0 y5 p
end/ P, \! X) B; E9 k. K
) D; `/ l: a# [$ @+ t4 c
其中的procindex为整形,代表当前process的序号。
. _' g7 |% B9 q. F. S1 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-9-2 13:37 , Processed in 0.024150 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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