设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14800|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, U5 @3 F3 f1 X2 A8 g1 ?
  K: J9 {# ]8 V. q5 B6 _
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ }% `7 w& y) P3 L
0 z! E- a" B( g8 z( zbegin P_read arriving
0 P# ~4 ^5 P( c6 u    while 1=1 do begin# @- S5 {4 n- Q; e. @- ^
        read A_tote from "data.txt" with delimiter "\n"
& m* ~( D0 M! Y$ K" R1 F3 i4 P' L5 ]6 z        read A_time from "data.txt" with delimiter "\n"
3 l# j' f- A( g- e6 d' r1 l# H        read A_leave from "data.txt" with delimiter "\n"9 x8 K+ E6 @9 W) S3 ?) |2 O( ^
        read A_picks from "data.txt" with delimiter "\n"
* g' R2 e( ~8 @, f        set load type to A_tote
/ G& R, ]! R0 v: z$ v* r        if A_tote="tote 1" then set A_induct to 1
" l: f3 R* \; S  ?) Q. D3 K        else if A_tote="tote 2" then set A_induct to 2
& v; n, u% G" P$ ?            else set A_induct to 3    2 T( y% _+ j% @  j; G/ w) P3 [
        set A_i to 0
+ d5 G! ]7 [& @1 e" B9 |        clone 1 load to P_induction
0 ]  \2 L, x; x( P        wait for A_time sec" h- G+ C! ~2 g* w/ ~" a
    end
: ]  j# N# }# W9 V; F' z0 bend3 S3 l* a+ _! o) w6 |- q; Y4 t+ H+ Y
# C! |8 V# ~3 ?: n3 a9 t) E9 x( x
begin P_induction arriving; d5 M9 m5 b5 w/ _0 p+ p; B
    if A_induct=1 then clone 1 load to P_pick1
6 `1 h" d; M8 f; h' w    else if A_induct=2 then clone 1 load to P_pick2
; x9 D0 A" m( \        else clone 1 load to P_pick3& b; x" b+ g" {0 P5 W0 a
end
+ N' L- s+ o' i  k/ u7 N" k5 u1 o$ _) k% }& D6 T# r7 |. R
begin P_pick1 arriving
' M; q. k7 o5 X    set A_i to 1
9 y8 m& b6 B7 v4 [    move into Q_induct1
# ~+ j! [/ y( W2 X3 L    move into pickaisle.induct1
4 w% Z( |5 y9 k$ r    while A_i<=30 do begin+ v2 n9 _- D$ q- c$ {( O
        travel to pickaisle.con(A_i)
9 I& g  Y/ ?+ A! x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: E' z, w& i5 [7 Z2 @5 p% M) q        else wait for 10 sec
. u- m) d. S# S) M' R4 q        if A_i=A_leave then send to die
: q" s0 g, `2 q1 D, v9 N1 O. B        else inc A_i by 1' M2 p6 e1 x+ Z3 Y0 ~% Z* U
    end+ N! Q9 ~8 Y8 Z/ W& J
end
) l( o! I! G3 ]) J5 {0 Z6 K
2 L) s; E- Y: ]# Y% R/ `" }4 Zbegin P_pick2 arriving5 {( l- U0 @& F5 _5 W. s
    set A_i to 11# k/ b7 s0 B( g$ W7 ~5 G, G6 V% w
    move into Q_induct2& _+ G# b. o# i8 R8 f% _
    move into pickaisle.induct2& a& Z5 G/ q. D
    while A_i<=30 do begin
5 f: W& T8 C3 L* p# P        travel to pickaisle.con(A_i)
  F6 E' L6 Z: J7 Y8 G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) g, Q0 h0 s' G7 F
        else wait for 10 sec
+ a5 L6 G2 V( E4 m& P        if A_i=A_leave then send to die
+ m( Y& u$ Z2 U! x' P1 r% j5 q4 B6 X        else inc A_i by 1
9 Y, `4 c+ k' m# D    end
, u/ R: j( p- v1 j  q+ }end
$ e# t; ^0 @- `/ Q' K% [9 B! ?  m; Q( u" L% w5 _7 w2 E5 |
begin P_pick3 arriving
4 Y8 C; x/ `: _- ?/ K8 r4 B    set A_i to 21
! C) J  z: S, |# z    move into Q_induct3
8 ~! b1 `" c  q& K& R6 c/ {. B    move into pickaisle.induct32 q" e6 U  Y) ]4 B$ s/ d' {
    while A_i<=30 do begin: w  w, q/ ^4 [$ r, a% D& u5 G5 e
        travel to pickaisle.con(A_i)
: Z* L: t6 `7 q) M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ E- u+ f( k& M- w) }& W0 _& E        else wait for 10 sec" t( z7 U2 D9 s; `/ a( V  X1 D
        if A_i=A_leave then send to die/ W, f9 O0 }8 z7 U/ y# Z* g  @  D
        else inc A_i by 12 D1 o/ l7 q8 ]# P
    end
9 X9 ^" P0 a2 {, A( Jend

最佳答案

查看完整内容

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是个什么东东?, I9 e( a* P( A
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 L) x# G6 X; `! [( Z
  ]5 y' Q$ j- D3 o+ OAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# ?4 q/ i5 P& h3 H$ `
% D+ R! p9 S4 l  J+ n, ]8 g2 {6 J0 z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. @) j9 y* O* M; l3 x' H
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 H2 V% F: i$ c8 L; G/ T2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 P" p( F- T; c0 V2 J
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) L7 ^5 a, A* w4 ?# O. M' Q
begin P_induction arriving9 L: P) E% I  i9 T4 Q; A- w) ^
    clone 1 load to P_pick(A_induct)6 B, l1 }5 F+ ?4 I" z6 [* b6 b
end最大的系
; S( M% K5 F# G* O; c0 X1 A% p: h8 I- N4 ^' `; H/ x
begin P_pick arriving% s6 {3 f, w8 s5 |$ T: ^+ B
    set A_i to procindex * 10 + 1# z8 v. \# [# i& p* B4 w
    move into Q_induct(procindex); w+ K2 ?5 x6 a$ L) h3 x  g6 j
    move into pickaisle.induct(procindex)" c4 V' S% U& Q2 _( f
    /*check the type of pickaisle.induct(i), for your last problem.*// P- z- _, r7 c

/ `) m8 P, e: r% t" Y* \    while A_i<=30 do begin
1 ?6 t6 s2 Z$ k        travel to pickaisle.con(A_i)
4 G3 @$ e8 @7 T. ~" j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, z# C5 W3 o" `+ C  W0 T
        else wait for 10 sec$ X2 ~- `) O# Z1 M& p) D; e: }2 Q
        if A_i=A_leave then send to die
8 I7 K' b* `$ ~        else inc A_i by 1
1 Z& @9 I+ ?" x! M% `6 {+ U    end  {( e1 p7 y4 s; m8 m. K
end! I" h: n7 x0 l3 S

1 X; D3 a9 f0 u其中的procindex为整形,代表当前process的序号。
+ }+ X5 ~6 Y; r# G# k% L6 bstation和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-27 03:25 , Processed in 0.014091 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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