设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14681|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 i- `4 `+ m1 M0 r8 J0 q( ~
' T) D; s  v. W& C0 ^) ~* e我的问题是,在每个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中的数值,不知道会不会有什么不妥。- R& k8 @) A% E$ k2 c: Y
& r- H* t2 X0 i! D8 I! l
begin P_read arriving
  z1 e) x: f) Z& G; t    while 1=1 do begin) U8 D) ~; p' A  R- }+ B
        read A_tote from "data.txt" with delimiter "\n"
5 K: a1 @. ?" `' [' x, W6 R        read A_time from "data.txt" with delimiter "\n"5 K9 Q. l! M$ D8 q; i9 e1 Y
        read A_leave from "data.txt" with delimiter "\n"
$ w# F; U; @* r, u! ^" d+ L        read A_picks from "data.txt" with delimiter "\n"! ~0 D$ _+ n$ o  }. _2 O9 r# H
        set load type to A_tote
5 E2 |  |' h- G5 c( V5 T        if A_tote="tote 1" then set A_induct to 1
7 @) C; r0 s, l5 c, N1 _; r1 l- L        else if A_tote="tote 2" then set A_induct to 28 H( |) s/ v9 z+ t1 Z# U4 ?
            else set A_induct to 3   
+ `+ v& ]! N( M8 g% j        set A_i to 0
- X0 Q3 r; x2 M' L6 S6 B8 o5 [2 Z        clone 1 load to P_induction) J' ?1 L. ^; J/ p5 K) e) }$ `
        wait for A_time sec3 D( l5 Q: q" e# I3 l
    end
. H& D" U/ B$ i  i8 }end
1 Z, d* H+ l) E0 r
  y! \0 ^. ?8 Fbegin P_induction arriving
, J3 Q* T' z  ~4 u" e' k    if A_induct=1 then clone 1 load to P_pick1
. I4 V% ?8 a1 X# P5 Y8 w% {    else if A_induct=2 then clone 1 load to P_pick22 ^  i( a- N" \( A: y+ E8 k
        else clone 1 load to P_pick3( p% M' F- |% X& ?/ t
end- M9 V2 s) B7 J9 C  V; U+ s

! V, ^* ^2 c+ n0 h7 Ubegin P_pick1 arriving- k2 k# e0 i9 h6 R! ^- K" k% f
    set A_i to 14 C: p5 m) }3 X8 Y1 n: W
    move into Q_induct1
" q& p% z9 p9 q3 q    move into pickaisle.induct1
8 ^' O- Z3 [, v+ q+ {% }    while A_i<=30 do begin
0 F: F2 b' ]2 O' U3 |5 i        travel to pickaisle.con(A_i)7 _4 V! `* U% Q8 r- P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ k* z/ N- h' f1 e: c; u
        else wait for 10 sec
" o) q9 D8 V4 w" i! `        if A_i=A_leave then send to die- Q- P. s- R; |" B; T) K
        else inc A_i by 13 r0 W1 Q; @9 Q- a' t0 v* I3 k
    end2 s5 u7 s2 Z# N& p) n
end+ g4 p- Y+ |. |3 r& U5 f

4 m* _# ?) x  x2 W, O5 I6 Ebegin P_pick2 arriving" D3 H4 A8 s3 n# H- U$ \( O3 K3 u7 x
    set A_i to 11, B9 T9 p) D4 h$ h/ W$ z6 d; K
    move into Q_induct2
2 G' O0 x% s/ D. x! d' m    move into pickaisle.induct2/ n2 u8 p2 Y/ m9 T: o& ]+ t
    while A_i<=30 do begin
1 i1 W1 S/ q& O( a: x8 @8 N        travel to pickaisle.con(A_i)
, N% ^: o. [! O" r  V" N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 T4 p0 U" i4 `2 K2 I) f        else wait for 10 sec  \! F. ^2 @+ J
        if A_i=A_leave then send to die
; o/ }3 ?; y! b        else inc A_i by 1/ D  I) K  T3 t( j, L
    end
0 ~: C, c' _. R1 V& D3 ^6 k+ L) U- uend) W4 M" [+ O* f. ^2 v
9 i0 m! {" f6 S4 Q+ O
begin P_pick3 arriving7 W$ f# A, p7 @9 O/ B6 V% V1 l
    set A_i to 21
. ^/ R6 d0 {1 Z# c0 M) v    move into Q_induct35 o( k8 s' |  y
    move into pickaisle.induct39 A" p% F& `3 j1 F
    while A_i<=30 do begin
' B; z, M; k7 }; L( B6 }        travel to pickaisle.con(A_i)$ H/ @) [# r  A8 j; X' P: K+ S6 _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 K# w  [9 U. ]& i7 u8 M* f* i0 f
        else wait for 10 sec5 ?( _* |; Z  l0 t8 ~; t9 ~
        if A_i=A_leave then send to die
9 L& H- ~% V7 ~4 E1 i% D        else inc A_i by 1
+ I$ _8 g. `( n! H! W$ K( Y( l    end2 k, c9 F. j5 R, b8 w( W
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是个什么东东?
% m, V' q+ o0 U; w& p7 g9 M6 Xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' H. T% l9 l- ?7 k1 @, w9 n( W" o
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' a  p8 w) s6 t- Q: k: \# F/ [" |- l" v
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 x/ Q/ N2 Z$ D/ s( ?
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
* `* s# n. b7 p: g' O/ T- k$ J2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ Q" h: g5 q! x- a' u8 G1 q# `& D3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: k" Z6 S3 j7 B! p; A/ Q. G
begin P_induction arriving# K9 s; n: f; o, x# @
    clone 1 load to P_pick(A_induct)7 q" v! p9 p  S0 S
end最大的系
0 @' j9 |0 E* g5 X& c( T2 _5 f# H- z4 M
begin P_pick arriving% @. J: D' I9 i& K4 g7 p# S
    set A_i to procindex * 10 + 1' Z# \+ W( E# ]  S' t
    move into Q_induct(procindex)
/ G  r+ x1 J2 I" K# [3 [! k    move into pickaisle.induct(procindex)
2 S. E5 }# v' t* H8 ~' S    /*check the type of pickaisle.induct(i), for your last problem.*/: o4 g8 r% t/ F5 v( y

' G1 p& {2 N& F: q* R    while A_i<=30 do begin
  l; x+ s7 h) d" N- ~6 s' {6 {        travel to pickaisle.con(A_i)2 l6 J. t, {& P. P6 \# C/ _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, t4 f- o. f0 P5 H( ~) x1 O        else wait for 10 sec+ E- P9 r) j7 P* S6 F" j* e; P1 w
        if A_i=A_leave then send to die
( G( |! n# n- z0 C; M. I/ c& w        else inc A_i by 19 ]4 k4 p1 N  J4 g
    end
  _# r' f8 G" f7 Rend
( ]: A! C0 s5 g1 \- E( n0 B- r
) o9 H) ]3 e+ `3 X7 f! A其中的procindex为整形,代表当前process的序号。
6 q+ n+ @  U, Tstation和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-7-21 00:11 , Processed in 0.016048 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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