设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12986|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- N* a- a7 ~' i9 z3 U' X0 u( ^" [. y- c
我的问题是,在每个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 f, y8 O) v
6 h) Y2 w# z4 [: S  n+ c  u
begin P_read arriving
) h# v5 y+ P0 ^0 ^& A7 X! y7 r    while 1=1 do begin% h- f( J. n7 O1 v0 H/ u8 W0 z
        read A_tote from "data.txt" with delimiter "\n"
8 h$ ]: _1 c1 l' Z        read A_time from "data.txt" with delimiter "\n"7 K2 Q, ]6 v$ T
        read A_leave from "data.txt" with delimiter "\n"
8 c0 h. m3 [6 u3 _& I6 i% L0 H        read A_picks from "data.txt" with delimiter "\n"" Z% T* w; C8 @4 V: {( N
        set load type to A_tote' T. k! |- d4 Y
        if A_tote="tote 1" then set A_induct to 1- n, b- M) O! ^9 g' r0 _
        else if A_tote="tote 2" then set A_induct to 2
1 |; Z6 X+ o+ e+ U( H6 P4 i4 N            else set A_induct to 3    . y8 v' g5 f. g  Q
        set A_i to 0
7 Z) k# x1 v5 B* k2 n: S        clone 1 load to P_induction$ _5 g) A+ ^! [2 x4 T! i2 y7 p
        wait for A_time sec# {/ G( V! c$ z4 [  c, D
    end
3 B* w6 o3 F9 ^end/ H7 G3 h( e# S. g# T

5 b0 x6 S/ j" @! C; U/ Bbegin P_induction arriving
! O" H2 y% ]# {" j4 \  M# z    if A_induct=1 then clone 1 load to P_pick1
" N- a) B- L. R    else if A_induct=2 then clone 1 load to P_pick2$ }. e+ V$ B' D  f
        else clone 1 load to P_pick3* z9 c8 D. K  ]* P
end
& h, J, i* p& \5 o: l5 [% _' ?& N& P* i4 c4 N
begin P_pick1 arriving
* y( u  L+ x6 w) g: e0 {    set A_i to 1
  w: }6 B+ u+ J, I    move into Q_induct1/ @  v7 e9 {0 v0 I9 L3 q( a$ S9 L
    move into pickaisle.induct1
6 K# I- \/ s: ?( R2 e    while A_i<=30 do begin
0 t# s5 P+ O4 S% y% c3 W. D* _! }        travel to pickaisle.con(A_i)
7 q* x) Q% B0 ?# b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' g* {8 k' J" Y2 H) c1 B" e+ S" t        else wait for 10 sec7 G( o7 B; m& f' y
        if A_i=A_leave then send to die
5 U$ O. Z. [  D        else inc A_i by 1
! |# ^6 A! u8 Z" D    end
8 C  |( u: \# a3 a$ K- A; E/ rend5 {, A9 j( `! s& `* A: X. ]

6 ]* G/ m" ?) s4 h. o5 k- M, z1 gbegin P_pick2 arriving
0 E+ W5 @& E* z9 M! e. I3 k    set A_i to 11
% g; n! B$ e5 W" |: |    move into Q_induct2
0 F6 F( G8 W8 R5 F0 F7 m    move into pickaisle.induct2
0 n& i4 ~* G5 x4 v    while A_i<=30 do begin. ]' O& g6 e( A9 {+ @
        travel to pickaisle.con(A_i)* Z) E5 T! p2 `* l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ U# E  W/ D: c) s1 D# N- b; `
        else wait for 10 sec4 A8 w. t5 x1 O  {8 k. K' u* j
        if A_i=A_leave then send to die0 n1 E$ T0 e3 p! ]* h/ Q0 E
        else inc A_i by 1
; n; t- j# i, J; F& c    end* s) x7 E5 e7 F# K/ J' `, n' _
end
+ e7 c. J* d, {. G" [* x! Z
' Q, r1 {9 U3 C0 G* N3 rbegin P_pick3 arriving/ A' e: i" J; t
    set A_i to 218 i* F$ G( P2 n2 [8 t
    move into Q_induct3
8 v6 U- ^1 E+ r7 x    move into pickaisle.induct3# ?! T7 F1 T+ s4 K2 O: }$ [. A
    while A_i<=30 do begin, @; Q4 R/ Q+ M: y& f  r. i
        travel to pickaisle.con(A_i)' }. i, g4 ^5 h- V- O5 X/ I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: I3 P# c. d$ w) ~# X6 M; k% V        else wait for 10 sec
; E+ n4 `6 r* G        if A_i=A_leave then send to die
: d* L7 f. ?% d2 @        else inc A_i by 1
! E) ^0 W( r& d% H; z    end- i% P) D, d8 E; \
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是个什么东东?
4 S+ T0 c; Z9 z: ?3 F, |move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" }2 V# @9 ]0 w& [5 D
; ]( }6 @6 D4 p6 Z# H
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% C9 j& c- Y3 |

( ]+ v+ _( V4 k/ o6 j另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, X" R# l( {5 T- u( w: ]  K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
* @6 q0 ?; N3 `5 Z% v2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; Z) D. L5 J; u: E/ Z. i" y# a
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) G& V) m3 k$ L7 C) g! I
begin P_induction arriving$ }  [+ P# u+ N7 G3 H  Q
    clone 1 load to P_pick(A_induct)* d) ]0 G- u* \. ]5 H# a
end最大的系
2 J2 b; C, l: d" h5 R! D. ^) q+ p5 v/ n4 Z
begin P_pick arriving, S* k5 E% Z2 B* P$ k
    set A_i to procindex * 10 + 16 V' a$ c0 ?8 e
    move into Q_induct(procindex)+ F' |! |5 ^) \9 p2 ^1 D  t  s, D
    move into pickaisle.induct(procindex). w% F' B; k! ?1 r
    /*check the type of pickaisle.induct(i), for your last problem.*/5 [- Q& W9 F( b$ }( f; `2 ~
2 G! N3 B  m/ I9 v- x
    while A_i<=30 do begin
% X8 R/ q$ t% j9 y+ V, o        travel to pickaisle.con(A_i)
" w. C  H7 r0 @8 o% P0 P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ K* y8 p" V$ g- n2 v1 F0 K
        else wait for 10 sec5 x3 n' E* j. V* I
        if A_i=A_leave then send to die- M* X6 J! {  Z4 o2 N, z
        else inc A_i by 1$ q) _# i0 ~+ b
    end
& v  k9 H: q8 R, z7 G- F- Kend
6 a% y4 j; E7 m6 V
/ T4 Q6 m* {8 S; B' Z$ R+ F其中的procindex为整形,代表当前process的序号。, n7 q4 s6 ?: e
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-3-8 07:09 , Processed in 0.016849 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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