设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15080|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: Y: F9 A/ s1 e/ T9 K7 N) o1 Q  M

7 u, o" ^- ?# c* u7 R& }; 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中的数值,不知道会不会有什么不妥。3 i3 ?9 k4 J6 |! w% L
4 D' T5 s/ j. b! z/ V  g
begin P_read arriving# A( ]' t/ a9 p1 w" y# o
    while 1=1 do begin
' p- R; b9 l, h        read A_tote from "data.txt" with delimiter "\n"
' \9 p. n7 X6 l; a        read A_time from "data.txt" with delimiter "\n"" F* A) i2 m$ s' l
        read A_leave from "data.txt" with delimiter "\n"
  _8 H. U0 W4 L/ t# N# r) G        read A_picks from "data.txt" with delimiter "\n"
5 F% p' f3 A  C9 p1 Q) L- I: M        set load type to A_tote
$ G5 u5 G+ {0 {( U        if A_tote="tote 1" then set A_induct to 15 Z& Y, x. k9 L5 A$ s, _& x' V' i
        else if A_tote="tote 2" then set A_induct to 20 R1 e" M  G6 L3 N( r& ~2 ~
            else set A_induct to 3   
3 ], ~# p+ O; }) ?5 V$ S# G* h' P( f        set A_i to 0$ I; a' l) u* F5 h( w4 K  c" T. [; M
        clone 1 load to P_induction! U1 Y8 O, _; S* X1 P/ ?
        wait for A_time sec: a4 _" {. K: u' v7 A  W: l8 D
    end
0 k  O. N: c0 a% T/ fend
1 M5 u9 e9 M0 P) h" |2 I
8 G5 X& @! X6 x3 @begin P_induction arriving
; H  x' M, X7 Q9 f6 P! ?; k* M    if A_induct=1 then clone 1 load to P_pick16 N& f* ]8 s& _. q1 F; N
    else if A_induct=2 then clone 1 load to P_pick2
, f1 |; Y: O. E        else clone 1 load to P_pick3: G0 a7 \/ Q" u# K' s
end. P: p  s$ c- J( L

  q/ A8 K; J; c/ Obegin P_pick1 arriving7 y$ F& [+ {6 {/ d1 B9 Z! H. J
    set A_i to 1, d) t9 e& p, J
    move into Q_induct13 H, ]! f0 r2 }, N. @
    move into pickaisle.induct1" G; t8 }5 J2 J7 u$ e' c
    while A_i<=30 do begin
5 Q- O3 U8 o6 k* X1 b% e        travel to pickaisle.con(A_i). l, d5 Y3 j- y& f5 K9 v: i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 s' M3 S( a* V# Z$ l0 s        else wait for 10 sec' U4 }' X; N) K% M% r2 n
        if A_i=A_leave then send to die
- k7 m3 z* M+ r        else inc A_i by 16 Z1 |- S/ w% ~  w, ]# l0 z
    end& f) K; Q7 \4 G5 w
end* I  i% b2 E4 f8 H+ x

1 O+ e6 X4 v2 o4 N' t2 Rbegin P_pick2 arriving! J+ R# o5 W  O  x/ A
    set A_i to 11
3 K3 \5 ]1 M. j2 V    move into Q_induct2
% {4 B  J$ n# n# y( p, j! J: _6 j    move into pickaisle.induct2
9 D6 K! M) |/ I/ L8 i( {    while A_i<=30 do begin
$ `* f2 N8 {! J9 \7 L) p        travel to pickaisle.con(A_i), a5 o5 u4 q) z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: x6 c; h! k  O' ]/ E0 L+ W( V2 U        else wait for 10 sec+ \) o& \$ Q. @% q0 w" i8 R# ^
        if A_i=A_leave then send to die( ~) S7 S! {! u5 z7 ?1 D9 `  T
        else inc A_i by 1
; g/ S& M5 r: {; D- O1 h    end. V( [2 C! ^; L( _# |
end/ W" `  S9 i$ X4 m7 ^$ i
0 `4 H+ p: f3 {* X# i  l
begin P_pick3 arriving5 J7 y" t- w' D: A
    set A_i to 219 M# F5 S5 g" E" U; N9 ~
    move into Q_induct3* `4 ~, F; ~8 |1 l# I' w! {+ K
    move into pickaisle.induct3
- v( h0 Q5 E7 s0 _    while A_i<=30 do begin' ~3 h2 P8 t! v9 n
        travel to pickaisle.con(A_i)# v/ l. F, F. N" |; Y! p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. R* s  f1 s0 e6 ]' @$ {/ c& |        else wait for 10 sec
. d$ Z! r, @5 y; ^4 J        if A_i=A_leave then send to die- M) P% q: U/ B5 i
        else inc A_i by 1
5 q9 Z% z+ Z, Y9 C2 h' p$ `" i, D    end
+ o" v. T- k- v4 p/ X/ K' mend

最佳答案

查看完整内容

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是个什么东东?0 N# T1 J4 g- }, i/ H- i, P) l
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' {$ U2 w, N& g4 m: J2 p3 B* J! e8 W! S# j  J+ R, `
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。  A' Y, w$ [+ y3 M8 s* O7 g; b

, J; H9 z/ `) [+ ^另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, G& j; M6 _1 ^. [) W
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
: D' Y  H1 T* a: y9 \2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ t2 E5 E, j7 n6 n/ K: e" p
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& p( c- I0 E6 S& W/ Q! X
begin P_induction arriving8 Q  R% W1 Q3 w9 d: F
    clone 1 load to P_pick(A_induct)
% Y: G/ B$ O( L$ q" l4 ^end最大的系
6 o3 h# F; b, b  ~6 i1 g
/ R7 L" F, v( {/ j3 pbegin P_pick arriving7 j" H( ^* r6 b( b* o5 G: `
    set A_i to procindex * 10 + 1
6 q" b3 c- ^6 l' a1 u/ U    move into Q_induct(procindex)
' D+ D" R3 o4 M4 a! B5 I( M: b+ N( C    move into pickaisle.induct(procindex): B+ [! P7 o. y; U1 G. ~- ]
    /*check the type of pickaisle.induct(i), for your last problem.*/+ B3 K; k3 K: |+ o$ d1 Y$ |! Y, k- Z
+ H2 G$ i4 R- ^* t& c
    while A_i<=30 do begin
7 u2 O5 Z  z* h        travel to pickaisle.con(A_i)3 Y! n. f2 b8 a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 Q$ c( G, @9 k0 Q
        else wait for 10 sec2 {1 w% T$ |5 E
        if A_i=A_leave then send to die
6 c7 W4 b) Y3 `) c        else inc A_i by 1
5 t. E3 y& E4 Q6 C4 m' P0 t1 J    end7 K) Y0 E) b; H5 `( E' w
end, z9 v, g3 @9 \; i- W, {
" \/ C$ H5 @' J4 `, }/ v5 a# L
其中的procindex为整形,代表当前process的序号。
) s" _* y1 A8 A5 L# Wstation和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-8-8 15:48 , Processed in 0.016650 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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