设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11777|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 i! B5 P' u0 V' w9 u; ]4 Y  b# I5 p4 f3 Y. ]) P4 q5 V7 \
我的问题是,在每个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 m- A1 ?  X# Q& s! m$ U* i
  q4 b' _: Z, g' E8 W! X8 h+ G6 Dbegin P_read arriving1 g; a2 H3 {* I- d0 c
    while 1=1 do begin
/ |% Y! e. w6 \+ W, E; {        read A_tote from "data.txt" with delimiter "\n", h+ h9 j* M# d: ~
        read A_time from "data.txt" with delimiter "\n"
$ t; s& V) O/ b1 {$ j/ j) u! D0 u7 T        read A_leave from "data.txt" with delimiter "\n"
" X4 S- c5 E0 M# r2 R" _        read A_picks from "data.txt" with delimiter "\n": Z0 l2 s( k" ]+ ^. M4 J
        set load type to A_tote
5 F5 P+ |/ F, Z6 I        if A_tote="tote 1" then set A_induct to 1' t; s  c6 ~( T  n+ @, m2 L
        else if A_tote="tote 2" then set A_induct to 20 D, g' H/ L$ k/ ]4 A
            else set A_induct to 3   
/ {, y) b% ]" @2 @5 Z, F* [) {3 x        set A_i to 0
, E# u5 \: a( i3 d) Y        clone 1 load to P_induction
0 V4 H8 r% f9 f+ P6 I) C' D        wait for A_time sec
2 s- I' l, A' n6 G    end
% ^  V. k. Z2 r9 m$ H& Xend& w* ]' [+ s7 Y4 U! b: G* D0 r& D

' I4 Q& g1 N  |6 N' Ebegin P_induction arriving
) i6 o) P3 F8 J8 r) j9 G    if A_induct=1 then clone 1 load to P_pick1
! h* z$ E- x+ c4 V* l( b. h: S    else if A_induct=2 then clone 1 load to P_pick2* N6 M) i8 K9 N: _6 b9 ~0 Z4 {
        else clone 1 load to P_pick35 M# }. d0 @/ Z
end0 d$ |1 `0 g( t/ K: S8 u

4 ]0 e; S6 |" \4 R8 N# |3 C8 K/ Obegin P_pick1 arriving
/ l8 H9 E# a1 O8 l3 b* b8 u8 ~9 r0 P    set A_i to 15 \# J/ B$ ?5 l; j2 w
    move into Q_induct1
# {- G* N' U4 O7 d    move into pickaisle.induct12 {# v$ @$ G* m  t  ^) n
    while A_i<=30 do begin  Y, V# |/ ]) a, n% X
        travel to pickaisle.con(A_i)
- R. k9 p" c) P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% f; G$ {. H) F/ n  p! r
        else wait for 10 sec: T/ {* `" l7 z
        if A_i=A_leave then send to die" H& ~' V, R; O/ E9 t
        else inc A_i by 1
5 A# Q# i4 t9 a) _1 C    end
  D" ]& i% {: J- y, E$ G) zend: D, G) y7 j# \/ \: O

4 K0 D6 i0 M1 J* b  s( v! a6 }begin P_pick2 arriving
2 e( X9 u. \) p. V# S/ n) n7 ]2 Z9 ^    set A_i to 11: ^' ^0 b9 R6 |0 B' }  @5 r3 b  y
    move into Q_induct2
' c  l3 l* L; K3 P& e) J+ M) J, }, }6 v3 ^    move into pickaisle.induct2  z5 N$ ]4 S" C* ~/ H0 C% @
    while A_i<=30 do begin7 H9 K  i/ ~/ i+ f( u0 y
        travel to pickaisle.con(A_i)
! W9 S- T2 B* T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 [( {# ]6 z# {. q. \/ {5 @  e0 b
        else wait for 10 sec, h, _$ _/ w2 G! }3 J1 M
        if A_i=A_leave then send to die& R/ G# Y1 W( y* s1 z' E+ K
        else inc A_i by 1* _' m! O( [6 Q2 A4 C$ o
    end
8 ~7 T! o" [7 i- y' Lend' e$ ~* G& }1 Q5 g' b
2 q( p1 a" T5 c7 n
begin P_pick3 arriving5 s' {! I' X, G% g: f0 ^9 w
    set A_i to 21
( j# S0 a  S! H: s* }    move into Q_induct3
8 o* Q% M3 ]( ?) y2 c) d( {    move into pickaisle.induct3
+ @, Y. d) E7 ]$ |    while A_i<=30 do begin
; w/ A) m8 D5 a$ a- A' c        travel to pickaisle.con(A_i)2 L/ d$ R* j2 w5 G2 G2 J- f- N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 i. L! P; Z4 ]3 ?6 Y; |' s
        else wait for 10 sec4 A  `( [; u$ ]$ @% N* l( j# X
        if A_i=A_leave then send to die
  Q4 y7 Y  s) Z; m4 Q/ H" P        else inc A_i by 1
" E. p$ e$ B; l3 g: M2 ~) O( s    end7 I9 L% p: _( @! ~; Y1 ]
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是个什么东东?
) J$ r6 M( P! l0 g4 Xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?4 I  U" E' \. \( l' o) i  K$ ^

; Z* K* O  S* n# `. @1 iAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: J8 x3 ^  z, c1 U' B0 x, H

) F* @+ f) q+ X3 o( n& M. B: F* x另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, K: i( A# A4 N) g3 ]) F
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ ]7 Q3 l  m0 @4 G1 s+ |2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( l1 {( {- R- o3 _' u3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* r+ Z& Y  G% S# F& s8 Ybegin P_induction arriving. p* _" }- G) i
    clone 1 load to P_pick(A_induct)
/ a9 K! @* f8 Bend最大的系
, T7 ~# s4 q4 ~' S
5 @6 l; b, m# N3 e5 i- pbegin P_pick arriving% a; y, L0 _, d" q- J* e
    set A_i to procindex * 10 + 1
' u; f' P( t4 C; j+ A, [2 U* o    move into Q_induct(procindex)
1 b- `% e- z5 C1 [% b1 f+ ^: C3 d    move into pickaisle.induct(procindex)
& l5 s# B3 p/ J. p' M- ]    /*check the type of pickaisle.induct(i), for your last problem.*/
7 T- i/ S% n! B
1 |1 u& x6 c1 e8 y$ `* [# w    while A_i<=30 do begin
# ?0 X1 W  X/ k; S        travel to pickaisle.con(A_i)! s* Z# Y  C3 g' \8 Z1 k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 U1 @& o) d6 K
        else wait for 10 sec
  s3 t2 `" K* p8 B- x3 ]; R6 }        if A_i=A_leave then send to die
0 `) D1 u4 @0 g% L        else inc A_i by 17 e2 Y) c5 u; x# h" R) u3 R" E
    end
" L5 b. x2 Q% m6 b, c" g: o+ c8 Xend
4 R9 X* l0 d8 c' ^
5 M$ X2 ]1 |7 k其中的procindex为整形,代表当前process的序号。
6 z# Q8 x( q* P# 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, 2025-12-4 00:43 , Processed in 0.026889 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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