设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14115|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ |4 Z' L' ]0 k. R0 J* O& c4 d- g: D; ^
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( M; Y% s! r4 L, q9 i
. Y) a; H+ y% h( }2 }$ T
begin P_read arriving
8 D+ d" s' j; B! ~& g2 ?    while 1=1 do begin0 r. i5 G/ [! n6 X
        read A_tote from "data.txt" with delimiter "\n"& W" }8 L& v1 ]! b9 D( w
        read A_time from "data.txt" with delimiter "\n"
8 D- K5 f6 P; o5 Y" ]        read A_leave from "data.txt" with delimiter "\n"
* d$ U% j7 ?3 I5 `        read A_picks from "data.txt" with delimiter "\n"( M# {7 M3 w( K; j8 i+ A+ }
        set load type to A_tote
0 j4 _+ R; S1 F( m0 e        if A_tote="tote 1" then set A_induct to 14 l8 x' c+ C6 s& l" ?7 X8 ?
        else if A_tote="tote 2" then set A_induct to 2& T" I9 X: U3 \* m/ _7 d& P
            else set A_induct to 3   
! }& x$ J# Q. R5 i$ w        set A_i to 0
# O  q# D3 w5 l, W0 e        clone 1 load to P_induction
/ j4 Z0 s. b, `& ], J/ o8 D" W        wait for A_time sec. s& w0 k! d8 W& i$ |8 s. a
    end
& g0 u. @8 _: ^# xend, W2 ?" O1 \& y+ v

5 i$ c9 n' C: t- I7 w7 H' `begin P_induction arriving
2 q7 _& V2 L/ A* m! q( Q    if A_induct=1 then clone 1 load to P_pick1; P/ o6 `& T* d! g- [$ c
    else if A_induct=2 then clone 1 load to P_pick2& I0 }3 _  \- r4 D
        else clone 1 load to P_pick3
; I7 \6 b$ Y: x: Q6 V2 y4 hend
1 d" ?* R& L  e; Q, m# |- m
4 l; `" K# n8 Mbegin P_pick1 arriving3 Y  B1 j  e  E0 z3 {
    set A_i to 1
& k( p* k& }! _, s8 k1 Y2 t    move into Q_induct1
2 e  p2 V6 [* ?3 W0 @+ I. I0 }0 D    move into pickaisle.induct1
& {  {% \: d5 o7 C( N* U4 T) K    while A_i<=30 do begin5 n4 n6 E; _4 z% [  ]! W1 C) Q
        travel to pickaisle.con(A_i)
1 x, T5 ~3 `; [1 J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. d5 M! Y, H/ i$ }: Y' R        else wait for 10 sec+ @: r7 @( _% A) O
        if A_i=A_leave then send to die
+ y% F" t0 ?% j        else inc A_i by 1) I9 }. ]: _& O* |
    end
# S  \, s( J; X/ eend/ k& B# M' p+ z8 n3 j; s

) i% C. D/ l7 @9 J5 tbegin P_pick2 arriving
0 }* U4 k) ?! B, I    set A_i to 11! u3 z& s* X: K5 I4 q. M7 r& ?" j2 ]% ?
    move into Q_induct2% x1 j- J% C+ {( I5 u
    move into pickaisle.induct21 [1 S* w2 x* N, e
    while A_i<=30 do begin
& N# o2 E/ W  ?2 g        travel to pickaisle.con(A_i)
+ ]" C% W5 Q; }9 B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- L2 D! ?- o8 f1 Z
        else wait for 10 sec4 ]# N1 `/ E; a4 E, G7 E
        if A_i=A_leave then send to die  m, q7 N8 F0 O' P* ~4 R1 u: }
        else inc A_i by 1, G* Q# O$ z1 z  ^+ y
    end6 J6 ]1 B" \8 o8 b9 T
end. [7 p2 K$ [) P+ C8 B# D
3 \8 Q* u. k1 N1 z+ o0 {9 G- ]0 x
begin P_pick3 arriving5 D5 _& Z) _8 v  j% M$ l! J7 c
    set A_i to 21
) t) O& }, r( A$ }& g    move into Q_induct3
" ^* `/ J* s6 k& Q    move into pickaisle.induct3& K% X' N  h1 [8 |3 k+ w
    while A_i<=30 do begin2 N1 l# C! t  R4 T1 ?: Y, M
        travel to pickaisle.con(A_i)" F+ B1 C6 S' ]3 ^5 U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 w3 j: M, [. c1 N( b7 B        else wait for 10 sec) E! h$ G- h' Z
        if A_i=A_leave then send to die
# ?8 @& X; A3 _( p# t. j: |  u        else inc A_i by 1. S8 @* i8 ~9 q0 {! ^0 H
    end, V3 U3 r8 s6 G+ f' a6 g' X6 ?
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是个什么东东?
1 G, Q5 o- q1 N7 Omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ K$ p' \  G% L/ Q5 ?- ^3 Q& t7 b$ A) b1 ?$ u+ _9 O- Q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 w5 k% D! O7 R: j$ }
  ^# _4 I2 I3 i8 e0 k另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 Y& z1 l6 R, D0 A9 n1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& c1 q; V. D; X2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 _/ o0 x/ M1 Y+ s( |8 H$ C+ y
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ s1 [3 s! i' L, {* G, B
begin P_induction arriving# {/ I/ n+ ]! \3 d2 n
    clone 1 load to P_pick(A_induct), Z' I! N* X, V9 `; L
end最大的系; d0 o' p  O! a, E  x. q% |
* e3 a# u) E4 B& q0 P$ j
begin P_pick arriving6 t( Q- a: h: g/ l) y
    set A_i to procindex * 10 + 1
, _/ h( Q2 p0 i; x+ [    move into Q_induct(procindex)
+ R% Q: [* Q* J    move into pickaisle.induct(procindex)1 J! C: k& c7 Q5 e
    /*check the type of pickaisle.induct(i), for your last problem.*/
* f9 t! I  u5 B4 h+ s8 T! [% C
' Z# t2 Q. I' w; }3 ^    while A_i<=30 do begin
3 U' V1 k% o6 N/ ^3 @6 z& d3 k        travel to pickaisle.con(A_i)% j" O0 D3 w  [# m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" l1 v- \- l( j% e
        else wait for 10 sec3 l3 t3 N4 b# \0 O/ F2 X( N. X/ `
        if A_i=A_leave then send to die
7 o) X1 d! c$ j8 i        else inc A_i by 1
2 c9 |8 J/ z: j0 T: o6 S9 T3 I7 c    end, ], N! Q+ B) R- y
end
% Z0 R$ `. k* a4 u- W" G3 c' R1 \, {' ^1 `( D1 \
其中的procindex为整形,代表当前process的序号。- Z, Y! j1 D) B
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-6-10 09:14 , Processed in 0.026490 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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