设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12781|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& O5 x7 y, G8 {) J
2 Y' Z0 _6 }' b3 d- y5 `& K
我的问题是,在每个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( V) |( r- ]  H( ]( o) }6 U
% |2 ^* X: ]/ S* I9 Z- o
begin P_read arriving% d6 T; u* v+ t5 H
    while 1=1 do begin2 }  u3 i! k0 G* T& n
        read A_tote from "data.txt" with delimiter "\n"
  B8 b5 c3 h0 V/ U$ W% G7 s        read A_time from "data.txt" with delimiter "\n"6 p4 v- z: E* b+ Z5 p7 c
        read A_leave from "data.txt" with delimiter "\n". h! @* L" G+ g/ n; Q4 c/ }, e, A
        read A_picks from "data.txt" with delimiter "\n": w- P4 v: D" A! X% P% z
        set load type to A_tote, v1 P- Z6 D9 ~1 q
        if A_tote="tote 1" then set A_induct to 19 l5 u( Z+ \% U. B# C' r- }
        else if A_tote="tote 2" then set A_induct to 2
4 U. ?/ t/ H; S8 p* R            else set A_induct to 3    ; X! i! ]6 e: d8 J  u
        set A_i to 0
0 C, Q) z% N8 V& P+ q5 o+ h! ~        clone 1 load to P_induction6 t9 k' z. M% F( |# p
        wait for A_time sec
$ M( [) a0 e  U4 x4 f5 {) i    end6 l' l# X9 k, E  S8 P6 v( ]
end
" n% `4 t3 d* M& F/ ]
1 R; f0 |8 S( A: Cbegin P_induction arriving
# B- k+ h6 B& `" [; R/ @# a    if A_induct=1 then clone 1 load to P_pick1
9 u# Q9 i' m- X% _    else if A_induct=2 then clone 1 load to P_pick2
3 k7 v' ^' R$ O3 p) n; ~        else clone 1 load to P_pick3
  x! n4 L3 B3 K  }( P+ H' `end9 V! g1 W/ D3 X/ [" f
: T# J, n4 Q* @1 I
begin P_pick1 arriving
5 ?8 \1 n/ H: F# T5 r    set A_i to 12 b5 O( Z5 \5 f& p9 A
    move into Q_induct15 D5 y7 m% S4 N/ ~5 D
    move into pickaisle.induct1
; Y* L) ?% ~1 Q* _- ~' s    while A_i<=30 do begin# {& p5 `; I- X9 s% F& n, d0 L
        travel to pickaisle.con(A_i)* K% s5 ?& z; ^  F" ]5 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" N, _3 f1 `) A  H; C( a) h4 k8 i        else wait for 10 sec2 R- \. H6 H# ]% ^
        if A_i=A_leave then send to die+ s( W7 n$ M" I* Y  L
        else inc A_i by 1  o& z; p/ S" u: A
    end
+ L! d2 u/ ^9 R9 Z$ Jend3 y  M$ s; H* I6 E5 N" m
1 }: Z7 B9 K& f
begin P_pick2 arriving
$ e* D2 O# W& R! \5 H    set A_i to 110 K$ j+ K4 V* u" C7 L6 D7 t* J
    move into Q_induct2, x3 r! g0 J5 |5 H8 G0 l
    move into pickaisle.induct2" |3 O& A( L% h5 r$ ]
    while A_i<=30 do begin8 q2 m/ P  s- q; o  U
        travel to pickaisle.con(A_i)
: U) `6 H7 p8 ]! `  C% C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! F! M5 t$ Y: R1 l4 o8 @- k4 E        else wait for 10 sec
, l8 [* ?- J  J* ?* L' [* D        if A_i=A_leave then send to die
  {6 Q8 Y! X, S3 _  [. s0 X        else inc A_i by 14 Q' _- Y* R% k8 a, j
    end
" g& R9 t" J+ r" R, vend
( I5 m% [5 e# I2 k
4 u/ N( k4 r* i8 Y2 M& h# @begin P_pick3 arriving
+ b7 ~! J9 T9 O( p4 p    set A_i to 211 Y3 P  ]9 q8 x: d
    move into Q_induct3
1 @2 `3 I* ?% [( x    move into pickaisle.induct3; i! g/ ]% y- Q+ b" ~
    while A_i<=30 do begin
# N% ?/ G1 V% K; T/ C3 N        travel to pickaisle.con(A_i)1 ?+ W( b$ x. P$ x- S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! g5 j0 ]- [3 x  P- D; L! V9 e
        else wait for 10 sec
1 H% U1 M5 G: g* f% j; ]3 W2 {        if A_i=A_leave then send to die
" w* G9 x+ t6 D, W        else inc A_i by 1+ `1 F% {" T  x
    end
* `( V' Q  l2 x" W3 T+ ~0 X% Lend

最佳答案

查看完整内容

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是个什么东东?5 U! o8 f* e1 n2 z. K
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; W' D' z0 }2 p( ?% T; N9 r. f
* A/ Y. Z% H, o0 r3 s
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 j8 F/ R. l( V
" w& p6 _1 q8 _另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- u# c- P6 J* N$ j3 a% J1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 S9 h4 F4 f1 c# ~! ]) B* T2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;: {( A( p% |. W* W7 v8 s0 T: R, B
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 d8 d: c' W& o7 P) k9 d4 @; B! Obegin P_induction arriving8 [% m9 W- e5 p7 ~% H6 l
    clone 1 load to P_pick(A_induct)
% V. ^( j# _" ?! o7 s4 wend最大的系% N  M$ L3 O# P$ M
2 m  N' y# O& F+ i
begin P_pick arriving
) X  `* e, Y5 F  R    set A_i to procindex * 10 + 14 Z( w0 J( K0 b) N- y, P% z. H
    move into Q_induct(procindex)* p8 N& ^) Q& r' M9 e. C
    move into pickaisle.induct(procindex)
4 f& y; n; k+ h: ^, R    /*check the type of pickaisle.induct(i), for your last problem.*/0 `4 V( j' j) }2 @9 ^( ?

* M1 r0 C1 U) g6 S+ G/ G, A    while A_i<=30 do begin8 z0 O  l; i% P3 [9 X5 ^
        travel to pickaisle.con(A_i)& a& Z; v# f/ D* p) L8 g/ Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ r$ w3 P5 r4 q: c
        else wait for 10 sec
! V! ?; ?) I( m; m) \        if A_i=A_leave then send to die
1 w) ~4 R5 F- @: d; M        else inc A_i by 1
1 W, B5 {+ t. R/ M- b( b2 t    end
! {4 O$ f& W" R5 _% ^- T9 A" ?' Send1 h+ D! t  H( \6 ]

. U9 _  e: Y# M( ?" i其中的procindex为整形,代表当前process的序号。
- H) v. L3 \( B4 Sstation和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-2-19 23:35 , Processed in 0.022388 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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