设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15375|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ c8 p7 U, Q( q: a$ O

, J- L) m9 x5 m! ?& P我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ y3 @5 j9 e; ]. r3 `

! i( x( J' d( E2 Z4 C& l- h4 Y1 x3 ebegin P_read arriving2 v! _- ~+ Q& i6 ^# Q
    while 1=1 do begin
7 i3 T% ~6 m( M% v( r. u" I        read A_tote from "data.txt" with delimiter "\n"& C1 i5 n% P7 j8 ]& N
        read A_time from "data.txt" with delimiter "\n"7 ^% T- z" a! @
        read A_leave from "data.txt" with delimiter "\n"4 G9 d4 T7 K) ]: D3 q
        read A_picks from "data.txt" with delimiter "\n"7 k5 {, d2 r9 \  J8 m2 E0 g) s
        set load type to A_tote
! B; _1 m$ v: ^! h& i        if A_tote="tote 1" then set A_induct to 16 K# t2 V5 a' B1 ~: A; A
        else if A_tote="tote 2" then set A_induct to 2
; D" E; X+ a1 S7 F+ H% W9 S            else set A_induct to 3   
1 I; G/ {9 J5 p& b3 ~        set A_i to 0- }( A7 q# h- V, x% g- N4 A
        clone 1 load to P_induction0 ?1 ~' L4 r' n- z3 b% x
        wait for A_time sec
5 E9 f9 c% ~% X- x5 ~    end9 I( J  d& R$ i9 v9 w
end' i* |3 @. ]" g: c% H% r

' Q& G( |. r& O' C& E3 P! abegin P_induction arriving  I8 [) V2 S3 o+ y; l
    if A_induct=1 then clone 1 load to P_pick1
8 g5 X% k  n9 l    else if A_induct=2 then clone 1 load to P_pick2
! ?5 D+ \  P0 C; }        else clone 1 load to P_pick3! R. N( i6 T7 g( o+ |- z6 E( F3 K
end
! ]3 j: x  g8 s* x9 R3 R8 [% P! }2 C' }( M
begin P_pick1 arriving) K0 A# W& z) z/ s5 O" J) z
    set A_i to 1
% G  T- i, K* ^) K- k% ?    move into Q_induct1% I2 {7 Z: A( Z+ m" D) d% V
    move into pickaisle.induct1
% o6 q2 I6 q0 o/ M    while A_i<=30 do begin/ a. k( M5 q6 E# Z* u$ q! |
        travel to pickaisle.con(A_i)8 c) A- K; C( s; M+ r2 B6 l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! i% i. r3 H% w2 x* u! _8 o6 E" h
        else wait for 10 sec* c  p2 W- K% t5 N9 A1 X, Y
        if A_i=A_leave then send to die
; s0 {- s4 p. J4 g$ t. }$ _        else inc A_i by 1
& m7 z& n1 l' s! v0 y9 U9 C: |    end2 Q! E! t5 T- l% `8 f1 Q8 m8 u6 t* X
end
/ ?( n- Q7 @" r$ s/ F' P) S6 M2 U/ `5 w! J" V7 v+ V2 }
begin P_pick2 arriving
- N# `8 z0 ]8 z1 j    set A_i to 116 M1 L$ Y3 j" H8 |) d( Y
    move into Q_induct2. Z' E* V6 i3 z; ?$ F2 v
    move into pickaisle.induct2( E) u2 p% `; f! ?
    while A_i<=30 do begin
" K" J- a% d3 f# q! o        travel to pickaisle.con(A_i)# `0 z* N' z# Q: ~7 ^; s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 w! e5 e& ^: v# d
        else wait for 10 sec7 O6 ^: I7 E+ r* n6 Y( S- h
        if A_i=A_leave then send to die
- P9 D4 ~" E8 S( X+ h& G1 a3 a        else inc A_i by 1% g# e. H5 w$ h8 k
    end
9 x( N( i# q; S% uend
3 R# K/ g- q4 }- b7 E+ l0 U! M- B- ~" o- }0 {
begin P_pick3 arriving
' B- z- C" m* L" K, s    set A_i to 21
1 j  h0 n9 w- K* d    move into Q_induct3! a' X, B2 F% R$ O: F2 L
    move into pickaisle.induct3
# T: U: b4 ~7 r6 \. r    while A_i<=30 do begin
, v& c( x+ D# r) m2 r' w        travel to pickaisle.con(A_i)
. a* f1 }4 `: }: |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 g8 l, y+ ?  S' I
        else wait for 10 sec+ O  [, w( Z, q: J" `- z9 C
        if A_i=A_leave then send to die6 P+ ?! j2 T( _& {, |
        else inc A_i by 1
8 x' ]) _/ T% G  B8 u    end( A6 n# X! ]/ K) a
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是个什么东东?  H+ ]! ~( t+ G7 U8 y& \% N
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" M% ]3 k1 ?; L' l7 E" s0 Q! d. D
7 C5 u( @5 W5 @$ H: \& P
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 r3 ]# |5 o. f% o
  u9 W5 D$ s" _- R0 T" b另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 ~& a5 A6 A+ l$ E* r! b$ D. ]1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- z+ N7 v" ]8 ~2 `; |" r- ^2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ ^" q9 h: i9 r5 `9 c) r; ~! Y3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:$ F/ Q/ j& {/ g: D* p/ b
begin P_induction arriving7 y$ Q* |  E" x
    clone 1 load to P_pick(A_induct)  s: z- ~3 n+ H
end最大的系
" a9 `( q  z2 _
$ ~7 \' ?4 J. g, fbegin P_pick arriving
* E% _2 N8 S5 E6 d4 Z* H( t2 i, Y4 w    set A_i to procindex * 10 + 1. I# H3 v6 o' m& C
    move into Q_induct(procindex)0 s5 t9 B: A9 a
    move into pickaisle.induct(procindex)
8 s& [3 y& }5 w" Q    /*check the type of pickaisle.induct(i), for your last problem.*/# k- ]2 q; H3 M: g, ~

! F& [6 Z1 g9 ]% b    while A_i<=30 do begin
' x# G' _& M# ]. V        travel to pickaisle.con(A_i); M* Y; ^- v: ~/ K) i, E: s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 T/ A& q! P1 ?) M% i        else wait for 10 sec1 K; F! j6 R2 A& N: P- O: b; f4 y6 C$ `
        if A_i=A_leave then send to die
. K: I# J7 f1 o        else inc A_i by 15 @3 w% y8 S$ C/ v) `$ t5 L
    end
$ Q  Y: _% u- x- ^9 C! Send
7 y2 j3 `- h3 q- W1 c0 N8 Q% b& i
其中的procindex为整形,代表当前process的序号。& w+ v- B; _: F/ }' ?
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-9-7 00:46 , Processed in 0.020267 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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