设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6430|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& G  l) C1 E* W6 I4 o" s- |: K! e$ a5 Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
  L4 W0 H# F8 p* Q5 `0 O1 z
) n/ U! o1 {7 z1 `begin P_read arriving
, E7 T2 {: m1 ]7 X    while 1=1 do begin3 h: J0 {& u0 A8 K4 a/ W% F
        read A_tote from "data.txt" with delimiter "\n"1 Z& Q" Y2 V4 N3 O% E3 u
        read A_time from "data.txt" with delimiter "\n"+ q; g4 f8 g4 ?! ~7 K5 F/ F
        read A_leave from "data.txt" with delimiter "\n"8 p2 w% Y. ?8 n$ {5 G! m
        read A_picks from "data.txt" with delimiter "\n"
! `) i8 j! D- ?3 C' q        set load type to A_tote+ w2 V/ J* b7 ^( [# b) ?: j, E
        if A_tote="tote 1" then set A_induct to 1
. M2 [) ~# Q/ V        else if A_tote="tote 2" then set A_induct to 2
. `+ d. c- j+ ^6 i            else set A_induct to 3   
7 y1 _5 \  f/ w7 {        set A_i to 0& J: Y& H& R/ M- A# w5 `
        clone 1 load to P_induction
9 M% @) `. N+ K        wait for A_time sec
. T3 G8 L' W' {6 Z+ s. t    end, W! G$ M0 @6 B3 U
end- s0 @6 c. C' R# P( d+ j  m4 ?

) d; B2 g; s8 ^* D/ nbegin P_induction arriving
; X! `/ B) K/ G( z/ |    if A_induct=1 then clone 1 load to P_pick1
$ E9 U# @2 I& a& g    else if A_induct=2 then clone 1 load to P_pick2& y3 {, i8 |. c" M- F! X6 k' G
        else clone 1 load to P_pick3
$ D0 g$ r5 d- x! xend, T. q8 V4 u" `0 S7 q( B

7 H0 D! o  A+ e9 O3 j1 bbegin P_pick1 arriving: G0 x3 w6 s$ K; j0 P
    set A_i to 1
9 u; i* K; n- O! i0 ~    move into Q_induct1
9 v( j6 j% I! D  F( U2 u& C    move into pickaisle.induct1; k9 P5 |( l, m: O/ n  O$ J
    while A_i<=30 do begin4 e1 Q/ @4 v% Y: ~; t6 O
        travel to pickaisle.con(A_i)
) y$ I% b+ _8 D5 N+ P. b5 s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 t  L0 ^2 S4 u- t
        else wait for 10 sec% b0 B. L' M: T$ }1 k+ x
        if A_i=A_leave then send to die# z9 S4 ?! @/ a' G" {
        else inc A_i by 1: \. J5 b! [0 O2 S9 H' H1 i
    end
, s4 u6 O# O3 j- [) ^$ _8 ~end
& g$ j2 u, P+ o$ j+ ]
' S; h2 ~) u3 q( X: P3 x; X/ j4 }) Tbegin P_pick2 arriving
( v- Y' C3 E7 c9 w    set A_i to 11
/ d, _1 m7 S  u  }8 L4 E8 d1 J    move into Q_induct2
2 P0 k; C5 j( |) j    move into pickaisle.induct2
% I. U: T8 m1 n    while A_i<=30 do begin0 M" {/ h4 z- `2 K% t8 B
        travel to pickaisle.con(A_i)6 F+ ?. D7 |  P6 E/ O2 j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) e. Y! g% B7 x6 I: Q* o. e
        else wait for 10 sec% I8 x: o1 F( s: ^
        if A_i=A_leave then send to die
- w( s6 U' T5 Y% V& j        else inc A_i by 1
; n: h6 O* z5 Z    end
8 S# \' R7 C4 v0 ]end; t/ G5 ^/ T5 M7 e' H' x
; o2 b- c; w: g) T
begin P_pick3 arriving
3 A- v+ A$ S7 H# q* Y% E9 P    set A_i to 21
- W" Z* a  J# k) @# g' y' u    move into Q_induct32 S7 r. T5 H, n
    move into pickaisle.induct3' B: w7 |6 l! R+ a! u# A
    while A_i<=30 do begin
, h: O+ e9 @7 C7 A( F- c! \        travel to pickaisle.con(A_i)
: d2 e  F: V& L. I+ l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" c7 D" I0 h2 |& E7 _7 y
        else wait for 10 sec
- r! {- g* O9 L% q        if A_i=A_leave then send to die
. z& X; n$ ]. \6 Q3 m+ I        else inc A_i by 1# Q+ \; U5 Y) e+ @* L, w" H" h9 j# b
    end
! x' v4 y7 \' k8 E) k, K# Iend

最佳答案

查看完整内容

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是个什么东东?
& K2 f8 Q4 }0 E+ Nmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: D+ e9 I/ s0 |) i% s
& n5 _: s! @* H: y. ]/ V6 RAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 a9 C, G, q8 a; u! _
( V& ~8 E- s! g1 [4 U# b1 |+ h( u另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; B' b' n( d) S8 I' ^8 R% Y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 t8 \; Q( H; P- n2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3 s1 P) g; u7 l# I, V2 S3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 l. I# n4 r. W8 ubegin P_induction arriving! x( ?$ }5 a4 U# }. V9 N  B) |
    clone 1 load to P_pick(A_induct)7 _! n# D0 t! i  J4 q# l
end最大的系" y6 ?8 O" J( W

' Z+ q, Y* {; ]' d, J' G8 s+ y: Sbegin P_pick arriving
- ~" J: d; T5 Z; O3 a    set A_i to procindex * 10 + 1' b: J8 U; E: ?* C" f9 j6 V
    move into Q_induct(procindex)
6 `; Q! H( d7 f2 A    move into pickaisle.induct(procindex)
2 F+ B6 s4 h& g9 e    /*check the type of pickaisle.induct(i), for your last problem.*/
& E( r: x6 N' O9 W; Y3 \6 m' s1 S8 Q. D7 t, V& k0 ~6 ^
    while A_i<=30 do begin6 v8 w, Y1 \7 O4 C
        travel to pickaisle.con(A_i)
' ~# S) |- h9 f2 s8 J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ @* K/ Y: A6 r; i! ?% \        else wait for 10 sec# F4 E0 d7 H# J# K) w
        if A_i=A_leave then send to die
' i4 |( O3 [1 N( D# v( K        else inc A_i by 1
. |! t& \8 c9 E. l    end
/ u: W5 n8 r7 `5 U6 @end( ]+ O& ?$ Z! r, J

" Y6 A/ Q  f0 {* X) _+ U- u- ~9 Q# J其中的procindex为整形,代表当前process的序号。
; o( Z% l1 _! c3 gstation和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, 2024-6-2 06:04 , Processed in 0.015057 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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