设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13764|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 Q" {1 D& U  t
8 v3 k  ~: T5 l9 \& ~+ H7 V5 i% r我的问题是,在每个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 ^& t: N- {4 G! t) a
' U8 Q( [1 g- A) j9 a5 r2 F9 x
begin P_read arriving
  U2 A3 }5 A% {# g    while 1=1 do begin) t. H6 J; B% e. G/ J9 B% [1 }
        read A_tote from "data.txt" with delimiter "\n"
- K0 l! Y1 r, P2 f  @/ `+ \        read A_time from "data.txt" with delimiter "\n"
7 ?8 U( P9 R( b        read A_leave from "data.txt" with delimiter "\n"' Q  \0 C; l  U( p& c7 @. `9 [1 b
        read A_picks from "data.txt" with delimiter "\n"
, T2 V' Z7 C9 I& r. T: s. `        set load type to A_tote) K! g; N9 |0 S! C2 Y
        if A_tote="tote 1" then set A_induct to 1
8 h" R: t( m+ S! f( @        else if A_tote="tote 2" then set A_induct to 2
3 ]9 Q1 I; @. P  d9 U            else set A_induct to 3   
! w! g% k" M! d$ T        set A_i to 0
+ i) C) T6 g& `5 v1 `! n, @        clone 1 load to P_induction
7 b. W: C& Y8 {4 t        wait for A_time sec9 t* f8 B$ H- Y1 r4 i( ^( V
    end$ X0 w  Y! C4 ~5 M& L' ^
end. l: B- s- k1 V! H/ N7 V5 U+ I) c' |' d
; k8 F  m! S9 y6 @1 U& K8 {
begin P_induction arriving  p. Q( _! I4 V1 I  ^5 M
    if A_induct=1 then clone 1 load to P_pick1, Y. X+ E0 J& x3 `; `
    else if A_induct=2 then clone 1 load to P_pick2
, l' X9 x- x4 ^& X3 t' G        else clone 1 load to P_pick3
/ H) K$ s; U  Cend
+ V$ {1 }% U. m# o& i) `% w
4 q6 l" n  `) a% `9 s# p2 I, abegin P_pick1 arriving- ]& J; g  v  B( w5 }$ |8 |
    set A_i to 1
4 v. J1 f0 h0 W# r5 Z' x* @: F* E    move into Q_induct1% ?$ K9 I- Y. X8 E( r
    move into pickaisle.induct1
4 d1 b* n/ _9 ?( _6 l) r: N7 _$ ~" ^- R    while A_i<=30 do begin% z0 M4 i7 T6 r# i5 q, @+ {
        travel to pickaisle.con(A_i)
6 E# R( H; y7 A: N5 l; \% Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 W+ N3 u- W' a, n        else wait for 10 sec
  m5 D5 P) L* |, r! S" I        if A_i=A_leave then send to die
- G/ j' t4 i) o; G& A        else inc A_i by 1* d8 E4 w8 }3 g
    end4 \5 S7 A" Y6 r& ~2 b
end
, Q& y: Y' J. _; T
2 s+ l7 J! W# P. I, U0 R1 [begin P_pick2 arriving
' B1 n2 c0 m% Z* d/ T6 q    set A_i to 11: }: a' J6 n. q+ r, z
    move into Q_induct2
. r' o. h0 d9 }& q# H    move into pickaisle.induct25 `7 o" A* c, P
    while A_i<=30 do begin% W, p4 j, @" L( f( q
        travel to pickaisle.con(A_i)% V+ U2 L8 g& G2 T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* G7 Y1 R4 t  a# o( R& G% F: x: Y        else wait for 10 sec
5 \! g$ L* [! U( O1 v" ~- O- j% v        if A_i=A_leave then send to die
  W0 j9 [2 d1 X: [* A( Y3 w/ J        else inc A_i by 1% l) R  F1 x! ^" M
    end
0 r5 U: b6 c% j9 K6 gend/ N" ^! v0 c4 G$ o0 e

. f6 y7 q# \  p3 |! w( e/ S( p) ]begin P_pick3 arriving+ t/ U, X, ~& @8 M+ n4 k# |+ c1 K
    set A_i to 21
; I( C! N- i/ y! @    move into Q_induct3
( L3 R& V4 ?  n9 b    move into pickaisle.induct3  O8 I# X( q# B" T5 N+ V$ X$ p
    while A_i<=30 do begin
" p; m+ O4 E$ I7 k( T! ?        travel to pickaisle.con(A_i)
; `  s5 r! {% a$ y2 T5 j: g, T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 s7 `7 B2 \4 F
        else wait for 10 sec
6 W) u# r4 Q1 j( I4 n, F        if A_i=A_leave then send to die# z% W- L" I9 `
        else inc A_i by 17 H  v9 t4 r2 \
    end5 \* i. p0 t4 t, T9 _+ u* G0 T
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是个什么东东?# \$ E4 {9 M' U9 D5 V& S2 E
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ l. h: B; |2 K7 |; b) x+ i" j8 o. @

( _* _5 K6 k" a+ Z* {9 Z  uAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) t  ^' V! n" Q1 D1 u8 a3 w7 Z. F
) M9 P$ \. W) S; o
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 \4 D( S& J5 _. \% v! W1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! z$ Z: Q) k: j) Q4 I/ f2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  C7 s# p- _& d
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( y2 R$ R1 _/ y7 Fbegin P_induction arriving
; N: d9 H8 D( D' b0 P% @    clone 1 load to P_pick(A_induct)
9 }: G" M% \0 m8 f# w# [, Dend最大的系
4 v" B5 [7 x5 ^1 D5 v0 b) i- `& b  j0 |1 q
begin P_pick arriving
* ]$ Q& p$ l* `5 ?" O+ S    set A_i to procindex * 10 + 1
. D3 T/ d# U" n) I+ b- k    move into Q_induct(procindex)
" [, x1 H/ _  \7 {$ }* i0 _    move into pickaisle.induct(procindex)) }, e. K2 {8 t* ^/ Y
    /*check the type of pickaisle.induct(i), for your last problem.*/
/ s9 f# A0 @7 C! v  o# v) ~0 o; A) _  |( N8 K* X5 G2 R) p+ W1 L
    while A_i<=30 do begin0 W8 r( z0 _( B$ `' r
        travel to pickaisle.con(A_i)' X$ B6 u! t7 `1 n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) K! ~( K0 G6 P9 X5 A, ^2 p; M. ^$ P( M
        else wait for 10 sec; n+ ~) Q5 y  F/ {; x2 L3 S2 N5 @# H5 b
        if A_i=A_leave then send to die
& |0 r5 j$ Z( B% E7 s3 N        else inc A_i by 1& x$ u5 C# a7 G& H% J, M
    end2 R- W% b5 w- R; }
end- Y6 n/ b' V$ f- J0 L9 r

7 ?. t% h5 t9 d$ U. O0 ~* p  r& G其中的procindex为整形,代表当前process的序号。
* {: C6 r/ s9 h: t2 T. Ystation和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-3 22:58 , Processed in 0.024792 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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